1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-24 08:22:07 +02:00

fixes #3285 No rank images displayed in backend and on profile page

This commit is contained in:
Achim Ennenbach
2018-07-17 20:40:26 +02:00
parent 6ab8c5c0f3
commit cf9c222879
2 changed files with 30 additions and 13 deletions

View File

@@ -2834,7 +2834,8 @@ class users_admin_form_ui extends e_admin_form_ui
'gen_datestamp' => array ( 'title' => 'Special', 'type' => 'hidden', 'nolist'=>true, 'data' => 'int', 'width' => 'auto', 'filter' => true, 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'left', 'thclass' => 'left', ),
'gen_user_id' => array ( 'title' => USRLAN_210, 'type' => 'boolean', 'batch'=>true, 'data' => 'int', 'inline'=>true, 'width' => '15%', 'help' => '', 'readParms' => '', 'writeParms' => '', 'class' => 'center', 'thclass' => 'center', ),
'gen_chardata' => array ( 'title' => LAN_ICON, 'type' => 'dropdown', 'data' => 'str', 'inline'=>true, 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => array(), 'class' => 'left', 'thclass' => 'left', ),
//'gen_chardata' => array ( 'title' => LAN_ICON, 'type' => 'dropdown', 'data' => 'str', 'inline'=>true, 'width' => 'auto', 'help' => '', 'readParms' => '', 'writeParms' => array(), 'class' => 'left', 'thclass' => 'left', ),
'gen_chardata' => array ( 'title' => LAN_ICON, 'type' => 'method', 'data' => 'str', 'inline'=>!true, 'width' => 'auto', 'help' => '', 'readParms' => array(), 'writeParms' => array(), 'class' => 'left', 'thclass' => 'left', ),
'options' => array ( 'title' => LAN_OPTIONS, 'type' =>'method', 'data' => null, 'width' => '10%', 'thclass' => 'center last', 'class' => 'right last', 'forced' => '1', 'readParms'=>'edit=0' ),
@@ -2961,6 +2962,25 @@ class users_admin_form_ui extends e_admin_form_ui
}
}
function gen_chardata($curVal, $mode, $parms=null)
{
switch($mode)
{
case 'read':
return '<img src="'.e_IMAGE.'ranks/'.$curVal.'"/><br/>'.$curVal;
break;
case 'write':
$opts = $this->getController()->getFields()['gen_chardata']['writeParms']['optArray'];
return e107::getForm()->select('gen_chardata', $opts, $curVal);
case 'filter':
case 'batch':
return null;
break;
}
}
}

View File

@@ -161,22 +161,19 @@ class user_shortcodes extends e_shortcode
function sc_user_level($parm)
{
$pref = e107::getPref();
//FIXME - new level handler, currently commented to avoid parse errors
//require_once(e_HANDLER."level_handler.php");
//$ldata = get_level($this->var['user_id'], $this->var['user_forums'], $this->var['user_comments'], $this->var['user_chats'], $this->var['user_visits'], $this->var['user_join'], $this->var['user_admin'], $this->var['user_perms'], $pref);
$ldata = array();
if (isset($ldata[0]) && strstr($ldata[0], "IMAGE_rank_main_admin_image"))
$ldata = e107::getRank()->getRanks($this->var['user_id']); //, (USER && $forum->isModerator(USERID)));
if(vartrue($ldata['special']))
{
return LAN_USER_31;
$r = $ldata['special'];
}
elseif(isset($ldata[0]) && strstr($ldata[0], "IMAGE"))
else
{
return LAN_USER_32;
}
elseif(isset($ldata[1]))
{
return $ldata[1];
$r = $ldata['pic'] ? $ldata['pic'] : varset($ldata['name'], $ldata['name']);
}
if(!$r) $r = 'n/a';
return $r;
}