1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-23 11:28:33 +01:00

Changed pagination of multi-page topics

git-svn-id: file:///svn/phpbb/trunk@1875 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Bart van Bragt 2002-01-14 23:24:53 +00:00
parent 0f2c2c2210
commit 24ab3618a6

View File

@ -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 . "&amp;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 . "&amp;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 . "&amp;start=$j") . "\">$times</a>";
$goto_page .= ", ";
}
$times++;
}