I've searched both PHP Builder and the 'Net in general for about a week now for the answer to this question, but I can't find it, so I feel justified in asking here.
I'm creating my own forum from scratch using PHP and MySQL. I've thought and thought about how to mark read/unread posts, but the only thing I can find on the 'Net is "select all posts where the latest activity is greater than when the user was last active."
Well, what if the user logged out without reading all the posts in the forum? Both phpBB2 and Invision PowerBoard, the two forums I've downloaded and tested, "mark" them all as read once you logout--or so is my experience, although everyone tells me it saves over their sessions. I'm not so sure.
There are only two other options I can think of, neither of which I like. The first, and messiest, is to keep a list of unread topics of each user, and each time a post is made, go through every user's entry and add that post as read. Not pretty.
The other is to keep a list of the highest read post in any active topic in a table, with another entry for every user/topic combo. This is a little better, but I have a gut instinct that there is an easier way. If anyone has any ideas, please let me know. Thanks.