fix a small mistake (bug #2238)

git-svn-id: file:///svn/phpbb/trunk@6068 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2006-06-15 14:59:14 +00:00
parent 75b3410e83
commit 832faaa6c8

View file

@ -224,12 +224,11 @@ if (!$topic_data)
// This is for determining where we are (page)
if ($post_id)
{
$sql = 'SELECT COUNT(p.post_id) AS prev_posts
FROM ' . POSTS_TABLE . " p
WHERE p.post_approved = 1
AND p.topic_id = {$topic_data['topic_id']}
" . ((!$auth->acl_get('m_approve', $forum_id)) ? 'AND p.post_approved = 1' : '') . "
AND " . (($sort_dir == 'd') ? "p.post_id >= $post_id" : "p.post_id <= $post_id");
$sql = 'SELECT COUNT(post_id) AS prev_posts
FROM ' . POSTS_TABLE . "
WHERE topic_id = {$topic_data['topic_id']}
" . ((!$auth->acl_get('m_approve', $forum_id)) ? 'AND post_approved = 1' : '') . "
AND " . (($sort_dir == 'd') ? "post_id >= $post_id" : "post_id <= $post_id");
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);