From 36ee5561035af335bc3c900ded7aa89066421226 Mon Sep 17 00:00:00 2001
From: Loui Chang
Date: Tue, 24 Jun 2008 02:53:16 -0400
Subject: Move code out of index.php
Move database queries to functions and html to templates.
Signed-off-by: Loui Chang
---
web/template/stats/general_stats_table.php | 38 ++++++++++++++++++++++++++++
web/template/stats/updates_table.php | 40 ++++++++++++++++++++++++++++++
web/template/stats/user_table.php | 38 ++++++++++++++++++++++++++++
3 files changed, 116 insertions(+)
create mode 100644 web/template/stats/general_stats_table.php
create mode 100644 web/template/stats/updates_table.php
create mode 100644 web/template/stats/user_table.php
(limited to 'web/template')
diff --git a/web/template/stats/general_stats_table.php b/web/template/stats/general_stats_table.php
new file mode 100644
index 0000000..254b6b6
--- /dev/null
+++ b/web/template/stats/general_stats_table.php
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/web/template/stats/updates_table.php b/web/template/stats/updates_table.php
new file mode 100644
index 0000000..e1eb888
--- /dev/null
+++ b/web/template/stats/updates_table.php
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+">
+
+
+
+
+
+ ' . gmdate("r", $sub_int);
+else:
+ $modstring = '(unknown)';
+endif;
+?>
+
+
+
+
+
+
+
+
+
diff --git a/web/template/stats/user_table.php b/web/template/stats/user_table.php
new file mode 100644
index 0000000..b844662
--- /dev/null
+++ b/web/template/stats/user_table.php
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
--
cgit v1.2.3-70-g09d2
From 2feee92a75d4fe7042be52d1eef4e6e466af4967 Mon Sep 17 00:00:00 2001
From: Andrea Scarpino
Date: Tue, 8 Jul 2008 18:56:42 +0200
Subject: Remember user between sessions.
Signed-off-by: Loui Chang
---
web/lang/en/index_po.inc | 2 ++
web/lang/it/index_po.inc | 2 ++
web/lib/acctfuncs.inc | 7 ++++++-
web/template/login_form.php | 1 +
4 files changed, 11 insertions(+), 1 deletion(-)
(limited to 'web/template')
diff --git a/web/lang/en/index_po.inc b/web/lang/en/index_po.inc
index bdeb87f..eb626eb 100644
--- a/web/lang/en/index_po.inc
+++ b/web/lang/en/index_po.inc
@@ -25,6 +25,8 @@ $_t["en"]["Password:"] = "Password:";
$_t["en"]["Username:"] = "Username:";
+$_t["en"]["Remember me"] = "Remember me";
+
$_t["en"]["Welcome to the AUR! If you're a newcomer, you may want to read the %hGuidelines%h."] = "Welcome to the AUR! If you're a newcomer, you may want to read the %hGuidelines%h.";
$_t["en"]["This is where the intro text will go."] = "This is where the intro text will go.";
diff --git a/web/lang/it/index_po.inc b/web/lang/it/index_po.inc
index f1e54eb..12b6e56 100644
--- a/web/lang/it/index_po.inc
+++ b/web/lang/it/index_po.inc
@@ -19,6 +19,8 @@ $_t["it"]["Password:"] = "Password:";
$_t["it"]["Username:"] = "Nome utente:";
+$_t["it"]["Remember me"] = "Ricordami" ;
+
$_t["it"]["Welcome to the AUR! If you're a newcomer, you may want to read the %hGuidelines%h."] = "Benvenuto in AUR! Se sei un nuovo utente, dovresti leggere le %hGuidelines%h.";
$_t["it"]["This is where the intro text will go."] = "Qui ci andrà il testo di introduzione.";
diff --git a/web/lib/acctfuncs.inc b/web/lib/acctfuncs.inc
index bbd6b74..73db270 100644
--- a/web/lib/acctfuncs.inc
+++ b/web/lib/acctfuncs.inc
@@ -644,7 +644,12 @@ function try_login() {
if ($logged_in) {
# set our SID cookie
- setcookie("AURSID", $new_sid, 0, "/");
+ if ($_POST['remember_me'] == "on")
+ # Set cookies for 30 days.
+ $cookie_time = time() + (60 * 60 * 24 * 30);
+ else
+ $cookie_time = 0;
+ setcookie("AURSID", $new_sid, $cookie_time, "/");
# header("Location: /index.php");
header("Location: " . $_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING']);
$login_error = "";
diff --git a/web/template/login_form.php b/web/template/login_form.php
index b2ed066..4bfc579 100644
--- a/web/template/login_form.php
+++ b/web/template/login_form.php
@@ -16,6 +16,7 @@
} ?>" />
+
" />
--
cgit v1.2.3-70-g09d2
From b69e2cce56bee61ea445417e29e55d27a15637d5 Mon Sep 17 00:00:00 2001
From: Loui Chang
Date: Tue, 19 Aug 2008 18:08:12 -0400
Subject: Move top page template-example to web/template.
Make note in web/README.txt
Signed-off-by: Loui Chang
---
web/README.txt | 3 +++
web/html/template.php | 20 --------------------
web/lang/ca/template_po.inc | 10 ----------
web/lang/de/template_po.inc | 10 ----------
web/lang/en/template_po.inc | 16 ----------------
web/lang/es/template_po.inc | 10 ----------
web/lang/fr/template_po.inc | 11 -----------
web/lang/it/template_po.inc | 10 ----------
web/lang/pl/template_po.inc | 10 ----------
web/lang/pt/template_po.inc | 16 ----------------
web/lang/ru/template_po.inc | 10 ----------
web/lang/template_po.inc | 32 --------------------------------
web/template/template.phps | 21 +++++++++++++++++++++
13 files changed, 24 insertions(+), 155 deletions(-)
delete mode 100644 web/html/template.php
delete mode 100644 web/lang/ca/template_po.inc
delete mode 100644 web/lang/de/template_po.inc
delete mode 100644 web/lang/en/template_po.inc
delete mode 100644 web/lang/es/template_po.inc
delete mode 100644 web/lang/fr/template_po.inc
delete mode 100644 web/lang/it/template_po.inc
delete mode 100644 web/lang/pl/template_po.inc
delete mode 100644 web/lang/pt/template_po.inc
delete mode 100644 web/lang/ru/template_po.inc
delete mode 100644 web/lang/template_po.inc
create mode 100644 web/template/template.phps
(limited to 'web/template')
diff --git a/web/README.txt b/web/README.txt
index 69bec04..249f605 100644
--- a/web/README.txt
+++ b/web/README.txt
@@ -92,6 +92,9 @@ Directory Layout:
./template - Where most of the html markup resides and minimal
amount of PHP scripting.
+ There is also a template to model the site's top pages in
+ template.phps
+
Scripts:
--------
diff --git a/web/html/template.php b/web/html/template.php
deleted file mode 100644
index 11e05e0..0000000
--- a/web/html/template.php
+++ /dev/null
@@ -1,20 +0,0 @@
-\n";
-
-
-html_footer(AUR_VERSION);
-
-?>
diff --git a/web/lang/ca/template_po.inc b/web/lang/ca/template_po.inc
deleted file mode 100644
index 5ea5ee6..0000000
--- a/web/lang/ca/template_po.inc
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-include_once("translator.inc");
-global $_t;
-
-$_t["ca"]["Hi, this is worth reading!"] = "Hola, val la pena llegir açò!";
-
-?>
\ No newline at end of file
diff --git a/web/lang/de/template_po.inc b/web/lang/de/template_po.inc
deleted file mode 100644
index 024d767..0000000
--- a/web/lang/de/template_po.inc
+++ /dev/null
@@ -1,10 +0,0 @@
-, Matthias Gorissen , Lukas Kropatschek, Niclas Pfeifer
-
-include_once("translator.inc");
-global $_t;
-
-$_t["de"]["Hi, this is worth reading!"] = "Hallo - es lohnt sich, dies zu lesen!";
-
-?>
\ No newline at end of file
diff --git a/web/lang/en/template_po.inc b/web/lang/en/template_po.inc
deleted file mode 100644
index db437be..0000000
--- a/web/lang/en/template_po.inc
+++ /dev/null
@@ -1,16 +0,0 @@
-
\ No newline at end of file
diff --git a/web/lang/es/template_po.inc b/web/lang/es/template_po.inc
deleted file mode 100644
index 21e45fc..0000000
--- a/web/lang/es/template_po.inc
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-include_once("translator.inc");
-global $_t;
-
-$_t["es"]["Hi, this is worth reading!"] = "Hola, ¡vale la pena llegar hasta aquí!";
-
-?>
\ No newline at end of file
diff --git a/web/lang/fr/template_po.inc b/web/lang/fr/template_po.inc
deleted file mode 100644
index 2084c16..0000000
--- a/web/lang/fr/template_po.inc
+++ /dev/null
@@ -1,11 +0,0 @@
-
-# Translator: Cilyan Olowen
-
-include_once("translator.inc");
-global $_t;
-
-$_t["fr"]["Hi, this is worth reading!"] = "Salut, ceci vaut la peine d'être lu !";
-
-?>
diff --git a/web/lang/it/template_po.inc b/web/lang/it/template_po.inc
deleted file mode 100644
index defe7ac..0000000
--- a/web/lang/it/template_po.inc
+++ /dev/null
@@ -1,10 +0,0 @@
- and Pierluigi Picciau
-
-include_once("translator.inc");
-global $_t;
-
-$_t["it"]["Hi, this is worth reading!"] = "Ciao, questo vale la pena di leggerlo!";
-
-?>
\ No newline at end of file
diff --git a/web/lang/pl/template_po.inc b/web/lang/pl/template_po.inc
deleted file mode 100644
index c4e5686..0000000
--- a/web/lang/pl/template_po.inc
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-include_once("translator.inc");
-global $_t;
-
-$_t["pl"]["Hi, this is worth reading!"] = "Witaj, warto to przeczytać!";
-
-?>
\ No newline at end of file
diff --git a/web/lang/pt/template_po.inc b/web/lang/pt/template_po.inc
deleted file mode 100644
index ed4a1d0..0000000
--- a/web/lang/pt/template_po.inc
+++ /dev/null
@@ -1,16 +0,0 @@
-
\ No newline at end of file
diff --git a/web/lang/ru/template_po.inc b/web/lang/ru/template_po.inc
deleted file mode 100644
index 86c3e9b..0000000
--- a/web/lang/ru/template_po.inc
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
-include_once("translator.inc");
-global $_t;
-
-$_t["ru"]["Hi, this is worth reading!"] = "Привет, это стоит почитать!";
-
-?>
\ No newline at end of file
diff --git a/web/lang/template_po.inc b/web/lang/template_po.inc
deleted file mode 100644
index 8d65fc0..0000000
--- a/web/lang/template_po.inc
+++ /dev/null
@@ -1,32 +0,0 @@
-
\ No newline at end of file
diff --git a/web/template/template.phps b/web/template/template.phps
new file mode 100644
index 0000000..7a86686
--- /dev/null
+++ b/web/template/template.phps
@@ -0,0 +1,21 @@
+\n";
+
+
+html_footer(AUR_VERSION);
+
--
cgit v1.2.3-70-g09d2
From c7bfd9528473da0886afd328f0fa68e26c97ca3d Mon Sep 17 00:00:00 2001
From: Loui Chang
Date: Thu, 18 Sep 2008 22:16:40 -0400
Subject: Take formatting out of version number in web/lib/version.inc
Signed-off-by: Loui Chang
Signed-off-by: Callan Barrett
---
web/lib/version.inc | 2 +-
web/template/footer.php | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
(limited to 'web/template')
diff --git a/web/lib/version.inc b/web/lib/version.inc
index dcc2f3c..9ef059f 100644
--- a/web/lib/version.inc
+++ b/web/lib/version.inc
@@ -1,3 +1,3 @@
v1.5.2" );
+define( "AUR_VERSION", "v1.5.2" );
diff --git a/web/template/footer.php b/web/template/footer.php
index 9d85c7d..fe8f89c 100644
--- a/web/template/footer.php
+++ b/web/template/footer.php
@@ -3,7 +3,7 @@
$ver
\n";
+ print "$ver
\n";
}
?>
--
cgit v1.2.3-70-g09d2
From 34c8a9cf80fa857f8024eacd65292cd015673165 Mon Sep 17 00:00:00 2001
From: Callan Barrett
Date: Mon, 6 Oct 2008 06:09:06 +0800
Subject: Major rearrangement of tu.php, strings setup for translation
All the strings are set up to be translated now, HTML of tu.php has been
moved to templates and the worst of it rewritten (there's no longer a
massive function in it)
Signed-off-by: Callan Barrett
Signed-off-by: Loui Chang
---
web/html/tu.php | 438 +++++++-------------------------------------
web/template/tu_details.php | 62 +++++++
web/template/tu_list.php | 68 +++++++
3 files changed, 200 insertions(+), 368 deletions(-)
create mode 100644 web/template/tu_details.php
create mode 100644 web/template/tu_list.php
(limited to 'web/template')
diff --git a/web/html/tu.php b/web/html/tu.php
index 524e14d..e2e44b7 100644
--- a/web/html/tu.php
+++ b/web/html/tu.php
@@ -8,44 +8,30 @@ set_lang();
check_sid();
html_header();
-# get login privileges
-#
+# Default votes per page
+$pp = 5;
+
+$atype = "";
if (isset($_COOKIE["AURSID"])) {
- # Only logged in users can do stuff
- #
$atype = account_from_sid($_COOKIE["AURSID"]);
-} else {
- $atype = "";
}
if ($atype == "Trusted User" OR $atype == "Developer") {
- # Show the TU interface
- #
-
- # Temp value for results per page
$pp = 5;
- if (isset($_REQUEST['id'])) {
- # Show application details
- # depending on action and time frame will show either
- # sponsor button, comments and vote buttons
- #
-
- if (intval($_REQUEST['id'])) {
+ if (isset($_GET['id'])) {
+ if (is_numeric($_GET['id'])) {
$q = "SELECT * FROM TU_VoteInfo ";
- $q.= "WHERE ID = " . $_REQUEST['id'];
+ $q.= "WHERE ID = " . $_GET['id'];
$dbh = db_connect();
$results = db_query($q, $dbh);
$row = mysql_fetch_assoc($results);
if (empty($row)) {
- print "Could not retrieve proposal details.\n";
+ print __("Could not retrieve proposal details.");
} else {
- # Print out application details, thanks again AUR
- #
-
$isrunning = $row['End'] > time() ? 1 : 0;
$qvoted = "SELECT * FROM TU_Votes WHERE ";
@@ -53,30 +39,27 @@ if ($atype == "Trusted User" OR $atype == "Developer") {
$qvoted.= "UserID = " . uid_from_sid($_COOKIE["AURSID"]);
$hasvoted = mysql_num_rows(db_query($qvoted, $dbh));
- # Can this person vote?
- #
- $canvote = 1; // we assume they can
- $errorvote = ""; // error message to give
+ $canvote = 1;
+ $errorvote = "";
if ($isrunning == 0) {
$canvote = 0;
- $errorvote = "Voting is closed for this proposal.";
+ $errorvote = __("Voting is closed for this proposal.");
} else if ($row['User'] == username_from_sid($_COOKIE["AURSID"])) {
$canvote = 0;
- $errorvote = "You cannot vote in an proposal regarding you.";
+ $errorvote = __("You cannot vote in an proposal about you.");
} else if ($hasvoted != 0) {
$canvote = 0;
- $errorvote = "You've already voted in this proposal.";
+ $errorvote = __("You've already voted in this proposal.");
}
- # have to put this here so results are correct immediately after voting
if ($canvote == 1) {
if (isset($_POST['doVote'])) {
if (isset($_POST['voteYes'])) {
- $myvote = "Yes";
+ $myvote = __("Yes");
} else if (isset($_POST['voteNo'])) {
- $myvote = "No";
+ $myvote = __("No");
} else if (isset($_POST['voteAbstain'])) {
- $myvote = "Abstain";
+ $myvote = __("Abstain");
}
$qvote = "UPDATE TU_VoteInfo SET " . $myvote . " = " . ($row[$myvote] + 1) . " WHERE ID = " . $row['ID'];
@@ -87,7 +70,7 @@ if ($atype == "Trusted User" OR $atype == "Developer") {
# Can't vote anymore
#
$canvote = 0;
- $errorvote = "You've already voted for this proposal.";
+ $errorvote = __("You've already voted for this proposal.");
# Update if they voted
$hasvoted = mysql_num_rows(db_query($qvoted, $dbh));
@@ -95,357 +78,76 @@ if ($atype == "Trusted User" OR $atype == "Developer") {
$row = mysql_fetch_assoc($results);
}
}
-
- # I think I understand why MVC is good for this stuff..
- echo "\n";
- echo "
Proposal Details
\n";
- echo "
\n";
-
- if ($isrunning == 1) {
- print "
This vote is still running.
";
- print "
";
- }
-
- print "User:
";
-
- if (!empty($row['User'])) {
- print "" . $row['User'] . " ";
- } else {
- print "N/A";
- }
-
- print " \n";
-
- print "Submitted:
" . gmdate("r", $row['Submitted']) . " by ";
- print "
" . username_from_id($row['SubmitterID']) . " \n";
-
- if ($isrunning == 0) {
- print "Ended: ";
- } else {
- print "Ends: ";
- }
- print "
" . gmdate("r", $row['End']) . " \n";
-
- print "
\n";
-
- $row['Agenda'] = htmlentities($row['Agenda']);
- # str_replace seems better than
because it still maintains word wrapping
- print str_replace("\n", " \n", $row['Agenda']);
-
- print " \n";
- print " \n";
-
- print "\n";
- print "\n";
- print "\n";
- print "\n";
- print " \n";
- print "\n";
-
- print "\n";
- print " ";
- print "Yes";
- print " \n";
- print " ";
- print "No";
- print " \n";
- print " ";
- print "Abstain";
- print " \n";
- print " ";
- print "Total";
- print " \n";
- print " ";
- print "Voted?";
- print " \n";
- print " \n";
-
- $c = "data1";
-
- print "\n";
- print " ";
- print $row['Yes'];
- print " \n";
- print " ";
- print $row['No'];
- print " \n";
- print " ";
- print $row['Abstain'];
- print " \n";
- print " ";
- print ($row['Yes'] + $row['No'] + $row['Abstain']);
- print " \n";
- print " ";
-
- if ($hasvoted == 0) {
- print "No ";
- } else {
- print "Yes ";
- }
-
- print " \n";
- print " \n";
-
- print "
\n";
- print "
\n";
-
- echo " \n";
-
- # Actions, vote buttons
- #
- print " \n";
- print "\n";
- print "
Vote Actions
\n";
- print "
\n";
-
- if ($canvote == 1) {
- print "
\n";
- } else {
- print "$errorvote ";
- }
-
- print " \n";
- print "Back \n";
-
+ include("tu_details.php");
}
-
} else {
- print "Vote ID not valid.\n";
+ print __("Vote ID not valid.");
}
} else {
- # page listing applications being discussed, voted on and all those finished
- #
-
- # I guess there should be a function since I use this a few times
- function gen_results($offset, $limit, $sort, $by, $type="normal") {
-
- $dbh = db_connect();
-
- if (!empty($offset) AND is_numeric($offset)) {
- if ($offset >= 1) {
- $off = $offset;
- } else {
- $off = 0;
- }
- } else {
- $off = 0;
- }
-
- $q = "SELECT * FROM TU_VoteInfo";
-
- if ($type == "new") {
- $q.= " WHERE End > " . time();
- $application = "Current Votes";
- } else {
- $application = "All Votes";
- }
-
- $order = ($by == 'down') ? 'DESC' : 'ASC';
-
- # not much to sort, I'm unsure how to sort by username
- # when we only store the userid, someone come up with a nifty
- # way to do this
- #
- switch ($sort) {
- case 'sub':
- $q.= " ORDER BY Submitted $order";
- break;
- default:
- $q.= " ORDER BY Submitted $order";
- break;
- }
-
- if ($limit != 0) {
- $q.= " LIMIT " . $off . ", ". $limit;
- }
-
- $result = db_query($q, $dbh);
-
- if ($by == "down") {
- $by_next = "up";
- } else {
- $by_next = "down";
- }
-
- print "\n";
- print "\n";
- print "\n";
- print " \n";
- print " $application \n";
- print " \n";
- print " \n";
- print "\n";
- print " \n";
- print "\n";
-
- print "\n";
- print " ";
- print "Proposal";
- print " \n";
- print " ";
- print "Start ";
- print " \n";
- print " ";
- print "End";
- print " \n";
- print " ";
- print "User";
- print " \n";
- print " ";
- print "Yes";
- print " \n";
- print " ";
- print "No";
- print " \n";
-# I'm not sure if abstains are necessary inthis view, it's just extra clutter
-# print " ";
-# print "Abstain";
-# print " \n";
- print " ";
- print "Voted?";
- print " \n";
- print " \n";
-
- if (mysql_num_rows($result) == 0) {
- print "No results found. \n";
- } else {
- for ($i = 0; $row = mysql_fetch_assoc($result); $i++) {
- # Thankyou AUR
-
- # alright, I'm going to just have a "new" table and the
- # "old" table can just have every vote, works just as well
- # and probably saves on doing some crap
- #
-
- (($i % 2) == 0) ? $c = "data1" : $c = "data2";
- print "\n";
- print " ";
-
- $prev_Len = 100;
-
- if (strlen($row["Agenda"]) >= $prev_Len) {
- $row["Agenda"] = htmlentities(substr($row["Agenda"], 0, $prev_Len)) . "... -";
- } else {
- $row["Agenda"] = htmlentities($row["Agenda"]) . " -";
- }
-
- print $row["Agenda"];
- print " [More] ";
- print " \n";
- print " ";
- # why does the AUR use gmdate with formatting that includes the offset
- # to GMT?!
- print gmdate("j M y", $row["Submitted"]);
- print " \n";
- print " ";
- print gmdate("j M y", $row["End"]);
- print " \n";
- print " ";
-
- if (!empty($row['User'])) {
- print "";
- print $row['User'] . " ";
- } else {
- print "N/A";
- }
-
- print " \n";
- print " ";
- print $row['Yes'];
- print " \n";
- print " ";
- print $row['No'];
- print " \n";
- print " ";
- # See above
- # print $row['Abstain'];
- # print " \n";
- # print " ";
-
- $qvoted = "SELECT * FROM TU_Votes WHERE ";
- $qvoted.= "VoteID = " . $row['ID'] . " AND ";
- $qvoted.= "UserID = " . uid_from_sid($_COOKIE["AURSID"]);
- $hasvoted = mysql_num_rows(db_query($qvoted, $dbh));
-
- if ($hasvoted == 0) {
- print "No ";
- } else {
- print "Yes ";
- }
-
- print " \n";
- print " \n";
- }
- }
+ $dbh = db_connect();
- print "
\n";
- print "
\n";
+ $offset = $_GET['off'];
+ $limit = $pp;
+ $by = $_GET['by'];
- if ($type == "old" AND $limit != 0) {
- $qnext = "SELECT ID FROM TU_VoteInfo";
- $nextresult = db_query($qnext, $dbh);
+ if (!empty($offset) AND is_numeric($offset)) {
+ if ($offset >= 1) {
+ $off = $offset;
+ } else {
+ $off = 0;
+ }
+ } else {
+ $off = 0;
+ }
- print "\n";
+ $order = ($by == 'down') ? 'DESC' : 'ASC';
+ $lim = ($limit > 0) ? " LIMIT " . $off . ", " . $limit : "";
+ $by_next = ($by == "down") ? "up" : "down";
- if (mysql_num_rows($result)) {
- $sort = htmlentities($sort, ENT_QUOTES);
- $by = htmlentities($by, ENT_QUOTES);
+ $prev_Len = 100;
- print "\n";
- print "\n";
- if ($off != 0) {
- $back = (($off - $limit) <= 0) ? 0 : $off - $limit;
- print "Back ";
- }
- print " \n";
+ $q = "SELECT * FROM TU_VoteInfo WHERE End > " . time() . " ORDER BY Submitted " . $order;
+ $result = db_query($q, $dbh);
- print "\n";
- if (($off + $limit) < mysql_num_rows($nextresult)) {
- $forw = $off + $limit;
- print "Next ";
- }
- print " \n";
- print " \n";
- }
- print "
\n";
- }
+ $type = __("Current Votes");
+ include("tu_list.php");
+?>
- print " \n";
- }
+
+
+
- # stop notices, ythanku Xilon
- if (empty($_REQUEST['sort'])) { $_REQUEST['sort'] = ""; }
- if (empty($_REQUEST['by'])) { $_REQUEST['by'] = ""; }
- if (empty($_REQUEST['off'])) { $_REQUEST['off'] = ""; }
+Add ";
- gen_results($_REQUEST['off'], $pp, $_REQUEST['sort'], $_REQUEST['by'], "old");
+ $type = __("All Votes");
+ include("tu_list.php");
+ $qnext = "SELECT ID FROM TU_VoteInfo";
+ $nextresult = db_query($qnext, $dbh);
+?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/web/template/tu_details.php b/web/template/tu_details.php
new file mode 100644
index 0000000..b1d69f6
--- /dev/null
+++ b/web/template/tu_details.php
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+User:
+
+&SeB=m'>
+
+N/A
+
+
+" . gmdate("r", $row['Submitted']) . "", "
" . username_from_id($row['SubmitterID']) . " ") ?>
+
+\n", htmlentities($row['Agenda'])) ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/web/template/tu_list.php b/web/template/tu_list.php
new file mode 100644
index 0000000..bec2985
--- /dev/null
+++ b/web/template/tu_list.php
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ = $prev_Len) {
+ $row["Agenda"] = htmlentities(substr($row["Agenda"], 0, $prev_Len)) . "... - ";
+ } else {
+ $row["Agenda"] = htmlentities($row["Agenda"]) . " - ";
+ }
+ ?>
+ '>[]
+
+
+
+
+ " . $row['User'] . "";
+ } else {
+ print "N/A";
+ }
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
--
cgit v1.2.3-70-g09d2
From 4b616e20ba11314616ae42fdcd3f7bf6fbb8c4bd Mon Sep 17 00:00:00 2001
From: Callan Barrett
Date: Sun, 5 Oct 2008 06:40:18 +0800
Subject: Move logout link from main menu to login bar
Signed-off-by: Callan Barrett
Signed-off-by: Loui Chang
---
web/template/header.php | 1 -
web/template/login_form.php | 3 +++
2 files changed, 3 insertions(+), 1 deletion(-)
(limited to 'web/template')
diff --git a/web/template/header.php b/web/template/header.php
index 88fd6f6..f60acb4 100644
--- a/web/template/header.php
+++ b/web/template/header.php
@@ -46,7 +46,6 @@
-
">
", username_from_sid($_COOKIE["AURSID"]), ""));
+?>
+
+
Date: Sun, 5 Oct 2008 20:24:57 -0400
Subject: Show developer-TUs their total community packages.
This closes:
FS#11561 - Devs in AUR can't see their packages in Community
Thanks to Hugo Doria for the original patch.
Signed-off-by: Loui Chang
Signed-off-by: Callan Barrett
---
web/lib/stats.inc | 2 +-
web/template/stats/user_table.php | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
(limited to 'web/template')
diff --git a/web/lib/stats.inc b/web/lib/stats.inc
index e659210..6fbc033 100644
--- a/web/lib/stats.inc
+++ b/web/lib/stats.inc
@@ -29,7 +29,7 @@ function user_table($user, $dbh)
# If the user is a TU calculate the number of the packages
$atype = account_from_sid($_COOKIE["AURSID"]);
- if ($atype == 'Trusted User') {
+ if (($atype == 'Trusted User') || ($atype == 'Developer')) {
$result = db_query(sprintf($base_q, 'community'), $dbh);
$row = mysql_fetch_row($result);
$maintainer_community_count = $row[0];
diff --git a/web/template/stats/user_table.php b/web/template/stats/user_table.php
index b844662..ec71999 100644
--- a/web/template/stats/user_table.php
+++ b/web/template/stats/user_table.php
@@ -13,7 +13,7 @@
-
+
--
cgit v1.2.3-70-g09d2