aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2002-02-19 22:09:08 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2002-02-19 22:09:08 +0000
commitb58fca84e6eb70e55db6ba61a999bd94829b2ee7 (patch)
tree58a4497f71cd1b66c966709085f316e907b6eeb5 /phpBB
parent5778b0395c3af92d31aea0a3b8ba0e69aa8b90f3 (diff)
downloadforums-b58fca84e6eb70e55db6ba61a999bd94829b2ee7.tar
forums-b58fca84e6eb70e55db6ba61a999bd94829b2ee7.tar.gz
forums-b58fca84e6eb70e55db6ba61a999bd94829b2ee7.tar.bz2
forums-b58fca84e6eb70e55db6ba61a999bd94829b2ee7.tar.xz
forums-b58fca84e6eb70e55db6ba61a999bd94829b2ee7.zip
Fix bug #520039, moved topics with wrong goto page links
git-svn-id: file:///svn/phpbb/trunk@2198 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/viewforum.php64
1 files changed, 32 insertions, 32 deletions
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index 054cae5587..ebf6d88b85 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -443,8 +443,12 @@ if( $total_topics )
{
for($i = 0; $i < $total_topics; $i++)
{
+ $topic_id = $topic_rowset[$i]['topic_id'];
+
$topic_title = ( count($orig_word) ) ? preg_replace($orig_word, $replacement_word, $topic_rowset[$i]['topic_title']) : $topic_rowset[$i]['topic_title'];
+ $replies = $topic_rowset[$i]['topic_replies'];
+
$topic_type = $topic_rowset[$i]['topic_type'];
if( $topic_type == POST_ANNOUNCE )
@@ -465,38 +469,6 @@ if( $total_topics )
$topic_type .= $lang['Topic_Poll'] . " ";
}
- $topic_id = $topic_rowset[$i]['topic_id'];
-
- $replies = $topic_rowset[$i]['topic_replies'];
-
- if( ( $replies + 1 ) > $board_config['posts_per_page'] )
- {
- $total_pages = ceil(($replies+1)/$board_config['posts_per_page']);
- $goto_page = ' [ <img src="' . $images['icon_gotopost'] . '" alt="' . $lang['Goto_page'] . '" title="' . $lang['Goto_page'] . '" />' . $lang['Goto_page'] . ': ';
-
- $times = 1;
- for($j = 0; $j < $replies + 1; $j += $board_config['posts_per_page'])
- {
- $goto_page .= '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=" . $topic_id . "&amp;start=$j") . '">' . $times . '</a>';
- if( $times == 1 && $total_pages > 4 )
- {
- $goto_page .= ' ... ';
- $times = $total_pages - 3;
- $j += ( $total_pages - 4 ) * $board_config['posts_per_page'];
- }
- else if ( $times < $total_pages )
- {
- $goto_page .= ', ';
- }
- $times++;
- }
- $goto_page .= ' ] ';
- }
- else
- {
- $goto_page = '';
- }
-
if( $topic_rowset[$i]['topic_status'] == TOPIC_MOVED )
{
$topic_type = $lang['Topic_Moved'] . " ";
@@ -604,6 +576,34 @@ if( $total_topics )
$newest_post_img = '';
}
}
+
+ if( ( $replies + 1 ) > $board_config['posts_per_page'] )
+ {
+ $total_pages = ceil(($replies+1)/$board_config['posts_per_page']);
+ $goto_page = ' [ <img src="' . $images['icon_gotopost'] . '" alt="' . $lang['Goto_page'] . '" title="' . $lang['Goto_page'] . '" />' . $lang['Goto_page'] . ': ';
+
+ $times = 1;
+ for($j = 0; $j < $replies + 1; $j += $board_config['posts_per_page'])
+ {
+ $goto_page .= '<a href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=" . $topic_id . "&amp;start=$j") . '">' . $times . '</a>';
+ if( $times == 1 && $total_pages > 4 )
+ {
+ $goto_page .= ' ... ';
+ $times = $total_pages - 3;
+ $j += ( $total_pages - 4 ) * $board_config['posts_per_page'];
+ }
+ else if ( $times < $total_pages )
+ {
+ $goto_page .= ', ';
+ }
+ $times++;
+ }
+ $goto_page .= ' ] ';
+ }
+ else
+ {
+ $goto_page = '';
+ }
$view_topic_url = append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id");