mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-01 14:30:32 +02:00
- fix two very annoying bugs
(1) mark topic read behaving incorrectly if editing posts (the topic gets marked unread) (2) jump to wrong page number (viewtopic with post id) if descending post ordering is set git-svn-id: file:///svn/phpbb/trunk@5471 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -154,17 +154,13 @@ if (!$post_id)
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($auth->acl_get('m_approve', $forum_id))
|
||||
{
|
||||
$join_sql = (!$post_id) ? "t.topic_id = $topic_id" : "p.post_id = $post_id AND t.topic_id = p.topic_id AND p2.topic_id = p.topic_id AND p2.post_id <= $post_id";
|
||||
}
|
||||
else
|
||||
{
|
||||
$join_sql = (!$post_id) ? "t.topic_id = $topic_id" : "p.post_id = $post_id AND p.post_approved = 1 AND t.topic_id = p.topic_id AND p2.topic_id = p.topic_id AND p2.post_approved = 1 AND p2.post_id <= $post_id";
|
||||
}
|
||||
$join_sql = (!$post_id) ? "t.topic_id = $topic_id" : "p.post_id = $post_id" . ((!$auth->acl_get('m_approve', $forum_id)) ? ' AND p.post_approved = 1' : '') . ' AND t.topic_id = p.topic_id AND p2.topic_id = p.topic_id AND p2.post_approved = 1';
|
||||
|
||||
// This is for determining where we are (page)
|
||||
$join_sql .= ($sort_dir == 'd') ? " AND p2.post_id >= $post_id" : " AND p2.post_id <= $post_id";
|
||||
}
|
||||
$extra_fields = (!$post_id) ? '' : ', COUNT(p2.post_id) AS prev_posts';
|
||||
$order_sql = (!$post_id) ? '' : 'GROUP BY p.post_id, ' . $select_sql . ' ORDER BY p.post_id ASC';
|
||||
$order_sql = (!$post_id) ? '' : 'GROUP BY p.post_id, ' . $select_sql . ' ORDER BY p.post_id ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');
|
||||
|
||||
if ($user->data['is_registered'])
|
||||
{
|
||||
|
Reference in New Issue
Block a user