Version: , by (Guest)
Developer Last Online: Jan 1970
Version: Unknown
Rating:
Released: 01-01-2001
Last Update: Never
Installs: 0
No support by the author.
I would like to include the $loggedinusers on a non VB page.
I assume that writing this data to a TXT file (and inserting it via SSI) everytime this data is modified would be a PAIN for the server as it may change several times per second when traffic is high... SO... what do you suggest?
Any of you guys could help?
I think that several peopel are trying to integrate vBulletin to sites as much as possible... I think that designwise it is the BEST board (onlineDJ.com looks great with the board, perfect integration) but it would be great to have an easy step by step help to show data to non VB pages, and to easily use the login of the board to other parts of the site.
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
this goes back to asking for a few include files to be made by the developers. would be nice.
ManoOne, the only ways to do it are 1) use an include or 2) have the page a .php page with a direct call to the mySQL database quering number of online users. Up to you which you do, as an include file is basically exactly the same i would not think there is much of a performance difference.
$datecut=time()-$cookietimeout;
$loggedins=$DB_site->query_first("SELECT COUNT(sessionid) AS sessions FROM session");
$totalonline=$loggedins[sessions];
$loggedins=$DB_site->query_first("SELECT COUNT(sessionid) AS sessions FROM session WHERE userid=0");
$numberguest=$loggedins[sessions];
$loggedins=$DB_site->query_first("SELECT COUNT(sessionid) AS sessions FROM session WHERE userid<>0");
$numberregistered=$loggedins[sessions];
$numbervisible=0;
$loggedins=$DB_site->query("SELECT DISTINCT user.userid,username,session.location FROM user,session WHERE session.userid=user.userid AND session.userid<>0 AND invisible=0 ORDER BY username");
if ($loggedin=$DB_site->fetch_array($loggedins)) {
$numbervisible++;
$userid=$loggedin[userid];
$username=$loggedin[username];
$location=$loggedin[location];
eval("\$activeusers .= \"".gettemplate("loggedinuser")."\";");
while ($loggedin=$DB_site->fetch_array($loggedins)) {
$numbervisible++;
$userid=$loggedin[userid];
$username=$loggedin[username];
$location=$loggedin[location];
eval("\$activeusers .= \", ".gettemplate("loggedinuser")."\";");
}
}
$numberinvisible=$numberregistered-$numbervisible;
eval("\$loggedinusers = \"".gettemplate("loggedinusers")."\";");
but then you will have to add this at the top
require("global.php");
it will also mean people on that page will be counted in the online stats
ManoOne, glad you got it working and glad i could help.
Mental Stamina, is must be something like what i posted because that is what i suggested to ManoOne who got it to work, the section you want is in index.php just make sure you require global.php at the top. try it it may well work