PDA

View Full Version : how many ppl are viewing a file?


SiXXGuNNZ
01-10-2004, 10:10 PM
let's say I have a php file named chat.php, is their a way I can do a who's online type thing, that shows which users are currently viewing that php file?

NTLDR
01-10-2004, 10:52 PM
$number = $DB_site->query_first("SELECT COUNT(*) AS views FROM ".TABLE_PREFIX."session WHERE loaction like '%chat.php%' AND lastactivity > ".TIMENOW - $vboptions['cookietimeout']);


Thats the basic PHP to count all the active sessions that have chat.php in the location, the total will be stored in $number['views']

Boofo
01-10-2004, 10:57 PM
I think he wanted to list the viewers names instead of a count. ;)

SiXXGuNNZ
01-10-2004, 11:00 PM
yeah names, and put it in the what's going on box(I can figure that much out) it is definatley a start(getting the total number of ppl) but it would be cool to be able to list the users viewing the chat.php