Skip to content

Commit

Permalink
Various fixes in pages() function.
Browse files Browse the repository at this point in the history
git-svn-id: http://voip.null.ro/svn/ansql/trunk@136 dbfed7de-b0aa-0410-b6a1-c7e608b77fc9
  • Loading branch information
monica committed Jan 13, 2015
1 parent 061ce6f commit 26b5ca0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ function pages($total = NULL, $params = array())
while($sp<0)
$sp += $limit;
while($sp<$page) {
$pg_nr = $sp/$limit + 1;
$pg_nr = floor($sp/$limit) + 1;
print '<a class="pagelink" href="'.$link.'&page='.$sp.'">'.$pg_nr.'</a>&nbsp;&nbsp;';
$sp += $limit;
}
Expand Down Expand Up @@ -586,7 +586,7 @@ function pages($total = NULL, $params = array())
if ($limit==1)
$last_page = $total - 1;
elseif (floor(($total/$limit))==$total/$limit)
$last_page = floor($total/$limit) * ($limit - 1);
$last_page = floor(($total-1)/$limit) * $limit;

/* jump 5 pages */
if ($next5 < $last_page)
Expand Down

0 comments on commit 26b5ca0

Please sign in to comment.