vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Quick/Easy way to get $totalonline users (current active users number) (https://vborg.vbsupport.ru/showthread.php?t=232179)

nighteyes 01-04-2010 09:26 PM

Quick/Easy way to get $totalonline users (current active users number)
 
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:
HTML Code:

$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/show...t=$totalonline

EDIT: 1 more link for you to check out: http://www.vbadvanced.com/forum/show...t=$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.


All times are GMT. The time now is 02:58 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01017 seconds
  • Memory Usage 1,714KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete