From 55dcf5ce87f6e3e159ef35daac5eae86b624df3f Mon Sep 17 00:00:00 2001 From: Loui Chang Date: Sat, 26 Dec 2009 14:30:14 -0500 Subject: tu.php: Sort votes by descending date. Also make syntax more straightforward. 'asc' is ascending, rather than 'up'. Signed-off-by: Loui Chang --- web/html/tu.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'web/html') 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); -- cgit v1.2.3-70-g09d2