Jump to content

show current users viewing a topic


pagegen

Recommended Posts

Hi guys

 

Just wanted to knw whats the php logic needed to create this function which shows current users viewing a topic

 

I knw we can have a database table which stores the topic ID as well as user id and that way we can record who is viewing a topic but what happens when they leave?

 

some users can just close there browser in which case I would never know when they left?

 

 

thank you guys

Link to comment
Share on other sites

some users can just close there browser in which case I would never know when they left?

 

Indeed they can. You also need to include a timestamp and every time you update the table, check for entries older than say 10 minutes and remove them. Its safe to say these users have left or are at least inactive.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.