Search code examples
forum

How does the "mark as read" system on webforums work?


I've wondered about this for some time now. I'm wondering webforums implement the option to highlight something you haven't read. How the forum knows.

Since most webforums have a function to show you all posts since your last visit, they must save the last time you visited one of their pages in your userdata in the database.

But that doesn't explain how individual topics are still highlighted after you've read just one.


Solution

  • Keeping track of what posts a visitor has read is of course not that much of a big deal. Since it's highly likely that the number of posts a visitor read will be much less than the posts not read. So, if you know what posts a visitor has read, you also know what posts this visitor didn't read. To make this less computational intensive you'd normally do this only over a certain period of time, say the last two weeks. Everything before that time will be considered read.