summaryrefslogtreecommitdiff
path: root/post.php
diff options
context:
space:
mode:
authorMichael <savetheinternet@tinyboard.org>2013-01-18 23:03:16 -0800
committerMichael <savetheinternet@tinyboard.org>2013-01-18 23:03:16 -0800
commitaccc3992f324da39f7725971cff86d080c8f9177 (patch)
treeca7a0f222d0fb5629311850c69b843cfa154b70e /post.php
parent6aac2472e66f87d2d38a3b0bd361e355836be49d (diff)
parent91e8547b0469e0e046bc15cd9c86f7d7abe86999 (diff)
Merge pull request #93 from Macil/image_reject_repost_in_thread
Add image_reject_repost_in_thread option
Diffstat (limited to 'post.php')
-rw-r--r--post.php39
1 files changed, 28 insertions, 11 deletions
diff --git a/post.php b/post.php
index 1153b46a..98da7486 100644
--- a/post.php
+++ b/post.php
@@ -478,17 +478,34 @@ if (isset($_POST['delete'])) {
}
}
- if ($post['has_file'] && $config['image_reject_repost'] && $p = getPostByHash($post['filehash'])) {
- undoImage($post);
- error(sprintf($config['error']['fileexists'],
- $post['mod'] ? $config['root'] . $config['file_mod'] . '?/' : $config['root'] .
- $board['dir'] . $config['dir']['res'] .
- ($p['thread'] ?
- $p['thread'] . '.html#' . $p['id']
- :
- $p['id'] . '.html'
- )
- ));
+ if ($post['has_file']) {
+ if ($config['image_reject_repost']) {
+ if ($p = getPostByHash($post['filehash'])) {
+ undoImage($post);
+ error(sprintf($config['error']['fileexists'],
+ $post['mod'] ? $config['root'] . $config['file_mod'] . '?/' : $config['root'] .
+ $board['dir'] . $config['dir']['res'] .
+ ($p['thread'] ?
+ $p['thread'] . '.html#' . $p['id']
+ :
+ $p['id'] . '.html'
+ )
+ ));
+ }
+ } else if (!$post['op'] && $config['image_reject_repost_in_thread']) {
+ if ($p = getPostByHashInThread($post['filehash'], $post['thread'])) {
+ undoImage($post);
+ error(sprintf($config['error']['fileexistsinthread'],
+ $post['mod'] ? $config['root'] . $config['file_mod'] . '?/' : $config['root'] .
+ $board['dir'] . $config['dir']['res'] .
+ ($p['thread'] ?
+ $p['thread'] . '.html#' . $p['id']
+ :
+ $p['id'] . '.html'
+ )
+ ));
+ }
+ }
}
if (!hasPermission($config['mod']['postunoriginal'], $board['uri']) && $config['robot_enable'] && checkRobot($post['body_nomarkup'])) {