Marking posts as read - how is it done?
Posted: Wed Aug 13, 2003 1:13 pm
How do forum systems such as phpBB mark posts as having been read by any particular user? By this I mean how do they keep track of when to tell a user there are new posts since their last visit?
I am building a simple forum, I have posts stored in a mySQL database, each with a timestamp. User logins are also recorded, with a second timestamp. It is not sufficient to merely compare the post time and login time, since as soon as a user posts, his own post gets marked as being new. Also, a user may not necessarily view a post that is new, and this should remain 'unread' as it were across any number of logins until it is viewed.
What sort of data structure is used to keep track of all this? Is it feasible to store an array of users in the info of a post or vice versa?
I am building a simple forum, I have posts stored in a mySQL database, each with a timestamp. User logins are also recorded, with a second timestamp. It is not sufficient to merely compare the post time and login time, since as soon as a user posts, his own post gets marked as being new. Also, a user may not necessarily view a post that is new, and this should remain 'unread' as it were across any number of logins until it is viewed.
What sort of data structure is used to keep track of all this? Is it feasible to store an array of users in the info of a post or vice versa?