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 "