From e7bb7a220d1b4778b53f4c8c84c49702d856a3b7 Mon Sep 17 00:00:00 2001 From: Callan Barrett Date: Wed, 23 Jan 2008 21:34:10 +0900 Subject: Turn more and less buttons into links This is to (at least) fix the more and less buttons which weren't working because of the drop down menu for actions Signed-off-by: Callan Barrett --- web/lib/pkgfuncs.inc | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) (limited to 'web/lib') diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index 1e92a904..c559750e 100644 --- a/web/lib/pkgfuncs.inc +++ b/web/lib/pkgfuncs.inc @@ -608,18 +608,15 @@ function pkg_search_page($SID="") { # determine paging variables # + if (intval($_GET['O'])) { + $O = $_GET['O']; + } else { + $O = 0; + } $_REQUEST["PP"] ? $PP = intval($_REQUEST["PP"]) : $PP = 25; if ($PP < 25) {$PP = 25;} if ($PP > 100) {$PP = 100;} - $_REQUEST["O"] ? $O = intval($_REQUEST["O"]) : $O = 0; - if ($_REQUEST["do_More"]) { - $O += $PP; - } elseif ($_REQUEST["do_Less"]) { - $O -= $PP; - } - if ($O < 0) { - $O = 0; - } + if ($_REQUEST["do_Search"] && $_REQUEST["do_Search"] != 1) { # reset the offset to zero if they hit Go # @@ -1062,6 +1059,7 @@ function pkg_search_page($SID="") { # print "
"; print "\n"; - } - else { - print " "; + print "" . __("Less") . ""; + } else if ($O<$PP && $O>0) { + print "" . __("Less") . ""; } print " "; # RIGHT print " "; if (mysql_num_rows(db_query($qnext, $dbh))) { - print " \n"; + print "" . __("More") . ""; } print " \n"; print " \n"; -- cgit v1.2.3-24-g4f1b