From 3fa29da47dc52ccc3138b9bf14013545be0e90c0 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 1 Apr 2007 16:01:39 +0000 Subject: [PATCH] ok, these should fix the unread tracking bugs (yeah, actually two of them). Watch out for any oddities if you directly link to posts... :o git-svn-id: file:///svn/phpbb/trunk@7257 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/viewtopic.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 3e2ae7b408..ba02cfae0c 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -271,7 +271,7 @@ if ($post_id) $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - $topic_data['prev_posts'] = $row['prev_posts']; + $topic_data['prev_posts'] = $row['prev_posts'] + 1; } } @@ -1490,8 +1490,8 @@ if (isset($user->data['session_page']) && strpos($user->data['session_page'], '& } } -// Only mark topic if it's currently unread -if (isset($topic_tracking_info[$topic_id]) && $topic_data['topic_last_post_time'] > $topic_tracking_info[$topic_id]) +// Only mark topic if it's currently unread. Also make sure we do not set topic tracking back if earlier pages are viewed. +if (isset($topic_tracking_info[$topic_id]) && $topic_data['topic_last_post_time'] > $topic_tracking_info[$topic_id] && $max_post_time > $topic_tracking_info[$topic_id]) { markread('topic', $forum_id, $topic_id, $max_post_time);