1
Newbb(CBB) version 3.08
Open file newbb/class/user.php line 58 and replace this function:
function newbb_getrank($rank_id =0, $posts = 0)
{
static $ranks;
$myts =& MyTextSanitizer::getInstance();
if(empty($ranks)){
if(!class_exists("XoopsRankHandler")):
class XoopsRank extends ArtObject
{
function XoopsRank()
{
$this->ArtObject();
$this->initVar('rank_id', XOBJ_DTYPE_INT, null, false);
$this->initVar('rank_title', XOBJ_DTYPE_TXTBOX, null, false);
$this->initVar('rank_min', XOBJ_DTYPE_INT, 0);
$this->initVar('rank_max', XOBJ_DTYPE_INT, 0);
$this->initVar('rank_special', XOBJ_DTYPE_INT, 0);
$this->initVar('rank_image', XOBJ_DTYPE_TXTBOX, "");
}
}
class XoopsRankHandler extends ArtObjectHandler
{
function XoopsRankHandler(&$db) {
$this->ArtObjectHandler($db, 'ranks', 'XoopsRank', 'rank_id', 'rank_title');
}
}
$rank_handler =& new XoopsRankHandler($GLOBALS["xoopsDB"]);
else:
$rank_handler =& xoops_gethandler('rank');
endif;
$ranks = $rank_handler->getObjects(null, true, false);
}
$ret = array();
if($rank_id>0){
$ret["title"] = /*$myts->htmlspecialchars(*/$ranks[$rank_id]["rank_title"]/*)*/;
$ret["image"] = $ranks[$rank_id]["rank_image"];
}else{
foreach($ranks as $id=>$rank){
if($rank["rank_min"]<=$posts && $rank["rank_max"]>=$posts && empty($rank["rank_special"])){
$ret["title"] = /*$myts->htmlspecialchars(*/$rank["rank_title"]/*)*/;
$ret["image"] = $rank["rank_image"];
break;
}
}
}
return $ret;
}