View Full Version : Who's Online??
punk23
07-08-2006, 07:38 AM
Hi there,
I am trying to get my current users (guests, members and spiders) "on-site" (name and amount) to show in a side bar...but with no luck.
Can anyone please tell me the easiest way to display this info on a 3.5.4 board.
Thanks.
punk23
07-10-2006, 08:08 AM
Hi again,
Is this even possible? With 21 views and no replies I'm beginning to think that it isn't :(
Thanks.
peterska2
07-10-2006, 09:45 AM
It helps if you put the URL to your forums in your profile then we can see what we are working with.
Also, please provide information relating to if the sidebar is on all pages or just one or two, which sidebar modification you are using (if it is from here or custom), and anything else that may be useful (including a link to the style on your site which you are wanting to apply this to).
As a general rule, the more information that you provide, the more chance you have of someone filling your request.
punk23
07-10-2006, 03:27 PM
Hi,
Unfortunately the forum in still under contruction (I will be moving my large and live site there next week)...so I don't want to give out the URL. The sidebar is custom work and is on all pages. I was wondering if there is a standard bit of code that I can place within the code of the bar to display the details as above.
My designer tried a plugin but it isn't pulling the required info into the sidebar;
<?xml version="1.0" encoding="ISO-8859-1"?>
<plugins>
<plugin active="1" product="vbulletin">
<title>Forum Stats, Total Online, Get Newest Member Name</title>
<hookname>global_start</hookname>
<phpcode><![CDATA[// forum stats start
$numbersmembers = $db->query_first("SELECT COUNT(*) AS users,MAX(userid) AS max FROM " . TABLE_PREFIX . "user");
$numbermembers = number_format($numbersmembers['users']);
$counter = $db->query_first("SELECT COUNT(postid) AS posts, COUNT(threadid) AS threads FROM " . TABLE_PREFIX . "post");
$totalposts=number_format($counter['posts']);
$countthreads = $db->query_first("SELECT COUNT(*) AS threads FROM " . TABLE_PREFIX . "thread");
$totalthreads=number_format($countthreads['threads']);
// forum stats end
// total online start
$datecut = TIMENOW - $vbulletin->options['cookietimeout'];
$headerguests=$db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "session WHERE userid=0 AND lastactivity>$datecut");
$headerusers=$db->query_first("SELECT COUNT(DISTINCT(userid)) AS count FROM " . TABLE_PREFIX . "session WHERE " . TABLE_PREFIX . "session.userid>0 AND " . TABLE_PREFIX . "session.lastactivity>$datecut");
$headerguests=$headerguests[count];
$headerusers=$headerusers[count];
$totalonline=$headerguests+$headerusers;
// total online end
// get newest member name and userid start
$getnewestmember=$db->query_first("SELECT userid, username FROM " . TABLE_PREFIX . "user WHERE " . TABLE_PREFIX . "userid=$numbersmembers[max]");
$newusername = $getnewestmember['username'];
$newuserid = $getnewestmember['userid'];
// get newest member name and userid end]]></phpcode>
</plugin>
</plugins>
It shows the total number of posts, threads and members but doesn't pull thru anything about the users online :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.