Merge pull request #308 from forklessanon/patch-6

Added tripcode removal to post editing
This commit is contained in:
Fredrick Brennan 2014-12-16 09:42:53 +08:00
commit 14fce406a8
2 changed files with 12 additions and 3 deletions

View File

@ -1599,12 +1599,13 @@ function mod_edit_post($board, $edit_raw_html, $postID) {
error($config['error']['404']); error($config['error']['404']);
if (isset($_POST['name'], $_POST['email'], $_POST['subject'], $_POST['body'])) { if (isset($_POST['name'], $_POST['email'], $_POST['subject'], $_POST['body'])) {
$trip = isset($_POST['remove_trip']) ? ' `trip` = NULL,' : '';
if ($edit_raw_html) if ($edit_raw_html)
$query = prepare(sprintf('UPDATE ``posts_%s`` SET `name` = :name, `email` = :email, `subject` = :subject, `body` = :body, `body_nomarkup` = :body_nomarkup, `edited_at` = NOW() WHERE `id` = :id', $board)); $query = prepare(sprintf('UPDATE ``posts_%s`` SET `name` = :name,'. $trip .' `email` = :email, `subject` = :subject, `body` = :body, `body_nomarkup` = :body_nomarkup, `edited_at` = NOW() WHERE `id` = :id', $board));
else else
$query = prepare(sprintf('UPDATE ``posts_%s`` SET `name` = :name, `email` = :email, `subject` = :subject, `body_nomarkup` = :body, `edited_at` = NOW() WHERE `id` = :id', $board)); $query = prepare(sprintf('UPDATE ``posts_%s`` SET `name` = :name,'. $trip .' `email` = :email, `subject` = :subject, `body_nomarkup` = :body, `edited_at` = NOW() WHERE `id` = :id', $board));
$query->bindValue(':id', $postID); $query->bindValue(':id', $postID);
$query->bindValue('name', $_POST['name']); $query->bindValue(':name', $_POST['name'] ? $_POST['name'] : $config['anonymous']);
$query->bindValue(':email', $_POST['email']); $query->bindValue(':email', $_POST['email']);
$query->bindValue(':subject', $_POST['subject']); $query->bindValue(':subject', $_POST['subject']);
$query->bindValue(':body', $_POST['body']); $query->bindValue(':body', $_POST['body']);

View File

@ -10,6 +10,14 @@
<input type="text" name="name" size="25" maxlength="35" autocomplete="off" value="{{ post.name }}"> <input type="text" name="name" size="25" maxlength="35" autocomplete="off" value="{{ post.name }}">
</td> </td>
</tr> </tr>
<tr>
<th>
{% trans %}Tripcode{% endtrans %}
</th>
<td>
Remove? <input type="checkbox" name="remove_trip" value="{{ post.trip }}">
</td>
</tr>
<tr> <tr>
<th> <th>
{% trans %}Email{% endtrans %} {% trans %}Email{% endtrans %}