Users online
Moderator: General Moderators
Users online
To be able to display currently active users (say, in a forum) you need to set that activity in the db somehow. If some user leaves the forum (closes his browser, for example), how would you know he had became inactive? You won't be able to update db, because you won't know he actually left at that moment. The solution I could think of is simply logging user's clicks and saving timestamps in the db, and then when you need to check active users, you compare current timestamp with the latest one of each user - if the difference is larger than some time interval, the user is considered inactive, otherwise he's considered active. Is that how you do it, or is there a better way? How does phpBB do this?
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
AJAX solutions are usually more accurate, with 'traditional' users online systems working off unique IPs (to determine guests, not registered users) a google bot crawl can trick your system into thinking there is 100's of extra users on the system since the bots come from multiple IPs, I've had it happen to me a few times.