Welcome Guest, Not a member yet? Register   Sign In
Forum system - how to track already read vs new messages, per user
#1

[eluser]jedd[/eluser]
I'm writing a forum system - remarkably simple to write, actually. I've stolen the approach of the CI forums - so I have forums, threads, and messages as a kind of logical presentation hierarchy.

I want to know how you'd go about tracking what threads or topics have new messages, for a given user. As in, what table structure you'd use.

My problem is that I have one (very big) message table, a thread table, a forum table, and of course a user table - and I think that I want to be able to flag each thread as unread/read, rather than per message. Consequently I'm floating the idea of a table with [ user_id | thread_id | message_id ] and adjusting that on every message-read by a given user to denote the latest message in a given thread. However, it doesn't feel very elegant (though I've not cut any code around the idea yet).

I've noticed that the CI Forums seem to cheat a bit with this tracking - older pages of stuff that I have definitely not read, show up as non-new (or read, if you prefer). So it feels like they are doing something a bit tricky and, well, space-conserving in their tracking system.

Anyway, yes, the question is - what kind of data structure(s) would you use to track this, and if you do something a bit dodgy or ephemeral, a la CI's Forums, how would you do that?

I'm happy to post my schema for forum/thread/message/user - though I think that'll be more distracting than helpful, especially as I'm willing to make some savage adjustments to the structure if I need to.


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



Theme © iAndrew 2016 - Forum software by © MyBB