The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Extracting Online Users from SQL Database
I started a thread which I wanted to extract the amount of total members on the forum. This has worked wonderfully but I am now looking for a way to extract the amount of users online from the database.
I am currently using a PHP script to call up the database and retrieve the information. However I am not familliar with the table I should be using, I'm currently using the vb_session table but it is giving me a wrong number for online users. My goal is to get the amount of users online (members and guests) on the forum. But this is going to be called from another PHP page not related to the forum. Code:
<?php mysql_connect('localhost', 'thedogtr_stats', 'stats911'); mysql_select_db('thedogtr_amember'); $r = mysql_query('select count(*) from vbulletin_user'); $r = mysql_fetch_array($r); $registeredusercount = $r[0]; $r2 = mysql_query('select count(*) from vbulletin_session'); $r2 = mysql_fetch_array($r2); $onlineusercount = $r2[0]; echo $registeredusercount[0] . ',' . $registeredusercount[1] . $registeredusercount[2] . $registeredusercount[3] . ' Registered Members<br>'; echo $onlineusercount . ' Users Online <u>Now</u>'; ?> |
#2
|
|||
|
|||
Look in the index.php file of your vBulletin site. There should be a section which is commented something like "Online Users" or "Whats going on", there is code there that you could modify slighty and just use that.
Basically this is what it does:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|