Browse Source

Allow post deletion switch

pull/40/head
Fredrick Brennan 10 years ago
parent
commit
d31a353962
  1. 2
      inc/config.php
  2. 6
      post.php
  3. 2
      templates/report_delete.html

2
inc/config.php

@ -450,6 +450,8 @@
// Maximum filename length to display (the rest can be viewed upon mouseover).
$config['max_filename_display'] = 30;
// Allow users to delete their own posts?
$config['allow_delete'] = true;
// How long after posting should you have to wait before being able to delete that post? (In seconds.)
$config['delete_time'] = 10;
// Reply limit (stops bumping thread when this is reached).

6
post.php

@ -43,6 +43,10 @@ if (isset($_POST['delete'])) {
// Check if banned
checkBan($board['uri']);
// Check if deletion enabled
if (!$config['allow_delete'])
error(_('Post deletion is not allowed!'));
if (empty($delete))
error($config['error']['nodelete']);
@ -88,7 +92,7 @@ if (isset($_POST['delete'])) {
echo json_encode(array('success' => true));
}
} elseif (isset($_POST['report'])) {
if (!isset($_POST['board'], $_POST['password'], $_POST['reason']))
if (!isset($_POST['board'], $_POST['reason']))
error($config['error']['bot']);
$report = array();

2
templates/report_delete.html

@ -1,9 +1,11 @@
{% if config.allow_delete %}
<div class="delete">
{% trans %}Delete Post{% endtrans %} [<input title="Delete file only" type="checkbox" name="file" id="delete_file" />
<label for="delete_file">{% trans %}File{% endtrans %}</label>] <label for="password">{% trans %}Password{% endtrans %}</label>
<input id="password" type="password" name="password" size="12" maxlength="18" />
<input type="submit" name="delete" value="{% trans %}Delete{% endtrans %}" />
</div>
{% endif %}
<div class="delete" style="clear:both">
<label for="reason">{% trans %}Reason{% endtrans %}</label>
<input id="reason" type="text" name="reason" size="20" maxlength="30" />

Loading…
Cancel
Save