mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
tu.php: Sort votes by descending date.
Also make syntax more straightforward. 'asc' is ascending, rather than 'up'. Signed-off-by: Loui Chang <louipc.ist@gmail.com>
This commit is contained in:
parent
4b109cacc1
commit
55dcf5ce87
1 changed files with 4 additions and 4 deletions
|
@ -106,7 +106,7 @@ if ($atype == "Trusted User" OR $atype == "Developer") {
|
||||||
if (isset($_GET['by']))
|
if (isset($_GET['by']))
|
||||||
$by = $_GET['by'];
|
$by = $_GET['by'];
|
||||||
else
|
else
|
||||||
$by = 'up';
|
$by = 'desc';
|
||||||
|
|
||||||
if (!empty($offset) AND is_numeric($offset)) {
|
if (!empty($offset) AND is_numeric($offset)) {
|
||||||
if ($offset >= 1) {
|
if ($offset >= 1) {
|
||||||
|
@ -118,9 +118,9 @@ if ($atype == "Trusted User" OR $atype == "Developer") {
|
||||||
$off = 0;
|
$off = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
$order = ($by == 'down') ? 'DESC' : 'ASC';
|
$order = ($by == 'asc') ? 'ASC' : 'DESC';
|
||||||
$lim = ($limit > 0) ? " LIMIT " . $off . ", " . $limit : "";
|
$lim = ($limit > 0) ? " LIMIT $off, $limit" : "";
|
||||||
$by_next = ($by == "down") ? "up" : "down";
|
$by_next = ($by == 'desc') ? 'asc' : 'desc';
|
||||||
|
|
||||||
$q = "SELECT * FROM TU_VoteInfo WHERE End > " . time() . " ORDER BY Submitted " . $order;
|
$q = "SELECT * FROM TU_VoteInfo WHERE End > " . time() . " ORDER BY Submitted " . $order;
|
||||||
$result = db_query($q, $dbh);
|
$result = db_query($q, $dbh);
|
||||||
|
|
Loading…
Add table
Reference in a new issue