mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-29 06:38:52 +00:00
Jump to last post on "View newest unread" when all posts have been read
git-svn-id: file:///svn/phpbb/trunk@4021 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
f0964d4a43
commit
d725a8faf1
1 changed files with 7 additions and 5 deletions
|
@ -74,12 +74,14 @@ if (isset($_GET['view']) && !$post_id)
|
||||||
$sql_unread_time = (!empty($tracking_topics[$topic_id])) ? $tracking_topics[$topic_id] : 0;
|
$sql_unread_time = (!empty($tracking_topics[$topic_id])) ? $tracking_topics[$topic_id] : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "SELECT p.post_id
|
$sql = 'SELECT p.post_id
|
||||||
FROM (" . POSTS_TABLE . " p
|
FROM (' . POSTS_TABLE . " p
|
||||||
$sql_lastread)
|
$sql_lastread, " . TOPICS_TABLE . " t)
|
||||||
WHERE p.topic_id = $topic_id
|
WHERE t.topic_id = $topic_id
|
||||||
|
AND p.topic_id = t.topic_id
|
||||||
" . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND p.post_approved = 1') . "
|
" . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND p.post_approved = 1') . "
|
||||||
AND (p.post_time >= $sql_unread_time)
|
AND (p.post_time >= $sql_unread_time
|
||||||
|
OR p.post_id = t.topic_last_post_id)
|
||||||
ORDER BY p.post_time ASC";
|
ORDER BY p.post_time ASC";
|
||||||
$result = $db->sql_query_limit($sql, 1);
|
$result = $db->sql_query_limit($sql, 1);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue