From d2d5ecef8d5fba02747b57e58bb89360100ea021 Mon Sep 17 00:00:00 2001 From: Ruslan Uzdenov Date: Tue, 18 Aug 2009 14:51:08 +0000 Subject: Better tracking of global announcements Authorised by: AcydBurn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10018 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'phpBB/includes/functions.php') diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 12272b152c..6750772ebb 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1730,13 +1730,13 @@ function get_unread_topics_list($user_id = false, $sql_extra = '') $tracked_topics_list = array_merge(array_keys($unread_topics_list), array_keys($read_topics_list)); // And the last step - find unread topics were not found before (that can mean a user has never read some forums) - $sql = 'SELECT topic_id - FROM ' . TOPICS_TABLE . ' - WHERE topic_last_post_time > ' . (int) $user->data['user_lastmark'] . ' - AND ' . $db->sql_in_set('topic_id', $tracked_topics_list, true, true) . ' - AND ' . $db->sql_in_set('forum_id', $tracked_forums_list, true, true) . " + $sql = 'SELECT t.topic_id + FROM ' . TOPICS_TABLE . ' t + WHERE t.topic_last_post_time > ' . (int) $user->data['user_lastmark'] . ' + AND ' . $db->sql_in_set('t.topic_id', $tracked_topics_list, true, true) . ' + AND ' . $db->sql_in_set('t.forum_id', $tracked_forums_list, true, true) . " $sql_extra - ORDER BY topic_last_post_time DESC"; + ORDER BY t.topic_last_post_time DESC"; $result = $db->sql_query_limit($sql, 1000); while ($row = $db->sql_fetchrow($result)) -- cgit v1.2.1