mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 12:28:52 +00:00
Merge branch 'develop-olympus' into develop
Conflicts: phpBB/includes/functions.php
This commit is contained in:
commit
c2a19235eb
1 changed files with 9 additions and 3 deletions
|
@ -1654,7 +1654,7 @@ function get_unread_topics($user_id = false, $sql_extra = '', $sql_sort = '', $s
|
||||||
*/
|
*/
|
||||||
function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_time = false, $mark_time_forum = false)
|
function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_time = false, $mark_time_forum = false)
|
||||||
{
|
{
|
||||||
global $db, $tracking_topics, $user, $config, $request;
|
global $db, $tracking_topics, $user, $config, $auth, $request;
|
||||||
|
|
||||||
// Determine the users last forum mark time if not given.
|
// Determine the users last forum mark time if not given.
|
||||||
if ($mark_time_forum === false)
|
if ($mark_time_forum === false)
|
||||||
|
@ -1677,6 +1677,10 @@ function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_ti
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Handle update of unapproved topics info.
|
||||||
|
// Only update for moderators having m_approve permission for the forum.
|
||||||
|
$sql_update_unapproved = ($auth->acl_get('m_approve', $forum_id)) ? '': 'AND t.topic_approved = 1';
|
||||||
|
|
||||||
// Check the forum for any left unread topics.
|
// Check the forum for any left unread topics.
|
||||||
// If there are none, we mark the forum as read.
|
// If there are none, we mark the forum as read.
|
||||||
if ($config['load_db_lastread'] && $user->data['is_registered'])
|
if ($config['load_db_lastread'] && $user->data['is_registered'])
|
||||||
|
@ -1692,7 +1696,8 @@ function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_ti
|
||||||
LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt ON (tt.topic_id = t.topic_id AND tt.user_id = ' . $user->data['user_id'] . ')
|
LEFT JOIN ' . TOPICS_TRACK_TABLE . ' tt ON (tt.topic_id = t.topic_id AND tt.user_id = ' . $user->data['user_id'] . ')
|
||||||
WHERE t.forum_id = ' . $forum_id . '
|
WHERE t.forum_id = ' . $forum_id . '
|
||||||
AND t.topic_last_post_time > ' . $mark_time_forum . '
|
AND t.topic_last_post_time > ' . $mark_time_forum . '
|
||||||
AND t.topic_moved_id = 0
|
AND t.topic_moved_id = 0 ' .
|
||||||
|
$sql_update_unapproved . '
|
||||||
AND (tt.topic_id IS NULL OR tt.mark_time < t.topic_last_post_time)
|
AND (tt.topic_id IS NULL OR tt.mark_time < t.topic_last_post_time)
|
||||||
GROUP BY t.forum_id';
|
GROUP BY t.forum_id';
|
||||||
$result = $db->sql_query_limit($sql, 1);
|
$result = $db->sql_query_limit($sql, 1);
|
||||||
|
@ -1716,7 +1721,8 @@ function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_ti
|
||||||
FROM ' . TOPICS_TABLE . '
|
FROM ' . TOPICS_TABLE . '
|
||||||
WHERE forum_id = ' . $forum_id . '
|
WHERE forum_id = ' . $forum_id . '
|
||||||
AND topic_last_post_time > ' . $mark_time_forum . '
|
AND topic_last_post_time > ' . $mark_time_forum . '
|
||||||
AND topic_moved_id = 0';
|
AND topic_moved_id = 0 ' .
|
||||||
|
$sql_update_unapproved;
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
$check_forum = $tracking_topics['tf'][$forum_id];
|
$check_forum = $tracking_topics['tf'][$forum_id];
|
||||||
|
|
Loading…
Add table
Reference in a new issue