From 90eadf0252fcb7358b7e915bae8dc57e70c65750 Mon Sep 17 00:00:00 2001 From: simo Date: Fri, 6 May 2005 02:07:30 +0000 Subject: Changed next and previous buttons to only display if there are next and previous pages bug #2686 --- web/lib/pkgfuncs.inc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'web') diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index c0627ac0..dd168da7 100644 --- a/web/lib/pkgfuncs.inc +++ b/web/lib/pkgfuncs.inc @@ -675,6 +675,7 @@ function pkg_search_page($SID="") { $q.= "ORDER BY Name ASC, LocationID ASC, CategoryID DESC "; break; } + $qnext = $q."LIMIT ".($O+$PP).", ".$PP; //next page's worth $q.= "LIMIT ".$O.", ".$PP; $result = db_query($q, $dbh); @@ -876,8 +877,10 @@ function pkg_search_page($SID="") { print " \n"; print " \n"; print " \n"; if ($SID) { print " \n"; } print " \n"; print " \n"; print "
"; - print " \n"; + if (($O-$PP) >= 0) { + print " \n"; + } print " \n"; @@ -886,8 +889,10 @@ function pkg_search_page($SID="") { print " "; - print " \n"; + if (mysql_num_rows(db_query($qnext, $dbh))) { + print " \n"; + } print "
\n"; -- cgit v1.2.3-24-g4f1b