The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Amount of users from HTML
Is there any way to list the number of registered users from a HTML file? Perhaps I could integrate a IFRAME which calls a custom PHP file.
The reason is because I'd like to list the amount of registered members on my website homepage. Any help would be greatly appreciated. Thanks! |
#2
|
||||
|
||||
One option would be on your homepage, pull the number straight from your database. If you don't want to run php on your homepage, do the iframe that calls a php file. The code could be:
Code:
mysql_connect('host', 'user', 'pass'); mysql_select_db('yourvbdatabase'); $r = mysql_query('select count(*) from vb_user'); // use the name of your user table $r = mysql_fetch_array($r); $registeredusercount = $r[0]; echo 'We have ' . $registeredusercount . ' users.'; |
#3
|
|||
|
|||
Wow thanks I will try it and will report back!!! Thanks so much.
--------------- Added [DATE]1196109185[/DATE] at [TIME]1196109185[/TIME] --------------- Woops!!!! I had a typo in the vb_user database name. Works perfectly!!! Thanks!!!! |
#4
|
|||
|
|||
Hi Analogpoint,
I was wondering if it was possible to call up the amount of online users (members and guests) from the database as well? I could not find one table which contained who is online, perhaps it is not stored in mysql? Thanks for any help! --------------- Added [DATE]1196223706[/DATE] at [TIME]1196223706[/TIME] --------------- I tried using the _session table but it is giving me a number greater than the one shown on the forum. I'd like it to show the amount of users online in the last hour. Code:
$r2 = mysql_query('select count(*) from vbulletin_session'); $r2 = mysql_fetch_array($r2); $onlineusercount = $r2[0]; |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|