11
Mithrandir
Re: How to show the count of registered members on homepage?

That will just show the rank ID and not the actual rank.

$user->rank(); will give the rank name, but with an SQL query for each user.

Try this instead:
$sql "SELECT rank_id AS id, rank_title AS title, rank_image AS image FROM ".$db->prefix('ranks');
$result $db->query($sql);
while (
$rank $db->fetchArray($result)) {
     
$ranks[$rank['id']] = $rank;
}

$users $member_handler->getObjects(new Criteria('level'0'>'));
foreach (
$users as $user) {
    echo 
$user->getVar('uname').' | '.$ranks[$user->getVar('rank')].'<br />';
}

12
iolai
Re: How to show the count of registered members on homepage?
  • 2004/9/21 19:32

  • iolai

  • Quite a regular

  • Posts: 206

  • Since: 2004/6/26


I tried it, but only got blank white screen.

13
Mithrandir
Re: How to show the count of registered members on homepage?

Are you telling me that you are experimenting with code without PHP debug? That's really not very clever.

I made a typo - it should be $xoopsDB->... instead of $db->...

14
Bender
Re: How to show the count of registered members on homepage?
  • 2004/9/21 22:49

  • Bender

  • Home away from home

  • Posts: 1899

  • Since: 2003/3/10


Quote:

solo71 wrote:
Blockutils in the Wolf XOOPS Pack.



I knew it was a regular

15
phillipd
Re: How to show the count of registered members on homepage?
  • 2005/1/20 20:27

  • phillipd

  • Quite a regular

  • Posts: 219

  • Since: 2004/4/20


How do I get my user information? Full name, username and such?

Ahh, I see: $xoopsUser->getVar('uname');

Where can I find specific info on what "getVar" can provide me?

Also where do I find exactly what XOOPS variables I have access to in my php scripts? Is this documented anywhere?

Thanks

Doug P

Login

Who's Online

229 user(s) are online (148 user(s) are browsing Support Forums)


Members: 0


Guests: 229


more...

Donat-O-Meter

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

Latest GitHub Commits