The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Theory of how Who's Online Feature Works
Hi Peeps.
I am interested in adding a feature like who's online to my website. I am fairly confident in coding with PHP. What I need is basically the theory of how the Who's Online Feature works and more importantly how it realises a user is not looking at the board no more etc. Thanks for any help which can be offered. |
#2
|
||||
|
||||
ascii flow chart (sort of)
Code:
updating session table.. -- ENTER sql: DELETE FROM session_table WHERE timestamp>(now()-$session_timeout) sql: UPDATE INTO session_table SET timestamp=now() AND session_id=$your_session_id RETURN -- reading sessions table.. -- ENTER sql: SELECT * FROM session_table php: print all returned records RETURN -- You'll also have to generate a unique $your_session_id and use it to track users. |
#3
|
|||
|
|||
Ahhh cool m8ty that helps a lot. One final question tho. When does the function to delete from the session table get executed and in which script? For Eg. Is that run everytime the forumlist is loaded?
|
#4
|
||||
|
||||
There was a script for this at EvilWalrus.com (http://evilwalrus.com/) but the they have seem to delete all the snippets.
|
#5
|
||||
|
||||
Depending on your traffic, you may run it everytime a page is hit, or once every X times. Or you could put it in a cron job and set it off every 5 minutes.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|