From 7422939964aa60edd3021b4e38ee1f93beb3081c Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 15 Feb 2004 16:04:36 +0000 Subject: - Patch 5834 by Jeremy: made multiple pagers on one page work. --- includes/pager.inc | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'includes') diff --git a/includes/pager.inc b/includes/pager.inc index 0251587e5..7eb3585b8 100644 --- a/includes/pager.inc +++ b/includes/pager.inc @@ -106,7 +106,7 @@ function pager_first($text, $limit, $element = 0, $attributes = array()) { global $pager_from_array; if ($pager_from_array[$element]) { - return "$text"; + return "$text"; } else { // we are already at the first page, return nothing @@ -132,7 +132,7 @@ function pager_previous($text, $limit, $element = 0, $n = 1, $attributes = array if ($from_new[$element] < 1) { return pager_first($text, $limit, $element, $attributes); } - return "$text"; + return "$text"; } /** @@ -151,7 +151,7 @@ function pager_next($text, $limit, $element = 0, $n = 1, $attributes = array()) global $pager_from_array, $pager_total; $from_new = pager_load_array(((int)$pager_from_array[$element] + ((int)$limit * (int)$n)), $element, $pager_from_array); if ($from_new[$element] < $pager_total[$element]) { - return "$text"; + return "$text"; } return " "; } @@ -175,7 +175,7 @@ function pager_last($text, $limit, $element = 0, $attributes = array()) { 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]) { - return "$text"; + return "$text"; } return " "; } @@ -281,18 +281,20 @@ function pager_list($limit, $element = 0, $quantity = 5, $text = "", $attributes } /* @} End of member group pager pieces */ -function pager_link($from_new, $attributes = array()) { +function pager_link($from_new, $element, $attributes = array()) { $q = $_GET["q"]; + $from = $_GET["from"]; foreach($attributes as $key => $value) { $query[] = "$key=$value"; } + $from_new = pager_load_array($from_new[$element], $element, explode("," ,$from)); if (count($attributes)) { - $url = url($q, "from=". $from_new[0] ."&". implode("&", $query)); + $url = url($q, "from=". implode($from_new, ",") ."&". implode("&", $query)); } else { - $url = url($q, "from=". $from_new[0]); + $url = url($q, "from=". implode($from_new, ",")); } return $url; -- cgit v1.2.3