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>
This commit is contained in:
Loui Chang 2008-11-09 19:35:17 -05:00
parent 06ce5af292
commit 21840941eb
3 changed files with 16 additions and 12 deletions

View file

@ -91,4 +91,3 @@ if ($atype == "Trusted User" OR $atype == "Developer") {
html_footer(AUR_VERSION); html_footer(AUR_VERSION);
?>

View file

@ -9,7 +9,8 @@ check_sid();
html_header(); html_header();
# Default votes per page # Default votes per page
$pp = 5; $pp = 10;
$prev_Len = 75;
$atype = ""; $atype = "";
if (isset($_COOKIE["AURSID"])) { if (isset($_COOKIE["AURSID"])) {
@ -17,7 +18,6 @@ if (isset($_COOKIE["AURSID"])) {
} }
if ($atype == "Trusted User" OR $atype == "Developer") { if ($atype == "Trusted User" OR $atype == "Developer") {
$pp = 5;
if (isset($_GET['id'])) { if (isset($_GET['id'])) {
if (is_numeric($_GET['id'])) { if (is_numeric($_GET['id'])) {
@ -87,9 +87,14 @@ if ($atype == "Trusted User" OR $atype == "Developer") {
} else { } else {
$dbh = db_connect(); $dbh = db_connect();
$offset = $_GET['off'];
$limit = $pp; $limit = $pp;
if (isset($_GET['off']))
$offset = $_GET['off'];
if (isset($_GET['by']))
$by = $_GET['by']; $by = $_GET['by'];
else
$by = 'up';
if (!empty($offset) AND is_numeric($offset)) { if (!empty($offset) AND is_numeric($offset)) {
if ($offset >= 1) { if ($offset >= 1) {
@ -105,8 +110,6 @@ if ($atype == "Trusted User" OR $atype == "Developer") {
$lim = ($limit > 0) ? " LIMIT " . $off . ", " . $limit : ""; $lim = ($limit > 0) ? " LIMIT " . $off . ", " . $limit : "";
$by_next = ($by == "down") ? "up" : "down"; $by_next = ($by == "down") ? "up" : "down";
$prev_Len = 100;
$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);
@ -146,8 +149,10 @@ if ($atype == "Trusted User" OR $atype == "Developer") {
</table> </table>
<?php <?php
} }
} else { }
print __("You are not allowed to access this area."); else {
header('Location: index.php');
} }
html_footer(AUR_VERSION); html_footer(AUR_VERSION);

View file

@ -26,12 +26,12 @@
<td class='<?php print $c ?>'><span class='f4'><span class='blue'> <td class='<?php print $c ?>'><span class='f4'><span class='blue'>
<?php <?php
if (strlen($row["Agenda"]) >= $prev_Len) { if (strlen($row["Agenda"]) >= $prev_Len) {
$row["Agenda"] = htmlentities(substr($row["Agenda"], 0, $prev_Len)) . "... - "; $row["Agenda"] = htmlentities(substr($row["Agenda"], 0, $prev_Len)) . "...";
} else { } else {
$row["Agenda"] = htmlentities($row["Agenda"]) . " - "; $row["Agenda"] = htmlentities($row["Agenda"]);
} }
?> ?>
<?php print $row["Agenda"] ?><a href='/tu.php?id=<?php print $row['ID'] ?>'>[<?php print __("More") ?>]</a></span></span> <a href='tu.php?id=<?php print $row['ID'] ?>'><?php print $row["Agenda"] ?></a></span></span>
</td> </td>
<td class='<?php print $c ?>'><span class='f5'><span class='blue'><?php print gmdate("j M y", $row["Submitted"]) ?></span></span></td> <td class='<?php print $c ?>'><span class='f5'><span class='blue'><?php print gmdate("j M y", $row["Submitted"]) ?></span></span></td>
<td class='<?php print $c ?>'><span class='f5'><span class='blue'><?php print gmdate("j M y", $row["End"]) ?></span></span></td> <td class='<?php print $c ?>'><span class='f5'><span class='blue'><?php print gmdate("j M y", $row["End"]) ?></span></span></td>