Commit 55dcf5ce authored by Loui Chang's avatar Loui Chang
Browse files

tu.php: Sort votes by descending date.



Also make syntax more straightforward.
'asc' is ascending, rather than 'up'.

Signed-off-by: default avatarLoui Chang <louipc.ist@gmail.com>
parent 4b109cac
......@@ -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);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment