Web Hosting Talk







View Full Version : Design issue: message board - tracking read/unread threads


Informity
05-16-2004, 02:40 PM
I'm stuck in a rut over this one at the moment.

At the moment, to track whether a thread has been read, i'm inserting a row into a fully indexed table, then querying for it when required. then I have a cron set up to delete entries that are over 4 days old. the script then shows any entries that are 4 days or older as read, to save DB space.

This isn't a great solution, as if, for example, 5000 users visit the forum per day, and all read 10 threads, that's a table with 200,000 rows in after 4 days.

I've been looking at how phpBB/IPB do it, and i can't seem to work out how it's done with those systems. I believe there is a cookie system used.

I know vBulletin uses a system which is not too accurate, and often shows threads which are read as unread etc., but it seems to work for the most part, but again, i don't understand the details of how this works.

Can anyone advise me on this?

Thanks

ilyash
05-16-2004, 08:21 PM
This is how i have my forum set up..
THREAD ID THREAD AUTHOR THREAD CONTENT THREAD VIEWS ETC.

The table that is "views" or the like..
just do "update"
update TABLENAME set VIEWS = VALUE where ID = THREADID;

something like that.