|
|
@ -1510,11 +1510,6 @@ function rebuildPost($id) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Delete a post (reply or thread) |
|
|
|
function deletePostShadow($id, $error_if_doesnt_exist=true, $rebuild_after=true, $force_shadow_delete = false) { |
|
|
|
global $board, $config; |
|
|
@ -1526,10 +1521,8 @@ function deletePostShadow($id, $error_if_doesnt_exist=true, $rebuild_after=true, |
|
|
|
return deletePostPermanent($id, $error_if_doesnt_exist, $rebuild_after); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Delete a post (reply or thread) |
|
|
|
function deletePostPermanent($id, $error_if_doesnt_exist=true, $rebuild_after=true) { |
|
|
|
function deletePostPermanent($id, $error_if_doesnt_exist=true, $rebuild_after=true, $delete_files=true) { |
|
|
|
global $board, $config; |
|
|
|
|
|
|
|
// Select post and replies (if thread) in one query |
|
|
@ -1564,7 +1557,7 @@ function deletePostPermanent($id, $error_if_doesnt_exist=true, $rebuild_after=tr |
|
|
|
// Rebuild thread |
|
|
|
$rebuild = &$post['thread']; |
|
|
|
} |
|
|
|
if ($post['files']) { |
|
|
|
if ($post['files'] && $delete_files) { |
|
|
|
// Delete file |
|
|
|
foreach (json_decode($post['files']) as $i => $f) { |
|
|
|
if ($f->file !== 'deleted') { |
|
|
|