1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2024-11-23 23:20:57 +01:00

Allow post deletion switch

This commit is contained in:
Fredrick Brennan 2014-05-05 18:03:51 -04:00
parent 7f725713a1
commit d31a353962
3 changed files with 9 additions and 1 deletions

View File

@ -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).

View File

@ -42,6 +42,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();

View File

@ -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" />