diff options
| author | Bart van Bragt <bartvb@users.sourceforge.net> | 2002-01-14 23:24:53 +0000 |
|---|---|---|
| committer | Bart van Bragt <bartvb@users.sourceforge.net> | 2002-01-14 23:24:53 +0000 |
| commit | 24ab3618a6c217a1f9501b82c9e878c594f5669b (patch) | |
| tree | e4f7b8e422c237853a1a469a8074a47e8c1fdd1b | |
| parent | 0f2c2c2210bbee4f024e37138e06ae81f3a0b90c (diff) | |
| download | forums-24ab3618a6c217a1f9501b82c9e878c594f5669b.tar forums-24ab3618a6c217a1f9501b82c9e878c594f5669b.tar.gz forums-24ab3618a6c217a1f9501b82c9e878c594f5669b.tar.bz2 forums-24ab3618a6c217a1f9501b82c9e878c594f5669b.tar.xz forums-24ab3618a6c217a1f9501b82c9e878c594f5669b.zip | |
Changed pagination of multi-page topics
git-svn-id: file:///svn/phpbb/trunk@1875 89ea8834-ac86-4346-8a33-228a782c2dd0
| -rw-r--r-- | phpBB/viewforum.php | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index ec28e2463e..6051779410 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -464,25 +464,22 @@ if( $total_topics ) 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']) { - if( $times > 4 ) + $goto_page .= "<a href=\"".append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=" . $topic_id . "&start=$j") . "\">$times</a>"; + if( $times == 1 && $total_pages > 4) { - if( $j + $board_config['posts_per_page'] >= $replies + 1 ) - { - $goto_page .= " ... <a href=\"".append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=" . $topic_id . "&start=$j") . "\">$times</a>"; - } + $goto_page .= " ... "; + $times = $total_pages - 3; + $j += ($total_pages-4) * $board_config['posts_per_page']; } - else + else if ($times < $total_pages) { - if( $times != 1 ) - { - $goto_page .= ", "; - } - $goto_page .= "<a href=\"" . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=" . $topic_id . "&start=$j") . "\">$times</a>"; + $goto_page .= ", "; } $times++; } |
