From 118ff9ad24ee32286f186a2b53cf55d15fa3fccf Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Sat, 9 Jun 2001 21:09:00 +0000 Subject: Likely fix for pagination failure on div 10 boundary git-svn-id: file:///svn/phpbb/trunk@446 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions.php | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'phpBB') diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 2a1645a5e0..255fccd56f 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -380,15 +380,24 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add if($this_block_end < $total_pages) { $page_string_append = ", "; - for($i = $this_block_end + 1; $i < $total_pages; $i+=10) + + if(!($total_pages%10)) + { + $page_url = append_sid($base_url."&start=".( ( ($this_block_end + 1) * $per_page ) - $per_page ) ); + $page_string_append .= "$total_pages"; + } + else { - $page_string_append .= "" . ( ($i == 0) ? ($i+1) : $i) . " - " . ((($i+9) < $total_pages) ? ($i+9) : $total_pages) .""; - if($i < $total_pages - 10) + + for($i = $this_block_end + 1; $i < $total_pages; $i+=10) { - $page_string_append .= ", "; + $page_string_append .= "" . ( ($i == 0) ? ($i+1) : $i) . " - " . ((($i+9) < $total_pages) ? ($i+9) : $total_pages) .""; + if($i < $total_pages - 10) + { + $page_string_append .= ", "; + } } } - $page_string .= $page_string_append; } -- cgit v1.2.1