1
trabis
Patch for newbb - fixing Rank displaying special chars
  • 2010/1/24 14:00

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 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_INTnullfalse);
                
$this->initVar('rank_title'XOBJ_DTYPE_TXTBOXnullfalse);
                
$this->initVar('rank_min'XOBJ_DTYPE_INT0);
                
$this->initVar('rank_max'XOBJ_DTYPE_INT0);
                
$this->initVar('rank_special'XOBJ_DTYPE_INT0);
                
$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(nulltruefalse);
    }

    
$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;
}

Login

Who's Online

364 user(s) are online (124 user(s) are browsing Support Forums)


Members: 0


Guests: 364


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Oct 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits