diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index c559750e..9612c73a 100644 --- a/web/lib/pkgfuncs.inc +++ b/web/lib/pkgfuncs.inc @@ -854,18 +854,23 @@ function pkg_search_page($SID="") { switch ($_REQUEST["SB"]) { case 'c': $q.= "ORDER BY CategoryID ".$order.", Name ASC, LocationID ASC "; + $SB = 'c'; break; case 'l': $q.= "ORDER BY LocationID ".$order.", Name ASC, CategoryID DESC "; + $SB = 'l'; break; case 'v': $q.= "ORDER BY NumVotes ".$order.", Name ASC, CategoryID DESC "; + $SB = 'v'; break; case 'm': $q.= "ORDER BY Username ".$order.", Name ASC, LocationID ASC "; + $SB = 'm'; break; case 'a': $q.= "ORDER BY GREATEST(SubmittedTS,ModifiedTS) ".$order.", Name ASC, LocationID ASC "; + $SB = 'a'; break; default: $q.= "ORDER BY Name ".$order.", LocationID ASC, CategoryID DESC "; @@ -905,8 +910,10 @@ function pkg_search_page($SID="") { # SO_next used to change sort order on header click if ($_REQUEST["SO"] == "d"){ $SO_next="a"; + $SO = 'd'; } else { $SO_next="d"; + $SO = 'a'; } print "\n"; if ($SID) { @@ -1088,6 +1095,7 @@ function pkg_search_page($SID="") { # print number of results # ok this styling sucks + # patches welcome! print ""; print __("Showing results %s - %s of %s", array($first, $last, $allresults)); print ""; @@ -1107,15 +1115,15 @@ function pkg_search_page($SID="") { print " "; print " "; if (($O-$PP) >= 0) { - print "" . __("Less") . ""; + print "" . __("Less") . ""; } else if ($O<$PP && $O>0) { - print "" . __("Less") . ""; + print "" . __("Less") . ""; } print " "; # RIGHT print " "; if (mysql_num_rows(db_query($qnext, $dbh))) { - print "" . __("More") . ""; + print "" . __("More") . ""; } print " \n"; print " \n";