PDA

View Full Version : Quick/Easy way to get $totalonline users (current active users number)


nighteyes
01-04-2010, 09:26 PM
Does anyone know if there's a quick, clean and easy way to get the $totalonline active users number online (i.e. 50) without having to run a whole lot of MySQL and PHP crunching code?

I want to make this number available to vBAdvanced via the Plugin system. Something like this would be ideal:

$totalonline = $vbulletin->userstats['totalonline'];

I already use the following successfully:

$numbermembers = vb_number_format($vbulletin->userstats['numbermembers']);
$newusername = $vbulletin->userstats['newusername'];
$newuserid = $vbulletin->userstats['newuserid'];

Any ideas?

Mythotical
01-05-2010, 03:06 AM
Try using this variable:
$totalonline

You can find a useful variable list here: https://vborg.vbsupport.ru/showthread.php?t=179930

nighteyes
01-05-2010, 09:45 AM
Unfortunately $totalonline is not available as a global variable I can access in CMPS. Which is why CMPS has it's own PHP modules that build this data. I only want the current online user count so I was hoping for a clean and easy way to obtain the number. It looks like I'm going to need to run a bunch of code to get it done.

Mythotical
01-05-2010, 02:31 PM
nighteyes: Here you go, take a look at this, you might get what you want from this thread I found on vbadvanced.com: http://www.vbadvanced.com/forum/showthread.php?t=26008&highlight=$totalonline

EDIT: 1 more link for you to check out: http://www.vbadvanced.com/forum/showthread.php?t=1531&highlight=$totalonline

Both of those should provide you with the necessary code, short code possibly, to achieve what you want. Let me know and I'll try to find a shorter way to pull total online users.