Jump to content

Recommended Posts

Posted

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?

Posted

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.

Posted

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.

Posted

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.

Posted
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?

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.