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";