diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2007-05-02 08:24:05 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2007-05-02 08:24:05 +0000 |
commit | d697124aaf7623b620588bdd918d525b1681994b (patch) | |
tree | e94f14612ed19019414b51ef446f102e4f5622cf | |
parent | 24655d49649b939336f07be207d7a327f6cd338c (diff) | |
download | forums-d697124aaf7623b620588bdd918d525b1681994b.tar forums-d697124aaf7623b620588bdd918d525b1681994b.tar.gz forums-d697124aaf7623b620588bdd918d525b1681994b.tar.bz2 forums-d697124aaf7623b620588bdd918d525b1681994b.tar.xz forums-d697124aaf7623b620588bdd918d525b1681994b.zip |
Fix a bug with the prev_posts calculation and selecting the last post on a page. ;) Now also add the correct number of previous posts not including the selected one.
git-svn-id: file:///svn/phpbb/trunk@7447 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r-- | phpBB/viewtopic.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 29e8282435..ca74ea3154 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -251,11 +251,11 @@ if ($post_id) if ($sort_dir == $check_sort) { - $topic_data['prev_posts'] = ($auth->acl_get('m_approve', $forum_id)) ? $topic_data['topic_replies_real'] + 1 : $topic_data['topic_replies'] + 1; + $topic_data['prev_posts'] = ($auth->acl_get('m_approve', $forum_id)) ? $topic_data['topic_replies_real'] : $topic_data['topic_replies']; } else { - $topic_data['prev_posts'] = 1; + $topic_data['prev_posts'] = 0; } } else @@ -271,7 +271,7 @@ if ($post_id) $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - $topic_data['prev_posts'] = $row['prev_posts'] + 1; + $topic_data['prev_posts'] = $row['prev_posts'] - 1; } } @@ -341,7 +341,7 @@ if (isset($_GET['e'])) // What is start equal to? if ($post_id) { - $start = floor(($topic_data['prev_posts'] - 1) / $config['posts_per_page']) * $config['posts_per_page']; + $start = floor(($topic_data['prev_posts']) / $config['posts_per_page']) * $config['posts_per_page']; } // Get topic tracking info |