diff --git a/inc/config.php b/inc/config.php index a9494ee8..a05d81ed 100644 --- a/inc/config.php +++ b/inc/config.php @@ -1481,6 +1481,7 @@ // Mod links (full HTML). $config['mod']['link_delete'] = '[D]'; + $config['mod']['link_shadow_delete'] = '[ShD]'; $config['mod']['link_warning'] = '[W]'; $config['mod']['link_warningdelete'] = '[W&D]'; $config['mod']['link_ban'] = '[B]'; diff --git a/inc/functions.php b/inc/functions.php index 55ad9b76..56a9399c 100755 --- a/inc/functions.php +++ b/inc/functions.php @@ -1458,11 +1458,11 @@ function rebuildPost($id) { // Delete a post (reply or thread) -function deletePostShadow($id, $error_if_doesnt_exist=true, $rebuild_after=true) { +function deletePostShadow($id, $error_if_doesnt_exist=true, $rebuild_after=true, $force_shadow_delete = false) { global $board, $config; // If we are using non permanent delete run that function - if($config['shadow_del']['use'] && ($config['mod']['auto_delete_shadow_post'] === false || !hasPermission($config['mod']['auto_delete_shadow_post']))) + if($force_shadow_delete || ($config['shadow_del']['use'] && ($config['mod']['auto_delete_shadow_post'] === false || !hasPermission($config['mod']['auto_delete_shadow_post'])))) return ShadowDelete::deletePost($id, $error_if_doesnt_exist, $rebuild_after); else return deletePostPermanent($id, $error_if_doesnt_exist, $rebuild_after); diff --git a/inc/mod/pages.php b/inc/mod/pages.php index e6a0ec6a..f7e655f3 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -2330,7 +2330,7 @@ function mod_shadow_purge() { -function mod_delete($board, $post) { +function mod_delete($board, $force_shadow_delete, $post) { global $config, $mod; if (!openBoard($board)) @@ -2382,7 +2382,7 @@ function mod_delete($board, $post) { } } // Delete post (get thread id) - $thread_id = deletePostShadow($post); + $thread_id = deletePostShadow($post, true, true, $force_shadow_delete); // Record the action modLog("Deleted post #{$post}"); // Rebuild board diff --git a/mod.php b/mod.php index a9968ef9..c93fd167 100644 --- a/mod.php +++ b/mod.php @@ -92,7 +92,7 @@ $pages = array( '/(\%b)/move_reply/(\d+)' => 'secure_POST move_reply', // move reply '/(\%b)/merge/(\d+)' => 'secure_POST merge', // merge thread '/(\%b)/edit(_raw)?/(\d+)' => 'secure_POST edit_post', // edit post - '/(\%b)/delete/(\d+)' => 'secure delete', // delete post + '/(\%b)/delete(_shadow)?/(\d+)' => 'secure delete', // delete post '/(\%b)/deletefile/(\d+)/(\d+)' => 'secure deletefile', // delete file from post '/(\%b)/deletefilepermaban/(\d+)/(\d+)' => 'secure deletefilepermaban', // delete file from post and permaban it '/(\%b+)/spoiler/(\d+)/(\d+)' => 'secure spoiler_image', // spoiler file diff --git a/templates/post/post_controls.html b/templates/post/post_controls.html index 472bb403..c1da730a 100644 --- a/templates/post/post_controls.html +++ b/templates/post/post_controls.html @@ -4,6 +4,9 @@ {% if not post.shadow %} {% if mod|hasPermission(config.mod.delete, board.uri) %} {{ secure_link_confirm(config.mod.link_delete, 'Delete'|trans, 'Are you sure you want to delete this?'|trans, board.dir ~ 'delete/' ~ post.id) }}  + {% if mod|hasPermission(config.mod.auto_delete_shadow_post, board.uri) %} + {{ secure_link_confirm(config.mod.link_shadow_delete, 'Shadow Delete'|trans, 'Are you sure you want to shadow delete this?'|trans, board.dir ~ 'delete_shadow/' ~ post.id) }}  + {% endif %} {% endif %} {% if mod|hasPermission(config.mod.deletebyip, board.uri) %} {{ secure_link_confirm(config.mod.link_deletebyip, 'Delete all posts by IP'|trans, 'Are you sure you want to delete all posts by this IP address?'|trans, board.dir ~ 'deletebyip/' ~ post.id) }}