1
smdcom
Show Total Members In Who is Online Block

hi guys.. i would like to display my total members in who is online block... i has applied this code...

Quote:

$result = $xoopsDB->query("SELECT count(uid) FROM ".$xoopsDB->prefix("users")." WHERE level='1'");
list($numbers) = $xoopsDB->fetchRow($result);
$block['total_members'] = &numbers;
where i put it in system_blocks.php

then i edit the block template...

it doesn't work in XOOPS 2.0.7.3.. but i tested in XOOPS 2.0.6 it's work...

any one can help me?

2
Dave_L
Re: Show Total Members In Who is Online Block
  • 2004/9/13 17:31

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


Quote:
$block['total_members'] = &numbers;


should be

Quote:
$block['total_members'] = $numbers;

3
smdcom
Re: Show Total Members In Who is Online Block

still the same...

actually, it just typing error when i type it here... in real coding i use $block['total_members'] = $numbers;

still doesn't working...

anyone has other method to do this?

4
Dave_L
Re: Show Total Members In Who is Online Block
  • 2004/9/13 18:02

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


Try turning on PHP debug, if it's not already on, and adding immediately after the call to $xoopsDB->query():

$xoopsDB->errno() == or trigger_error($xoopsDB->errno() . ':' $xoopsDB->error(), E_USER_ERROR);


5
smdcom
Re: Show Total Members In Who is Online Block

ok...

i on PHP Debug.. i got this

Quote:
Notice [PHP]: Undefined variable: numbers in file C:\Program Files\Apache Group\Apache2\htdocs\tetikus\modules\system\blocks\system_blocks.php line 90


which means..

Quote:
$block['total_members'] = $numbers; <<-- this line 90


the code i put is like thisQuote:

if (is_object($xoopsModule)) {
$result = $xoopsDB->query("SELECT count(uid) FROM ".$xoopsDB->prefix("users")." WHERE level='1'");
$xoopsDB->errno() == 0 or trigger_error($xoopsDB->errno() . ':' . $xoopsDB->error(), E_USER_ERROR);
$numbers = $xoopsDB->fetchRow($result);
}

$block['total_members'] = $numbers;


i test in XOOPS 2.0.6.. it's works.. but it doestn't works with XOOPS 2.0.7.3

Login

Who's Online

122 user(s) are online (85 user(s) are browsing Support Forums)


Members: 0


Guests: 122


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