[aur-dev] Sort votes by descending date.
HI, I wasn't sure if it would be more appropriate to send this to this list where the AUR devs are likely to see it, or to AUR-general where the people most affected are likely to see it. The TU section of the AUR displays 6 votes per page sorted in ascending order by date. It would make more sense to sort them descending by date so that the most recent votes are the first to be seen instead of votes that are nearly 2 years old. Votes may be few and far between, but this is a recurring annoyance that should be very easy to fix. Thanks. Regards, Xyne p.s. I can call a vote on this issue to see what the others think, if you like. :P
Votes may be few and far between, but this is a recurring annoyance that should be very easy to fix.
I should add that the annoyance is needing to click through pages, although I just noticed the GET variables in the URL. Still, descending by date should be the default as it is the one that is likely to be the most useful.
2009/12/17 Xyne <xyne@archlinux.ca>:
Votes may be few and far between, but this is a recurring annoyance that should be very easy to fix.
I should add that the annoyance is needing to click through pages, although I just noticed the GET variables in the URL. Still, descending by date should be the default as it is the one that is likely to be the most useful.
patch attached -- Andrea `bash` Scarpino Arch Linux Developer
Also make syntax more straightforward. 'asc' is ascending, rather than 'up'. Signed-off-by: Loui Chang <louipc.ist@gmail.com> --- The previous patch seems to reverse the meaning of up/down. This patch changes it to asc/desc. web/html/tu.php | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/web/html/tu.php b/web/html/tu.php index 1864988..f0038a5 100644 --- a/web/html/tu.php +++ b/web/html/tu.php @@ -106,7 +106,7 @@ if ($atype == "Trusted User" OR $atype == "Developer") { if (isset($_GET['by'])) $by = $_GET['by']; else - $by = 'up'; + $by = 'desc'; if (!empty($offset) AND is_numeric($offset)) { if ($offset >= 1) { @@ -118,9 +118,9 @@ if ($atype == "Trusted User" OR $atype == "Developer") { $off = 0; } - $order = ($by == 'down') ? 'DESC' : 'ASC'; - $lim = ($limit > 0) ? " LIMIT " . $off . ", " . $limit : ""; - $by_next = ($by == "down") ? "up" : "down"; + $order = ($by == 'asc') ? 'ASC' : 'DESC'; + $lim = ($limit > 0) ? " LIMIT $off, $limit" : ""; + $by_next = ($by == 'desc') ? 'asc' : 'desc'; $q = "SELECT * FROM TU_VoteInfo WHERE End > " . time() . " ORDER BY Submitted " . $order; $result = db_query($q, $dbh); -- 1.6.5.5
participants (3)
-
Andrea Scarpino
-
Loui Chang
-
Xyne