diff options
| author | Macil Tech <maciltech@gmail.com> | 2012-11-14 13:33:27 -0700 |
|---|---|---|
| committer | Macil Tech <maciltech@gmail.com> | 2013-01-19 00:25:24 -0600 |
| commit | 91e8547b0469e0e046bc15cd9c86f7d7abe86999 (patch) | |
| tree | 4820be9122ed72f200966dc4dc61e025a8cc4354 /post.php | |
| parent | ced540a66ee223ba2e3e2b8dbaaf50e5b48a13d8 (diff) | |
Add image_reject_repost_in_thread option
Diffstat (limited to 'post.php')
| -rw-r--r-- | post.php | 39 |
1 files changed, 28 insertions, 11 deletions
@@ -500,17 +500,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'])) { |
