summaryrefslogtreecommitdiffstats
path: root/web/html/tu.php
diff options
context:
space:
mode:
authorLoui Chang <louipc.ist@gmail.com>2008-11-10 01:35:17 +0100
committerLoui Chang <louipc.ist@gmail.com>2008-11-10 15:21:13 +0100
commit21840941eb301da7da338f3ce17ebd9e8d74f06e (patch)
treefbc660e6cd0e4726e5259f3dffbdb9e2f7fd089d /web/html/tu.php
parent06ce5af292b639bb2e54b433d912d5ac134a1dd1 (diff)
downloadaur-21840941eb301da7da338f3ce17ebd9e8d74f06e.tar.gz
aur-21840941eb301da7da338f3ce17ebd9e8d74f06e.tar.xz
Tweak TU interface for appearance.
Show ten votes per page instead of five. Change the vote preview to 75 characters so entries fit better in the table. Remove [More] links and make the description itself a link. Clean up a couple notices. Send unauthorised users to index.php. Signed-off-by: Loui Chang <louipc.ist@gmail.com>
Diffstat (limited to 'web/html/tu.php')
-rw-r--r--web/html/tu.php21
1 files changed, 13 insertions, 8 deletions
diff --git a/web/html/tu.php b/web/html/tu.php
index 67ac3f2f..0b8b5c77 100644
--- a/web/html/tu.php
+++ b/web/html/tu.php
@@ -9,7 +9,8 @@ check_sid();
html_header();
# Default votes per page
-$pp = 5;
+$pp = 10;
+$prev_Len = 75;
$atype = "";
if (isset($_COOKIE["AURSID"])) {
@@ -17,7 +18,6 @@ if (isset($_COOKIE["AURSID"])) {
}
if ($atype == "Trusted User" OR $atype == "Developer") {
- $pp = 5;
if (isset($_GET['id'])) {
if (is_numeric($_GET['id'])) {
@@ -87,9 +87,14 @@ if ($atype == "Trusted User" OR $atype == "Developer") {
} else {
$dbh = db_connect();
- $offset = $_GET['off'];
$limit = $pp;
- $by = $_GET['by'];
+ if (isset($_GET['off']))
+ $offset = $_GET['off'];
+
+ if (isset($_GET['by']))
+ $by = $_GET['by'];
+ else
+ $by = 'up';
if (!empty($offset) AND is_numeric($offset)) {
if ($offset >= 1) {
@@ -105,8 +110,6 @@ if ($atype == "Trusted User" OR $atype == "Developer") {
$lim = ($limit > 0) ? " LIMIT " . $off . ", " . $limit : "";
$by_next = ($by == "down") ? "up" : "down";
- $prev_Len = 100;
-
$q = "SELECT * FROM TU_VoteInfo WHERE End > " . time() . " ORDER BY Submitted " . $order;
$result = db_query($q, $dbh);
@@ -146,8 +149,10 @@ if ($atype == "Trusted User" OR $atype == "Developer") {
</table>
<?php
}
-} else {
- print __("You are not allowed to access this area.");
+}
+else {
+ header('Location: index.php');
}
html_footer(AUR_VERSION);
+