1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-13 20:24:08 +02:00

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
This commit is contained in:
Ruslan Uzdenov
2009-08-18 14:51:08 +00:00
parent 54362bbe2b
commit d2d5ecef8d
3 changed files with 46 additions and 6 deletions

View File

@@ -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))