1
simonvl
Adding rank to xoopsuser module
  • 2004/4/12 16:50

  • simonvl

  • Just popping in

  • Posts: 44

  • Since: 2004/1/28


I am trying to get the rank of a user into the variables available in the xoopsusers $userdata[] array.
So far I have::
// After these lines
    
$start = (!empty($HTTP_POST_VARS['start'])) ? intval($HTTP_POST_VARS['start']) : 0;
    
$member_handler =& xoops_gethandler('member');
    
$total $member_handler->getUserCount($criteria);


// I have added

        
function GetRankTitle ($uid)
        {
            
$member_handler =& xoops_gethandler('member');
            
$User= new XoopsUser($uid);
            
$user_rank $User->getRank();
            return (
$user_rank['title']);
        }

and then
// After this line
            
$userdata['name'] = $foundusers[$j]->getVar("uname");
// I have added
            
$userdata['rank'] = GetRankTitle($userdata['id']);


I was using the example in a post on adding User Rank

This does not work- I get Fatal error: Call to undefined function: getrank() in /home/chillout/public_html/modules/xoopsmembers/index.php on line 341. Perhaps the method is no longer compatible with XOOPS 2.06? Please can someone enlighten me?
Thank you very much in advance.
Simon

2
Mithrandir
Re: Adding rank to xoopsuser module

Try to use something like this:
$rank $foundusers[$j]->rank();
$userdata['rank'] = $rank['title'];

without any extra functions or anything.

3
simonvl
Re: Adding rank to xoopsuser module
  • 2004/4/16 0:25

  • simonvl

  • Just popping in

  • Posts: 44

  • Since: 2004/1/28


That's beautiful, thank you!
I have posted a post on the hack forum if you are interested.
THank you for your help, once again! I'm slowly getting the hang of the XOOPS world... and php into the bargain!
Simon

Login

Who's Online

245 user(s) are online (150 user(s) are browsing Support Forums)


Members: 0


Guests: 245


more...

Donat-O-Meter

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

Latest GitHub Commits