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/lang/en/pkgfuncs_po.inc | 6 ++++++ web/lib/pkgfuncs.inc | 51 +++++++++++++++++++++++++++++++++++++++------ 2 files changed, 51 insertions(+), 6 deletions(-) (limited to 'web') diff --git a/web/lang/en/pkgfuncs_po.inc b/web/lang/en/pkgfuncs_po.inc index 3a62eb1..ef75d51 100644 --- a/web/lang/en/pkgfuncs_po.inc +++ b/web/lang/en/pkgfuncs_po.inc @@ -123,4 +123,10 @@ $_t["en"]["Unflag Package Safe To Use"] = "Unflag Package Safe To Use"; $_t["en"]["Safe"] = "Safe"; +$_t["en"]["Age"] = "Age"; + +$_t["en"]["First Submitted"] = "First Submitted"; + +$_t["en"]["Last Updated"] = "Last Updated"; + ?> \ No newline at end of file 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