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";
}
}