Jump to content

Recommended Posts

So what if I had 10 new posts. I could pass their values in say $_SESSION['new_posts']. Then once the post is viewed I could remove it from the $_SESSION['new_posts'] array.

 

Then when they log in I retrieve the latest posts since their last log in.

 

HOWEVER this would mean posts they did not visit in the first log in, will not be retrieved in their second log in.. how would I make it possible so that they were...

Link to comment
https://forums.phpfreaks.com/topic/72102-new-posts/#findComment-363428
Share on other sites

more complex forums keep track of the visitors views by updating the 'message_read' value for each message for each visitor. sessions are generally only used to make sure the visitor is logged in. everything else is done by updating and viewing data in the database. for instance, if a visitor logs in and reads a message, that message is marked as 'read' and is therefore no longer new. each time the visitor views another post, a timestamp is updated for that visitor record, basically saying "this visitor was still on the site at x time". i suggest that you download and install phpBB and take a look at how it does things, especially the database structure.

Link to comment
https://forums.phpfreaks.com/topic/72102-new-posts/#findComment-363430
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.