diff options
author | Loui Chang <louipc.ist@gmail.com> | 2009-01-25 13:17:54 -0500 |
---|---|---|
committer | Loui Chang <louipc.ist@gmail.com> | 2009-01-25 13:17:54 -0500 |
commit | 354c86b6c608c8923d0a087285f97d5d8121ed08 (patch) | |
tree | 2815243ed6596ca75a849e0191ef52712132d1ea /web/html | |
parent | f729eca80dbbce94ce02a5315794145fb8cd9bf7 (diff) | |
download | aurweb-354c86b6c608c8923d0a087285f97d5d8121ed08.tar.xz |
Move package comment form into a new template.
Feature the form on the package details page.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
Diffstat (limited to 'web/html')
-rw-r--r-- | web/html/pkgedit.php | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/web/html/pkgedit.php b/web/html/pkgedit.php index 5907d2c..3b1c825 100644 --- a/web/html/pkgedit.php +++ b/web/html/pkgedit.php @@ -53,73 +53,6 @@ if ($_REQUEST["del_Comment"]) { exit(); } -# Add a comment to this package -# -if ($_REQUEST["add_Comment"]) { - if ($_REQUEST["comment"]) { - # Insert the comment - # - $dbh = db_connect(); - $q = "INSERT INTO PackageComments "; - $q.= "(PackageID, UsersID, Comments, CommentTS) VALUES ("; - $q.= intval($_REQUEST["ID"]).", ".uid_from_sid($_COOKIE["AURSID"]) . ", "; - $q.= "'".mysql_real_escape_string($_REQUEST["comment"])."', "; - $q.= "UNIX_TIMESTAMP())"; - db_query($q, $dbh); - print __("Comment has been added."); - - # Send email notifications - # - $q = "SELECT CommentNotify.*, Users.Email "; - $q.= "FROM CommentNotify, Users "; - $q.= "WHERE Users.ID = CommentNotify.UserID "; - $q.= "AND CommentNotify.UserID != ".uid_from_sid($_COOKIE["AURSID"])." "; - $q.= "AND CommentNotify.PkgID = ".intval($_REQUEST["ID"]); - $result = db_query($q, $dbh); - $bcc = array(); - if (mysql_num_rows($result)) { - while ($row = mysql_fetch_assoc($result)) { - array_push($bcc, $row['Email']); - } - $q = "SELECT Packages.Name "; - $q.= "FROM Packages "; - $q.= "WHERE Packages.ID = ".intval($_REQUEST["ID"]); - $result = db_query($q, $dbh); - $row = mysql_fetch_assoc($result); - #TODO: native language emails for users, based on their prefs - # Simply making these strings translatable won't work, users would be - # getting emails in the language that the user who posted the comment was in - $body = - "from http://aur.archlinux.org/packages.php?ID=" - . $_REQUEST["ID"] . "\n" - . username_from_sid($_COOKIE["AURSID"]) . " wrote:\n\n" - . $_POST['comment'] - . "\n\n---\nIf you no longer wish to receive notifications about this package, please go the the above package page and click the UnNotify button."; - $body = wordwrap($body, 70); - $bcc = implode(', ', $bcc); - $headers = "Bcc: $bcc\nReply-to: nobody@archlinux.org\nFrom: aur-notify@archlinux.org\nX-Mailer: AUR\n"; - @mail(' ', "AUR Comment for ".$row['Name'], $body, $headers); - } - - } else { - # Prompt visitor for comment - # - print "<div align='center'>\n"; - print "<form action='pkgedit.php' method='post'>\n"; - print "<input type='hidden' name='add_Comment' value='1'>\n"; - print "<input type='hidden' name='ID' value=\"".$_REQUEST["ID"]."\">\n"; - print __("Enter your comment below.")."<br /> <br />\n"; - print "<textarea name='comment' rows='10' cols='50'></textarea>\n"; - print "<br /> <br />\n"; - print "<input type='submit' value=\"".__("Submit")."\">\n"; - print "<input type='reset' value=\"".__("Reset")."\">\n"; - print "</form>\n"; - print "</div>\n"; - } - html_footer(AUR_VERSION); - exit(); -} - # Change package category # if ($_REQUEST["change_Category"]) { |