When considering the appropriate schema for phpBB, I found the following:
# Table: 'phpbb_topics_track' CREATE TABLE phpbb_topics_track ( user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, mark_time int(11) UNSIGNED DEFAULT '0' NOT NULL, PRIMARY KEY (user_id, topic_id), KEY topic_id (topic_id), KEY forum_id (forum_id) ) CHARACTER SET `utf8` COLLATE `utf8_bin`;
and
# Table: 'phpbb_forums_track' CREATE TABLE phpbb_forums_track ( user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, mark_time int(11) UNSIGNED DEFAULT '0' NOT NULL, PRIMARY KEY (user_id, forum_id) ) CHARACTER SET `utf8` COLLATE `utf8_bin`;
Then I look here on my wikipedia :
This table stores entries for topics visited to mark them as read or read. We use the mark_time time stamp in conjunction with the last post of topic x timestamp to find out if topic x is read or not.
To determine if a topic has been read, check phpbb_forums_track as well.
Thus, they have a lookup table for storing data related to the user viewing the topic (stream), and then check it for a time stamp in the forum viewing table to determine if the user has viewed the topic.
Jared farrish
source share