diff --git a/inc/database_flatfile.php b/inc/database_flatfile.php index b6ab2bd..603f8d5 100644 --- a/inc/database_flatfile.php +++ b/inc/database_flatfile.php @@ -172,6 +172,9 @@ function deletePostByID($id) { } if (isset($thispost)) { + if ($thispost['parent'] == 0) { + @unlink('res/' . $thispost['id'] . '.html'); + } deletePostImages($thispost); $GLOBALS['db']->deleteWhere(POSTS_FILE, new SimpleWhereClause(POST_ID, '=', $thispost['id'], INTEGER_COMPARISON)); } diff --git a/inc/database_mysql.php b/inc/database_mysql.php index 64ecb42..9d6802c 100644 --- a/inc/database_mysql.php +++ b/inc/database_mysql.php @@ -129,7 +129,11 @@ function deletePostByID($id) { } else { $thispost = $post; } - } if (isset($thispost)) { + } + if (isset($thispost)) { + if ($thispost['parent'] == 0) { + @unlink('res/' . $thispost['id'] . '.html'); + } deletePostImages($thispost); mysql_query("DELETE FROM `" . $GLOBALS['mysql_posts_table'] . "` WHERE `id` = " . $thispost['id'] . " LIMIT 1"); }