summaryrefslogtreecommitdiff
path: root/includes/pager.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-10-31 07:59:18 +0000
committerDries Buytaert <dries@buytaert.net>2004-10-31 07:59:18 +0000
commit29b32eff2b9ad55c5990a3393ef9e55ec8980d67 (patch)
tree3d7cfacb6049d8e8dd0c4c2bfe888bfe5778d983 /includes/pager.inc
parent4021b429a7d1da980c774902162c26522a9a9cc6 (diff)
downloadbrdo-29b32eff2b9ad55c5990a3393ef9e55ec8980d67.tar.gz
brdo-29b32eff2b9ad55c5990a3393ef9e55ec8980d67.tar.bz2
- Patch #7161 by jhriggs: fixed probem with 'last page' link not being correct under certain circumstances.
Diffstat (limited to 'includes/pager.inc')
-rw-r--r--includes/pager.inc5
1 files changed, 3 insertions, 2 deletions
diff --git a/includes/pager.inc b/includes/pager.inc
index 913603d7a..279dd3d61 100644
--- a/includes/pager.inc
+++ b/includes/pager.inc
@@ -202,11 +202,12 @@ function pager_next($text, $limit, $element = 0, $interval = 1, $attributes = ar
function pager_last($text, $limit, $element = 0, $attributes = array()) {
global $pager_from_array, $pager_total;
- $from_new = pager_load_array(($pager_total[$element] - ($pager_total[$element] % $limit)), $element, $pager_from_array);
+ $last_num = (($pager_total[$element] % $limit) ? ($pager_total[$element] % $limit) : $limit);
+ $from_new = pager_load_array(($pager_total[$element] - $last_num), $element, $pager_from_array);
if ($from_new[$element] < ($pager_from_array[$element] + $limit)) {
return pager_next($text, $limit, $element, 1, $attributes);
}
- if (($from_new[$element] > $pager_from_array[$element]) && ($from_new[$element] > 0) && $from_new[$element] < $pager_total[$element]) {
+ if (($from_new[$element] > $pager_from_array[$element]) && ($from_new[$element] > 0) && ($from_new[$element] < $pager_total[$element])) {
return '<a href="'. pager_link($from_new, $element, $attributes) .'">'. $text .'</a>';
}
return ' ';