Jump to content

New posts...


rockinaway

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

Archived

This topic is now archived and is closed to further replies.

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