Severian Posted August 27, 2006 Posted August 27, 2006 When looking at the main index of fora, I notice that there is a little bracket after the name of each forum telling me how mant people are viewing that forum, eg (2 viewing). How is this calculated? Since you cannot constantly check people's browsers to see what page is open, it must presumably be measured by number of times the page was loaded in the previous x minutes? Is this right?
Sayonara Posted August 27, 2006 Posted August 27, 2006 Each member or visitor who is online creates a session on the server, in which all manner of variables can be stored. "Last page viewed" could be one of them, then it's just a matter of collating that information. That would be quite inefficient though... the method you suggested would be much less resource-intensive and not unforgivably inaccurate.
Cap'n Refsmmat Posted August 27, 2006 Posted August 27, 2006 It's the same mechanism that determines the "Who's Online" data - every time the person requests a page, the server stores that page's identifier in the database in their session information. Or something.
Dave Posted August 29, 2006 Posted August 29, 2006 The last page visited is stored in the sessions table, and from that one can determine which forum the user is in. It takes only the one query I believe, but I could be hideously wrong.
Dak Posted August 29, 2006 Posted August 29, 2006 Each member or visitor who is online creates a session on the server' date=' in which all manner of variables can be stored. "Last page viewed" could be one of them, then it's just a matter of collating that information. That would be quite inefficient though... the method you suggested would be much less resource-intensive and not unforgivably inaccurate.[/quote'] it'd possibly be more accurate than the method you described first. If i go to new posts > last day, and open all the interesting threads with new replys in tabs, i believe that i'd be registered as only viewing the last tab that i open (wildly inaccurate). severians method would correctly realise that i was viewing more than one forum, at least untill the x minutes expire. out of interest, would it be possible (albeit possibly impractacle) to use onLoad and onUnload to register with the forum which pages your viewing/stopping viewing with the forum to get a pretty much accurate report?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now