diff options
| author | Fredrick Brennan <admin@8chan.co> | 2014-05-05 18:03:51 -0400 |
|---|---|---|
| committer | Fredrick Brennan <admin@8chan.co> | 2014-05-05 18:03:51 -0400 |
| commit | d31a3539623640815628b626fd6428abed8a5b5c (patch) | |
| tree | 317d21c4f8bd94e8fbe34d708ed12f1e83f06246 | |
| parent | 7f725713a1616860e2a576310005c2b90d56fc98 (diff) | |
Allow post deletion switch
| -rw-r--r-- | inc/config.php | 2 | ||||
| -rw-r--r-- | post.php | 6 | ||||
| -rw-r--r-- | templates/report_delete.html | 2 |
3 files changed, 9 insertions, 1 deletions
diff --git a/inc/config.php b/inc/config.php index d4ce3ada..7ff0ec7d 100644 --- a/inc/config.php +++ b/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). @@ -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(); diff --git a/templates/report_delete.html b/templates/report_delete.html index 07221120..2fcb7259 100644 --- a/templates/report_delete.html +++ b/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" /> |
