44 $mimetypes = array(
'image/gif',
'image/jpeg',
'image/pjpeg',
'image/x-png',
'image/png');
59 $xoTheme->addStylesheet( XOOPS_URL .
'/modules/system/css/admin.css' );
60 $xoTheme->addScript(
'browse.php?Frameworks/jquery/jquery.js');
61 $xoTheme->addScript(
'browse.php?Frameworks/jquery/plugins/jquery.tablesorter.js');
62 $xoTheme->addScript(
'modules/system/js/admin.js');
80 $xoopsTpl->assign(
'userrank_count', $userrank_count );
81 if ( $userrank_count > 0 ){
82 foreach (array_keys($userrank_arr) as
$i){
83 $rank_id = $userrank_arr[
$i]->getVar(
"rank_id");
84 $userrank[
'rank_id'] = $rank_id;
85 $userrank[
'rank_title'] = $userrank_arr[
$i]->getVar(
"rank_title");
86 $userrank[
'rank_min'] = $userrank_arr[
$i]->getVar(
"rank_min");
87 $userrank[
'rank_max'] = $userrank_arr[
$i]->getVar(
"rank_max");
88 $userrank[
'rank_special'] = $userrank_arr[
$i]->getVar(
"rank_special");
89 $rank_img = ($userrank_arr[
$i]->getVar(
"rank_image")) ? $userrank_arr[$i]->getVar(
"rank_image") :
'blank.gif';
90 $userrank[
'rank_image'] =
'<img src="'.XOOPS_UPLOAD_URL.
'/'.$rank_img.
'" alt="" />';
91 $xoopsTpl->append_by_ref(
'userrank', $userrank );
105 $xoTheme->addStylesheet( XOOPS_URL .
'/modules/system/css/admin.css' );
114 $form = $obj->getForm();
120 case 'userrank_edit':
122 $xoTheme->addStylesheet( XOOPS_URL .
'/modules/system/css/admin.css' );
131 $form = $obj->getForm();
137 case 'userrank_save':
138 if ( !
$GLOBALS[
"xoopsSecurity"]->check() ) {
141 if (isset(
$_POST[
"rank_id"])) {
147 $obj->setVar(
"rank_title",
$_POST[
"rank_title"]);
148 $obj->setVar(
"rank_min",
$_POST[
"rank_min"]);
149 $obj->setVar(
"rank_max",
$_POST[
"rank_max"]);
150 $verif_rank_special = (
$_POST[
"rank_special"] == 1) ?
"1" :
"0";
151 $obj->setVar(
"rank_special", $verif_rank_special);
153 include_once XOOPS_ROOT_PATH .
'/class/uploader.php';
156 if ($uploader_rank_img->fetchMedia(
"rank_image")) {
157 $uploader_rank_img->setPrefix(
"rank") ;
158 $uploader_rank_img->fetchMedia(
"rank_image");
159 if (!$uploader_rank_img->upload()) {
160 $errors = $uploader_rank_img->getErrors();
163 $obj->setVar(
"rank_image",
'ranks/' . $uploader_rank_img->getSavedFileName());
166 $obj->setVar(
"rank_image",
'ranks/' .
$_POST[
"rank_image"]);
175 case 'userrank_delete':
179 if ( !
$GLOBALS[
"xoopsSecurity"]->check() ) {
184 if (is_file($urlfile)){
185 chmod($urlfile, 0777);
194 $xoTheme->addStylesheet( XOOPS_URL .
'/modules/system/css/admin.css' );
200 $rank_img = ($obj->getVar(
"rank_image")) ? $obj->getVar(
"rank_image") :
'blank.gif';
206 case 'userrank_update_special':
209 if ( $rank_id > 0 ) {
211 $old = $obj->getVar(
'rank_special');
212 $obj->setVar(
'rank_special', !$old );
216 echo $obj->getHtmlErrors();