Setup translation for addvote.php

Signed-off-by: Callan Barrett <wizzomafizzo@gmail.com>
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
This commit is contained in:
Callan Barrett 2008-10-08 04:19:07 +08:00 committed by Loui Chang
parent d32c12679a
commit 2ce36384da

View file

@ -2,7 +2,7 @@
set_include_path(get_include_path() . PATH_SEPARATOR . '../lib' . PATH_SEPARATOR . '../lang'); set_include_path(get_include_path() . PATH_SEPARATOR . '../lib' . PATH_SEPARATOR . '../lang');
include("pkgfuncs_po.inc"); include("tu_po.inc");
include("aur.inc"); include("aur.inc");
set_lang(); set_lang();
check_sid(); check_sid();
@ -25,23 +25,23 @@ if ($atype == "Trusted User" OR $atype == "Developer") {
$check = mysql_num_rows(db_query($qcheck, $dbh)); $check = mysql_num_rows(db_query($qcheck, $dbh));
if ($check == 0) { if ($check == 0) {
$error.= "<div style='color: red; font-weight: bold'>Username does not exist.</div>"; $error.= "<div style='color: red; font-weight: bold'>" . __("Username does not exist.") . "</div>";
} else { } else {
$qcheck = "SELECT * FROM TU_VoteInfo WHERE User = '" . mysql_real_escape_string($_POST['user']) . "'"; $qcheck = "SELECT * FROM TU_VoteInfo WHERE User = '" . mysql_real_escape_string($_POST['user']) . "'";
$qcheck.= " AND End > UNIX_TIMESTAMP()"; $qcheck.= " AND End > UNIX_TIMESTAMP()";
$check = mysql_num_rows(db_query($qcheck, $dbh)); $check = mysql_num_rows(db_query($qcheck, $dbh));
if ($check != 0) { if ($check != 0) {
$error.= "<div style='color: red; font-weight: bold'>" . htmlentities($_POST['user']) . " already has proposal running for them.</div>"; $error.= "<div style='color: red; font-weight: bold'>" . __("%s already has proposal running for them.", htmlentities($_POST['user'])) . "</div>";
} }
} }
} }
if (!empty($_POST['length'])) { if (!empty($_POST['length'])) {
if (!is_numeric($_POST['length'])) { if (!is_numeric($_POST['length'])) {
$error.= "<div style='color: red; font-weight: bold'>Length must be a number.</div>"; $error.= "<div style='color: red; font-weight: bold'>" . __("Length must be a number.") . "</div>";
} else if ($_POST['length'] < 1) { } else if ($_POST['length'] < 1) {
$error.= "<div style='color: red; font-weight: bold'>Length must be at least 1.</div>"; $error.= "<div style='color: red; font-weight: bold'>" . __("Length must be at least 1.") . "</div>";
} else { } else {
$len = (60*60*24)*$_POST['length']; $len = (60*60*24)*$_POST['length'];
} }
@ -50,7 +50,7 @@ if ($atype == "Trusted User" OR $atype == "Developer") {
} }
if (empty($_POST['agenda'])) { if (empty($_POST['agenda'])) {
$error.= "<div style='color: red; font-weight: bold'>Proposal cannot be empty.</div>"; $error.= "<div style='color: red; font-weight: bold'>" . __("Proposal cannot be empty.") . "</div>";
} }
} }
@ -62,21 +62,21 @@ if ($atype == "Trusted User" OR $atype == "Developer") {
$q.= ", " . uid_from_sid($_COOKIE["AURSID"]) . ")"; $q.= ", " . uid_from_sid($_COOKIE["AURSID"]) . ")";
db_query($q, $dbh); db_query($q, $dbh);
print "<p>New proposal submitted.</p>\n"; print "<p>" . __("New proposal submitted.") . "</p>\n";
} else { } else {
?> ?>
<p>Submit a proposal to vote on.</p> <p><?php print __("Submit a proposal to vote on.") ?></p>
<?php if (!empty($error)) { print $error . "<br />"; } ?> <?php if (!empty($error)) { print $error . "<br />"; } ?>
<form action='addvote.php' method='post'> <form action='addvote.php' method='post'>
<b>Applicant/TU:</b> <b><?php print __("Applicant/TU:") ?></b>
<input type='text' name='user' value='<?php if (!empty($_POST['user'])) { print htmlentities($_POST['user'], ENT_QUOTES); } ?>'> <input type='text' name='user' value='<?php if (!empty($_POST['user'])) { print htmlentities($_POST['user'], ENT_QUOTES); } ?>'>
(empty if not applicable) <?php print __("(empty if not applicable)") ?>
<br /> <br />
<b>Length in days:</b> <b><?php print __("Length in days:") ?></b>
<input type='text' name='length' value='<?php if (!empty($_POST['length'])) { print htmlentities($_POST['length'], ENT_QUOTES); } ?>'> <input type='text' name='length' value='<?php if (!empty($_POST['length'])) { print htmlentities($_POST['length'], ENT_QUOTES); } ?>'>
(defaults to 7 if empty) <?php print __("(defaults to 7 if empty)") ?>
<br /> <br />
<b>Proposal:</b><br /> <b><?php print __("Proposal:") ?></b><br />
<textarea name='agenda' rows='10' cols='50'><?php if (!empty($_POST['agenda'])) { print htmlentities($_POST['agenda']); } ?></textarea><br /> <textarea name='agenda' rows='10' cols='50'><?php if (!empty($_POST['agenda'])) { print htmlentities($_POST['agenda']); } ?></textarea><br />
<input type='hidden' name='addVote' value='1'> <input type='hidden' name='addVote' value='1'>
<input type='submit' class='button' value='Submit'> <input type='submit' class='button' value='Submit'>
@ -84,9 +84,9 @@ if ($atype == "Trusted User" OR $atype == "Developer") {
<br /> <br />
<?php <?php
} }
print "<a href='tu.php'>Back</a>"; print "<a href='tu.php'>" . __("Back") . "</a>";
} else { } else {
print "You are not allowed to access this area.\n"; print __("You are not allowed to access this area.");
} }
html_footer(AUR_VERSION); html_footer(AUR_VERSION);