From 16a49b96a98a005aa1353ce32ea746dceddfa45e Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Sat, 26 May 2001 13:07:18 +0000 Subject: Fixed a small problem with pagination git-svn-id: file:///svn/phpbb/trunk@331 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 08cc9ed8f2..95ee824bea 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -294,7 +294,7 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add return ""; } - $on_page = floor($start_item/$per_page); + $on_page = floor($start_item/$per_page) + 1; $page_string = ""; @@ -307,7 +307,7 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add for($i = $this_block_start; $i <= $this_block_end; $i++) { - $page_string .= ($i == $on_page + 1) ? "$i" : "$i"; + $page_string .= ($i == $on_page) ? "$i" : "$i"; if($i < $this_block_end) { $page_string .= ", "; @@ -330,7 +330,7 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add $page_string_append = ", "; for($i = $this_block_end + 1; $i < $total_pages; $i+=10) { - $page_string_append .= "" . ( ($i == 0) ? ($i+1) : $i) . " - " . ((($i+9) < $total_pages) ? ($i+9) : $total_pages) .""; + $page_string_append .= "" . ( ($i == 0) ? ($i+1) : $i) . " - " . ((($i+9) < $total_pages) ? ($i+9) : $total_pages) .""; if($i < $total_pages - 10) { $page_string_append .= ", "; @@ -342,13 +342,13 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add if($add_prevnext_text) { - if($on_page > 0) + if($on_page > 1) { - $page_string = "$l_prevpage : " . $page_string; + $page_string = "Previous : " . $page_string; } - if($on_page < $total_pages-1) + if($on_page < $total_pages) { - $page_string .= " : $l_nextpage"; + $page_string .= " : Next"; } } -- cgit v1.2.1