diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 1351948d28..535f12ee0e 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -794,7 +794,7 @@ while ($row = $db->sql_fetchrow($result))
$poster_id = $row['poster_id'];
$poster = ($poster_id == ANONYMOUS) ? ((!empty($row['post_username'])) ? $row['post_username'] : $user->lang['GUEST']) : $row['username'];
- if (!$view || $view != 'show' || $post_id != $row['post_id'])
+ if ($view != 'show' || $post_id != $row['post_id'])
{
if ($row['foe'])
{
@@ -1124,7 +1124,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
{
$template->assign_block_vars('postrow', array(
'S_IGNORE_POST' => true,
- 'L_IGNORE_POST' => sprintf($user->lang['POST_BY_FOE'], $row['poster'], "', ''))
+ 'L_IGNORE_POST' => sprintf($user->lang['POST_BY_FOE'], $row['poster'], '', ''))
);
continue;
@@ -1139,7 +1139,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
{
$template->assign_block_vars('postrow', array(
'S_IGNORE_POST' => true,
- 'L_IGNORE_POST' => sprintf($user->lang['POST_ENCODING'], $row['poster'], '', ''))
+ 'L_IGNORE_POST' => sprintf($user->lang['POST_ENCODING'], $row['poster'], '', ''))
);
continue;
@@ -1312,7 +1312,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
'U_MCP_REPORT' => ($auth->acl_gets('m_report', $forum_id)) ? "{$phpbb_root_path}mcp.$phpEx$SID&i=reports&mode=report_details&p=" . $row['post_id'] : '',
'U_MCP_APPROVE' => ($auth->acl_get('m_approve', $forum_id)) ? "{$phpbb_root_path}mcp.$phpEx$SID&i=queue&mode=unapproved_posts&action=approve&post_id_list[]=" . $row['post_id'] : '',
'U_MINI_POST' => "{$phpbb_root_path}viewtopic.$phpEx$SID&p=" . $row['post_id'] . '#p' . $row['post_id'],
- 'U_NEXT_POST_ID' => ($i < $i_total && isset($rowset[$i + 1])) ? $rowset[$i + 1]['post_id'] : '',
+ 'U_NEXT_POST_ID' => ($i < $i_total && isset($rowset[$post_list[$i + 1]])) ? $rowset[$post_list[$i + 1]]['post_id'] : '',
'U_PREV_POST_ID' => $prev_post_id,
'U_NOTES' => ($auth->acl_gets('m_', 'a_')) ? "{$phpbb_root_path}mcp.$phpEx$SID&i=notes&mode=user_notes&u=" . $poster_id : '',
'U_WARN' => ($auth->acl_gets('m_', 'a_', $forum_id)) ? "{$phpbb_root_path}mcp.$phpEx$SID&i=warn&mode=warn_post&p=" . $row['post_id'] : '',
@@ -1358,7 +1358,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
$prev_post_id = $row['post_id'];
- unset($rowset[$i]);
+ unset($rowset[$post_list[$i]]);
unset($attachments[$row['post_id']]);
}
unset($rowset);