I have written myself a custom forum script using php. I decided against using phpbb and others as I wanted 100% flexibility with what I was doing.
I\'ve hit a problem
A lot of the larger forum software uses a tracking table to keep up with who has read what, something like this (heavily simplified):
CREATE TABLE topic_tracking (
user_id INT NOT NULL,
topic_id INT NOT NULL,
last_visit DATETIME NOT NULL,
PRIMARY KEY (user_id, topic_id)
)
You then use a join on this table to check if a post you're displaying is read or not. Since you'll be paging your threads, this should generate relatively few additional queries (depending on how many posts you show per page).
When a user visits the thread, update this tracking table with the timestamp of their visit. Then when displaying your thread links, check this table to see if their last_visit is earlier than the last post in the thread. This also lets you show "updated" threads, not just "new" ones.