diff options
author | canyonknight <canyonknight@gmail.com> | 2012-05-25 17:45:53 -0400 |
---|---|---|
committer | Lukas Fleischer <archlinux@cryptocrack.de> | 2012-07-06 11:27:06 +0200 |
commit | 41986bbc783f007c79df1b508942809a742876d2 (patch) | |
tree | f3f6c7847ebb6eba4099dba9023bd855f846566e /web/html/rss.php | |
parent | c15441762c2f6ab4438eaf2854c0ee3146a98b30 (diff) |
rss.php: Pull out DB code
* Move DB code in rss.php to new function in aur.inc.php
* Centralization of DB code important in a future transition to PDO interface
Signed-off-by: canyonknight <canyonknight@gmail.com>
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/html/rss.php')
-rw-r--r-- | web/html/rss.php | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/web/html/rss.php b/web/html/rss.php index c7de4c6..6f057bf 100644 --- a/web/html/rss.php +++ b/web/html/rss.php @@ -37,13 +37,9 @@ $image->description = "AUR Newest Packages Feed"; $rss->image = $image; #Get the latest packages and add items for them -$dbh = db_connect(); -$q = "SELECT * FROM Packages "; -$q.= "ORDER BY SubmittedTS DESC "; -$q.= "LIMIT 20"; -$result = db_query($q, $dbh); +$packages = latest_pkgs(20); -while ($row = mysql_fetch_assoc($result)) { +while (list($indx, $row) = each($packages)) { $item = new FeedItem(); $item->title = $row["Name"]; $item->link = "{$protocol}://{$host}/packages.php?ID={$row["ID"]}"; |