I've been doing a few modifications so I can pull posts from my forum into my website. I have a page that lists topics in a particular forum and displays the text "Unread" beside them if the article hasn't been read before. Everything is working as expected except that when I click on one of the topics, it marks the topic as read, but leaves the forum it's in as unread.
Code: Select all
$forum_id = request_var('f', 0);
$topic_id = request_var('t', 0);
$max_post_time = 0;
$topic_tracking_info = array();
$topic_tracking_info = get_complete_topic_tracking($forum_id, $row['topic_id']);
if ($row['post_time'] > $max_post_time)
$max_post_time = $row['post_time'];
if (isset($topic_tracking_info[$row['topic_id']]) && $row['topic_last_post_time'] > $topic_tracking_info[$row['topic_id']] && $max_post_time > $topic_tracking_info[$row['topic_id']])
markread('topic', $forum_id, $topic_id, $max_post_time);
I should mention that the link I click does not link to the viewtopic.php file. Instead it links to another php file I created. That file gets the post and displays it in my webpage. Clicking on the link will mark the topic as read, but the forum it's in will remain unread, even if there are no unread posts in it. This won't change until I go into the forum manually via the forum. Seems like that refreshes it's status and it returns to being read.
The code above depicts only the portion of my file that marks the topic unread. Can anyone help me with why the forum isn't automatically updated to read after this?
Thanks for any help