mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
Likely fix for pagination failure on div 10 boundary
git-svn-id: file:///svn/phpbb/trunk@446 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
bf8b7659a9
commit
118ff9ad24
1 changed files with 14 additions and 5 deletions
|
@ -380,15 +380,24 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add
|
||||||
if($this_block_end < $total_pages)
|
if($this_block_end < $total_pages)
|
||||||
{
|
{
|
||||||
$page_string_append = ", ";
|
$page_string_append = ", ";
|
||||||
for($i = $this_block_end + 1; $i < $total_pages; $i+=10)
|
|
||||||
|
if(!($total_pages%10))
|
||||||
{
|
{
|
||||||
$page_string_append .= "<a href=\"".append_sid($base_url."&start=".(($i*$per_page) - $per_page))."\">" . ( ($i == 0) ? ($i+1) : $i) . " - " . ((($i+9) < $total_pages) ? ($i+9) : $total_pages) ."</a>";
|
$page_url = append_sid($base_url."&start=".( ( ($this_block_end + 1) * $per_page ) - $per_page ) );
|
||||||
if($i < $total_pages - 10)
|
$page_string_append .= "<a href=\"$page_url\">$total_pages</a>";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
for($i = $this_block_end + 1; $i < $total_pages; $i+=10)
|
||||||
{
|
{
|
||||||
$page_string_append .= ", ";
|
$page_string_append .= "<a href=\"".append_sid($base_url."&start=".(($i*$per_page) - $per_page))."\">" . ( ($i == 0) ? ($i+1) : $i) . " - " . ((($i+9) < $total_pages) ? ($i+9) : $total_pages) ."</a>";
|
||||||
|
if($i < $total_pages - 10)
|
||||||
|
{
|
||||||
|
$page_string_append .= ", ";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$page_string .= $page_string_append;
|
$page_string .= $page_string_append;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue