[web] Old and New posts in a message board type thing

Started by
1 comment, last by krez 15 years, 4 months ago
Is there any commonly accepted method for determining if a user of a website has read a forum message or not? e.g. here on GameDev.net, the little blue folder means "old post" and the green one means "new post". Cookies would prevent users from using more than one computer, and would also fail if said user clears their cookies or if more than one user accesses the site from the same computer. Storing a per-user-per-thread flag in the database would not be reasonable either, as it would quickly end up with me storing a ridiculous amount of data (number of users X number of threads). My current thought is to store a per-user-per-category timestamp serverside (I'm calling it category, an example would be this "Web Development" category in the gamedev.net forums) which would be updated to the last edit date of the last thread viewed in that category. However if a user reads a newer message first it would mark all the older unread ones as "old"; this is my best bet so far I think, so they might have to suffer through it. My googling has failed me on this one, and I'm not really interested in downloading several forum software packages just to have to dig through their code to figure out a common method for this one thing. My project is not a forum exactly (which is why I am rolling my own), but it is close enough for this to be relevant. Thanks!
--- krez ([email="krez_AT_optonline_DOT_net"]krez_AT_optonline_DOT_net[/email])
Advertisement
Most sites I know do it per session. All posts between the time of the last visit of the previous session and the current time are new posts. Track all posts that the user sees and mark them as visited. You can do this in the database or in a cookie. In the mean time, track the session and update the timestamp on it. When the user logs out or the session expires, remember that timestamp. Anything posted after that timestamp when the user creates a new session should be marked as unread.

<hr />
Sander Marechal<small>[Lone Wolves][Hearts for GNOME][E-mail][Forum FAQ]</small>

Ah that makes sense, thanks!
--- krez ([email="krez_AT_optonline_DOT_net"]krez_AT_optonline_DOT_net[/email])

This topic is closed to new replies.

Advertisement