The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#21
|
|||
|
|||
![]()
Thanks For Your Help
But can you post the whole code? I didnt understand your directions! Thanks |
#22
|
|||
|
|||
![]()
Sorry, I changed the code but it shows me 0members and 0 visitors!
![]() You are on the right way, but there should be one mistake... |
#23
|
|||
|
|||
![]()
Couldnt get it to work either
|
#24
|
|||
|
|||
![]()
Hmm. I noticed the 0 people yesterday, with different settings.
Just tried out: I just changed "$datecut = time()-$cookietimeout;" into "$datecut = time()-300;" And that worked. It just means it shows who's online in the last 5 minutes... Can it be that the $cookietimeout query doesn't return a number but plain text? |
#25
|
|||
|
|||
![]()
This works. I have the timeout settings on 500 seconds in the vbulletin board, so the working skript looks now like that: (remember the right path to the admin/config file!)
Code:
<? require("admin/config.php"); $db=mysql_connect($servername,$dbusername,$dbpassword); mysql_select_db($dbname); $datecut = time()-500; $loggedins=mysql_query("SELECT COUNT(userid) AS users FROM session WHERE lastactivity>$datecut AND userid>0",$db) or die ("oops"); while($loggedin = mysql_fetch_array($loggedins)) $membersonline=number_format($loggedin[users]); $guestsloggedins=mysql_query("SELECT COUNT(userid) AS users FROM session WHERE lastactivity>$datecut AND userid=0",$db) or die ("oops"); while($guestsloggedin = mysql_fetch_array($guestsloggedins)) $guestsonline=number_format($guestsloggedin[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 $membersonline members and $guestsonline guests online.</font> "; ?> |
#26
|
|||
|
|||
![]()
Hey Peter, I tried your exact code,
and it listed 3 members online, But the thing is.... it'sa test board and I only have 2 members total! I don't think it works. Can anyone make this actually list the members name like in the index.php file? |
#27
|
|||
|
|||
![]()
hmm, thats right, something is more wrong, i have nearly the right results like in the vbulletib forum, but only nearly, so i thought at the beginning, the code is right. Sorry, I was to fast
![]() |
#28
|
|||
|
|||
![]() Quote:
Quote:
OK after a bit of scratching my head, I think I have this thing figured out. Code:
<? require("forum/admin/config.php"); $db=mysql_connect($servername,$dbusername,$dbpassword); mysql_select_db($dbname); $cookietimeout = mysql_query("SELECT value FROM setting WHERE varname = 'cookietimeout'"); $datecut = time()-$cookietimeout[value]; $loggedins=mysql_query("SELECT DISTINCT COUNT(userid) AS users FROM session WHERE lastactivity>$datecut AND userid>0",$db) or die ("oops"); while($loggedin = mysql_fetch_array($loggedins)) $membersonline=number_format($loggedin[users]); $guestsloggedins=mysql_query("SELECT COUNT(userid) AS users FROM session WHERE lastactivity>$datecut AND userid=0",$db) or die ("oops"); while($guestsloggedin = mysql_fetch_array($guestsloggedins)) $guestsonline=number_format($guestsloggedin[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 $membersonline members and $guestsonline guests online.</font>"; ?> |
#29
|
|||
|
|||
![]()
Now it lists 0 members and 0 guests online
|
#30
|
|||
|
|||
![]()
OK I figured it out, finally. Change the code as follows. Replace this:
Code:
$cookietimeout = mysql_query("SELECT value FROM setting WHERE varname = 'cookietimeout'"); $datecut = time()-$cookietimeout[value]; Code:
$cookievalue = mysql_query("SELECT value FROM setting WHERE varname = 'cookietimeout'"); $cookietimeout = mysql_result($cookievalue, 0, 0); $datecut = time()-$cookietimeout; Code:
<? include("/path/to/online.php"); ?> Code:
<!--#include virtual="/path/to/online.php"--> Problems? Let me know. It should work now. ![]() |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|