Browse Source

Added Feature - Different wait-time for OP and reply deletion.

main
Arvo Huru 7 years ago
committed by discomrade
parent
commit
4989762458
  1. 6
      inc/config.php
  2. 12
      post.php

6
inc/config.php

@ -526,8 +526,10 @@
$config['allow_delete'] = true;
// If thread has at least this number of replies, OP can't delete it anymore. (Set to false to disable)
$config['allow_delete_cutoff'] = 10;
// How long after posting should you have to wait before being able to delete that post? (In seconds.)
$config['delete_time'] = 10;
// How long after posting should you have to wait before being able to delete an OP thread? (In seconds.)
$config['delete_time_op'] = 10;
// How long after posting should you have to wait before being able to delete a reply post? (In seconds.)
$config['delete_time_reply'] = 0;
// Reply limit (stops bumping thread when this is reached).
$config['reply_limit'] = 250;

12
post.php

@ -230,8 +230,15 @@ if (isset($_POST['delete'])) {
if ($password != '' && $post['password'] != $password && (!$thread || $thread['password'] != $password))
error($config['error']['invalidpassword']);
if ($post['time'] > time() - $config['delete_time'] && (!$thread || $thread['password'] != $password)) {
error(sprintf($config['error']['delete_too_soon'], until($post['time'] + $config['delete_time'])));
if ($post['thread'] == NULL) {
if ($post['time'] > time() - $config['delete_time_op'] && (!$thread || $thread['password'] != $password)) {
error(sprintf($config['error']['delete_too_soon'], until($post['time'] + $config['delete_time_op'])));
}
}
else {
if ($post['time'] > time() - $config['delete_time_reply'] && (!$thread || $thread['password'] != $password)) {
error(sprintf($config['error']['delete_too_soon'], until($post['time'] + $config['delete_time_reply'])));
}
}
if (isset($_POST['file'])) {
@ -498,7 +505,6 @@ if (isset($_POST['delete'])) {
$thread = false;
}
// Check for an embed field
if ($config['enable_embedding'] && isset($_POST['embed']) && !empty($_POST['embed'])) {
// yep; validate it

Loading…
Cancel
Save