View Full Version : Number of Guests browsing current forum
yasunari
04-30-2002, 11:07 PM
Anyone have a idea how to make it?
I have try to make it by self, but no luck with it :(
Scott MacVicar
05-01-2002, 02:25 PM
Well its not exactly possible as their is a column called inforum on the user table so when a user enters a forum this column is updated in the table.
Guests don't have entires in the user table so they wont show up.
open forumdisplay.php
look for
$datecut = $ourtimenow - $cookietimeout;
below it put
$guestsnum = $DB_site->query_first("SELECT COUNT(*) AS total FROM session WHERE LOCATE('forumid=$foruminfo[forumid]', location)>0 AND LOCATE('forumdisplay.php', location)>0 AND userid=0 AND lastactivity > $datecut");
use $guestnum[total] in the forumdisplay template
I released this hack a few days ago: https://vborg.vbsupport.ru/showthread.php?s=&threadid=38005 ;)
Scott MacVicar
05-01-2002, 04:47 PM
thats not the number of guests, that just the number of users that have user accounts.
I believe that yasunari wanted the number of actual unregistered users browsing the forums.
Admin
05-01-2002, 04:51 PM
That code will only work for people who are browsing forumdisplay.php though, it won't catch guests that read actual threads or something. That will require adding an inforum field to the session table (and removing it from the user table) to keep track of everyone.
/me feels very silly right now...
Scott MacVicar
05-01-2002, 04:58 PM
good point chen, i might try changing of the session table to hold inforum and see how much trouble it causes editing it, I don't expect much though.
Just changing the query at bottom of forumdisplay.php to join the user table based on the session table inforum.
Admin
05-01-2002, 05:00 PM
I'd say remove the field from the user table altogether and just use the session table. You only need to edit updateuserforum() function to chagne the shut down query, and forumdisplay.php to grab the data from the session table... but you'll probably need two queries since you want to group first by userid then by IP address, I think.
yasunari
05-02-2002, 02:32 AM
Yes PPN is right, I need to show the total Guests on each Forums..
I have try PPN's method,it only show the total Guest on the forumdisplay.php,but not the thread err...
*waiting for the new method.. thanks*
RetroDreams
05-24-2003, 12:51 AM
Has anyone released this? I'm also interested in this hack.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.