• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Forum system - how to track already read vs new messages, per user

#3
[eluser]Developer13[/eluser]
I tend to overthink things at times, and I think that's what is happening here. The solution (well, not necessarily *the* solution, but *a* solution) is extremely simple.

Table name: has_read
Fields: user_id, thread_id, date_last_read

When the forum member views a thread, the above table should be updated with the forum member's user id, the id of the thread they are reading and a timestamp.

If the timestamp in the has_read table is greater than the timestamp of the last post in that thread, then there are no new posts for the user to read.

If the timestamp in the has_read table is less than the timestamp of the last post in that thread, then there are new posts that the user has not yet read.

I'd do it this way, because let's say the thread has 50 posts and the user has not read any of them. Let's say the user clicks on the thread to start reading posts but quickly becomes disinterested on the first page of the thread, so the user discontinues reading the thread and goes elsewhere. If I were that user, I would want that thread marked as "read" -- I wouldn't want it not marked as read because I didn't read through every single message.

Make sense? I think you're on the right track overall.


Messages In This Thread
Forum system - how to track already read vs new messages, per user - by El Forum - 03-31-2009, 09:12 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.