The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
Okay.. I want to be able to show on an external page (outside of vbulletin) the number of total regged users, and the number of online users..
This code was workign PERFECTLY with vB114 but it produces an error with vb2.. heres the code.. Code:
<? require("forum/admin/config.php"); $db=mysql_connect($servername,$dbusername,$dbpassword); mysql_select_db($dbname); $loggedins=mysql_query("SELECT COUNT(sessionid) AS sessions FROM session",$db); $tempa=mysql_fetch_array($loggedins); $totalonline=$tempa[sessions]; $registered=mysql_query("SELECT COUNT(userid) AS registered FROM user",$db); $tempb=mysql_fetch_array($registered); $regged=$tempb[registered]; echo "<font face=arial size=2> We have a total of $regged registered users. There are currently $totalonline users online at the moment.</font> "; ?> "Warning: 0 is not a MySQL result index in /home/redg/htdocs/online2.php on line 7 We have a total of 3130 registered users. There are currently users online at the moment. " any ideas are greatly appreciated.. slip |
#2
|
|||
|
|||
![]() Code:
<? require("forum/admin/config.php"); $db=mysql_connect($servername,$dbusername,$dbpassword); mysql_select_db($dbname); $loggedins=mysql_query("SELECT COUNT(userid) AS users FROM session",$db) or die ("oops"); while($loggedin = mysql_fetch_array($loggedins)) $totalonline=number_format($loggedin[users]); $users=mysql_query("SELECT COUNT(userid) AS registeredusers FROM user",$db) or die ("double oops"); while($user = mysql_fetch_array($users)) $totalusers=number_format($user[registeredusers]); echo "<font face=arial size=2> We have a total of $totalusers registered users. There are currently $totalonline users online at the moment.</font> "; ?> [edited to correct invalid query] |
#3
|
|||
|
|||
![]()
i did that, and i only get "oops" now when i go to that file.. any ideas?
|
#4
|
|||
|
|||
![]()
Yeah... I just checked the session table and there is no such field as 'sessionid'.
Replace your first query with this: Code:
"SELECT COUNT(userid) AS users FROM session" |
#5
|
|||
|
|||
![]()
woo hoo!
you seriously rule!!! ![]() ![]() ![]() thanks! |
#6
|
|||
|
|||
![]()
is there a way to put this into a html page?
|
#7
|
|||
|
|||
![]() Quote:
|
#8
|
|||
|
|||
![]()
ahh, but there is
![]() SSI from the .php file |
#9
|
|||
|
|||
![]() Quote:
![]() |
#10
|
|||
|
|||
![]()
The results in VBulletin 2.0 are different to the results in your script. It counts correctly the sessions, but why shows the vbulletin other results? Any suggestions?
|
![]() |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|