Re: If wishes were fishes; Marked Thread Unread Button
Uhhh... how to explain it without it getting overly complicated...
When you read a thread it'll do two main things the the read information. Once per game and also once for public threads and another for private.
If it's newer than the most recent thread you've read then it'll update your server-side information (saved in the database) with the timestamp for this latest message. This information is used whenever you log onto a different machine/browser, relog or clear your cookies.
Your browser cookies are also updated to include the timestamp for the post. Read a thread and it'll add the timestamp for the thread to your "I've read this" cookie.
If you've got three threads posted at 7, 8 and 9am and you read the 7am post then your read cookie for the game will add (the timestamp for) "7" to your cookies. Read the one at 9am and your cookies will now have 7 and 9 in it. Read the 8am post and you'll now have 7, 8 and 9.
But here's the rub... cookies have a size limit and we just can't keep on adding timestamps forever. So, what the system does is if there's no earlier posts (the game only has those 7, 8 and 9am threads) then it'll go "pah, I don't need to keep track of 7 and 8am" and it'll in fact say "the oldest thread I've read with nothing older is 9am" (note; not the newest/newer) and it knows anything older than 9am has been read.
If someone posts at 10am then it knows that anything earlier than 9am is read (which 10am is not) and it also doesn't have a separate cookie to say it's been read. So the 10am thread appears as unread.
That, in a (basic and overlooking a lot of stuff) nutshell is how we track threads.
The rationalisation and compacting of cookies is the issues. If I didn't do it then I could just remove that thread date from the tracking cookies, however we remove holes and I'll have to re-add holes in to mark a thread as unread. I'd also have to check if it's the newest thread you've read (that's tracked in the database) and go back to the next earlier thread and save that if it is.
It's all possible (I could also use another "mark unread" cookie) but will just take a little messing around to figure how to do it best. At this stage I'd rather get the responsive site done otherwise I'll never finish it with all the feature creep.