Welcome Guest, Not a member yet? Register   Sign In
Building a Read vs Unread Status for a Forum
#19

[eluser]jedd[/eluser]
Bugger. I wrote a lengthy, insightful, cogent, polite spiel about this .. and then it got lost somewhere between pressing Submit and the 'oh, you want to write a new empty message in this thread, eh?' pages. Dangnabit.

With that in mind, what follows is a precis of what would have been the most enlightening message you read all year.

I think that perhaps you are suggesting an approach where you have a table that tracks threads, and records for each user whether or not that user is up to date in that thread or not. And my 'user centric' question would involve inverting that - a table that tracks users, and records for each thread whether the user is up to date in that thread or not. Any new activity in a thread involves scanning the table and modifying the records for each user (or each thread, depending). Is that right? If it is, then I think this is a particularly limiting approach to tracking things.

For any given thread there are several states for a given user:
a) the user has never seen the thread
b) the user has read the thread - including the most recent message - they are up to date
c) the user has read the thread - but has not seen 1 or more of the most recent messages
d) the thread is locked (it has exceeded the length of time a thread may be inactive)

On top of this you have the following variations:
i) a user may wish to unsubscribe from a thread. Thread tracking may still occur, and be shown in the forum's thread list, but notifications stop
ii) a user may wish to ignore a thread, seeing no reference to it in the forum's thread list (I don't know any forums that do this)

For me, the original four states (above) involve:
a) no state information is held at this point
b) the user_thread_message table contains a row with user id, thread id, and the id of the most recent message in that thread
c) the user_thread_message table contains a row with user id, thread id, and the id of the message the user most recently read in that thread
d) no state information is held for the user / thread combination

For © and (d), when a user looks at the list of threads in a forum, for each thread we compare the highest numbered message_id in that thread versus that recorded in the relevant row of the user_thread_message table. Visually this means we, for example, set the subject to be bold, like the CI forums approach.

For the complications:
i) I have a BOOL 'watched' column in my user_thread_message table. On a new message being posted in a thread, this table is searched and the relevant watching users are notified.
ii) I haven't bothered with implementing this (yet).


Messages In This Thread
Building a Read vs Unread Status for a Forum - by El Forum - 11-04-2009, 10:21 PM
Building a Read vs Unread Status for a Forum - by El Forum - 11-04-2009, 10:39 PM
Building a Read vs Unread Status for a Forum - by El Forum - 11-05-2009, 12:15 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-05-2009, 08:23 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-05-2009, 09:45 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-05-2009, 09:58 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-05-2009, 10:11 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-05-2009, 11:51 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-05-2009, 01:06 PM
Building a Read vs Unread Status for a Forum - by El Forum - 11-05-2009, 06:52 PM
Building a Read vs Unread Status for a Forum - by El Forum - 11-05-2009, 07:39 PM
Building a Read vs Unread Status for a Forum - by El Forum - 11-06-2009, 03:35 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-06-2009, 03:40 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-06-2009, 07:14 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-06-2009, 09:12 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-06-2009, 09:17 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-06-2009, 09:24 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-06-2009, 09:31 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-06-2009, 11:29 AM
Building a Read vs Unread Status for a Forum - by El Forum - 11-06-2009, 12:50 PM
Building a Read vs Unread Status for a Forum - by El Forum - 11-06-2009, 03:04 PM
Building a Read vs Unread Status for a Forum - by El Forum - 11-06-2009, 04:22 PM
Building a Read vs Unread Status for a Forum - by El Forum - 11-06-2009, 06:45 PM



Theme © iAndrew 2016 - Forum software by © MyBB