diff options
| author | Savetheinternet <savetheinternet@n0v4.com> | 2011-01-19 00:41:43 +1100 |
|---|---|---|
| committer | Savetheinternet <savetheinternet@n0v4.com> | 2011-01-19 00:41:43 +1100 |
| commit | 62bd2ee348f460b3d4cbbdbd8469a783b4c64c78 (patch) | |
| tree | fb79b3fca15d19804f92cd81e027fc55bce468aa /inc/mod.php | |
| parent | d284b0d50dabef2627ba9e38291f07e736dd0721 (diff) | |
A bunch of stuff.
Diffstat (limited to 'inc/mod.php')
| -rw-r--r-- | inc/mod.php | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/inc/mod.php b/inc/mod.php index a325d589..5e3a2c87 100644 --- a/inc/mod.php +++ b/inc/mod.php @@ -209,45 +209,4 @@ buildThread($post['thread']); } - - // Delete a post (reply or thread) - function deletePost($id) { - global $board; - - // Select post and replies (if thread) in one query - $query = prepare(sprintf("SELECT `id`,`thread`,`thumb`,`file` FROM `posts_%s` WHERE `id` = :id OR `thread` = :id", $board['uri'])); - $query->bindValue(':id', $id, PDO::PARAM_INT); - $query->execute() or error(db_error($query)); - - if($query->rowCount() < 1) { - error(ERROR_INVALIDPOST); - } - - // Delete posts and maybe replies - while($post = $query->fetch()) { - if(!$post['thread']) { - // Delete thread HTML page - @unlink($board['dir'] . DIR_RES . sprintf(FILE_PAGE, $post['id'])); - } elseif($query->rowCount() == 1) { - // Rebuild thread - $rebuild = $post['thread']; - } - if($post['thumb']) { - // Delete thumbnail - @unlink($board['dir'] . DIR_THUMB . $post['thumb']); - } - if($post['file']) { - // Delete file - @unlink($board['dir'] . DIR_IMG . $post['file']); - } - } - - $query = prepare(sprintf("DELETE FROM `posts_%s` WHERE `id` = :id OR `thread` = :id", $board['uri'])); - $query->bindValue(':id', $id, PDO::PARAM_INT); - $query->execute() or error(db_error($query)); - - if(isset($rebuild)) { - buildThread($rebuild); - } - } ?>
\ No newline at end of file |
