From 6d79fe0c27f7cedb6a8a9e7c39149bdea9363a87 Mon Sep 17 00:00:00 2001 From: pjmattal Date: Tue, 2 Aug 2005 06:22:20 +0000 Subject: added sorting by maintainer and by age added package age statistics to package detail page close bug #2970 --- web/lib/pkgfuncs.inc | 51 +++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 45 insertions(+), 6 deletions(-) (limited to 'web/lib/pkgfuncs.inc') diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index 438039a..b930065 100644 --- a/web/lib/pkgfuncs.inc +++ b/web/lib/pkgfuncs.inc @@ -294,6 +294,7 @@ function package_details($id=0, $SID="") { print "\n"; print " "; print "\n"; + print "\n"; print " "; if ($row["Location"] == "unsupported" and $SID) { @@ -323,6 +324,23 @@ function package_details($id=0, $SID="") { print $maintainer . ""; } print "\n"; + + print "\n"; + print " "; + print "\n"; + + # Print the timestamps for last updates + $updated_time = ($row["ModifiedTS"] == 0) ? "(unknown)" : date("r", intval($row["ModifiedTS"])); + $submitted_time = ($row["SubmittedTS"] == 0) ? "(unknown)" : date("r", intval($row["SubmittedTS"])); + print "\n"; + print " "; + print ""; + print __("Last Updated").": ".$updated_time."
"; + print __("First Submitted").": ".$submitted_time; + print "
"; + print "\n"; + print "\n"; + print "\n"; print " "; print "\n"; @@ -644,18 +662,31 @@ function pkg_search_page($SID="") { print " ".__("Sort by"); print "
\n"; print " \n"; print "\n"; @@ -705,8 +736,9 @@ function pkg_search_page($SID="") { # $q = "SELECT Packages.*, IF(ISNULL(PackageID), 0, COUNT(*)) AS Votes "; # $q.= "FROM Packages LEFT JOIN PackageVotes "; # $q.= "ON Packages.ID = PackageVotes.PackageID "; - $q = "SELECT * FROM Packages "; - $q.= "WHERE DummyPkg != 1 "; + $q = "SELECT * FROM Users,Packages "; + $q.= "WHERE Users.ID = Packages.MaintainerUID AND "; + $q.= "DummyPkg != 1 "; $has_where = 1; if (intval($_REQUEST["L"])) { @@ -772,6 +804,12 @@ function pkg_search_page($SID="") { case 'v': $q.= "ORDER BY NumVotes DESC, Name ASC, CategoryID DESC "; break; + case 'm': + $q.= "ORDER BY Username ASC, Name ASC, LocationID ASC "; + break; + case 'a': + $q.= "ORDER BY GREATEST(SubmittedTS,ModifiedTS) ASC, Name ASC, LocationID ASC "; + break; default: $q.= "ORDER BY Name ASC, LocationID ASC, CategoryID DESC "; break; @@ -779,6 +817,7 @@ function pkg_search_page($SID="") { $qnext = $q."LIMIT ".($O+$PP).", ".$PP; //next page's worth $q.= "LIMIT ".$O.", ".$PP; + print "\n"; $result = db_query($q, $dbh); if (!$result) { print __("Error retrieving package list."); -- cgit v1.2.3-70-g09d2