diff options
author | Lukas Fleischer <archlinux@cryptocrack.de> | 2010-10-06 04:25:53 +0200 |
---|---|---|
committer | Loui Chang <louipc.ist@gmail.com> | 2010-11-10 20:50:35 +0100 |
commit | eda713032ce9bed773b6c927b2f6ac4b445fe577 (patch) | |
tree | 8091bc77f982d2d71a50dcd7b1facdd50a3f14c3 /web/lib/pkgfuncs.inc | |
parent | dbb8bb783f2f22b68ad2d65f020390428e77c479 (diff) | |
download | aur-eda713032ce9bed773b6c927b2f6ac4b445fe577.tar.gz aur-eda713032ce9bed773b6c927b2f6ac4b445fe577.tar.xz |
Add timestamp when a package is flagged out-of-date (FS#20848).
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
- resolve conflict and omit i18n changes.
Diffstat (limited to 'web/lib/pkgfuncs.inc')
-rw-r--r-- | web/lib/pkgfuncs.inc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index 5605daa5..0f45124d 100644 --- a/web/lib/pkgfuncs.inc +++ b/web/lib/pkgfuncs.inc @@ -457,7 +457,7 @@ function pkg_search_page($SID="") { PackageCategories.Category, PackageLocations.Location, Packages.Name, Packages.Version, Packages.Description, Packages.NumVotes, - Packages.ID, Packages.OutOfDate + Packages.ID, Packages.OutOfDateTS FROM Packages LEFT JOIN Users ON (Packages.MaintainerUID = Users.ID) "; @@ -510,7 +510,7 @@ function pkg_search_page($SID="") { } if (isset($_GET['outdated'])) { - $q .= "AND OutOfDate = 1 "; + $q .= "AND OutOfDateTS IS NOT NULL "; } $order = $_GET["SO"] == 'd' ? 'DESC' : 'ASC'; @@ -642,8 +642,13 @@ function pkg_flag ($atype, $ids, $action = True) { } } - $ood = $action ? 1 : 0; - $q = "UPDATE Packages SET OutOfDate = " . $ood; + $q = "UPDATE Packages SET"; + if ($action) { + $q.= " OutOfDateTS = UNIX_TIMESTAMP()"; + } + else { + $q.= " OutOfDateTS = NULL"; + } $q.= " WHERE ID IN (" . $flag . ")"; db_query($q, $dbh); |