From 67148f28463f8d4f2b7b61d38aa5d71df9658e4c Mon Sep 17 00:00:00 2001 From: Savetheinternet Date: Fri, 21 Jan 2011 13:14:55 +1100 Subject: ... --- inc/mod.php | 37 +------------------------------------ 1 file changed, 1 insertion(+), 36 deletions(-) (limited to 'inc/mod.php') diff --git a/inc/mod.php b/inc/mod.php index 5e3a2c87..5a3e6157 100644 --- a/inc/mod.php +++ b/inc/mod.php @@ -173,40 +173,5 @@ '' . ''; } - - // Remove file from post - function deleteFile($id) { - global $board; - - $query = prepare(sprintf("SELECT `thread`,`thumb`,`file` FROM `posts_%s` WHERE `id` = :id AND `thread` IS NOT NULL LIMIT 1", $board['uri'])); - $query->bindValue(':id', $id, PDO::PARAM_INT); - $query->execute() or error(db_error($query)); - - if($query->rowCount() < 1) { - error(ERROR_INVALIDPOST); - } - - $post = $query->fetch(); - - $query = prepare(sprintf("UPDATE `posts_%s` SET `thumb` = NULL, `thumbwidth` = NULL, `thumbheight` = NULL, `filewidth` = NULL, `fileheight` = NULL, `filesize` = NULL, `filename` = NULL, `filehash` = NULL, `file` = :file WHERE `id` = :id OR `thread` = :id", $board['uri'])); - if($post['file'] == 'deleted') { - // Already deleted; remove file fully - $query->bindValue(':file', null, PDO::PARAM_NULL); - } else { - // Delete thumbnail - @unlink($board['dir'] . DIR_THUMB . $post['thumb']); - - // Delete file - @unlink($board['dir'] . DIR_IMG . $post['file']); - - // Set file to 'deleted' - $query->bindValue(':file', 'deleted', PDO::PARAM_INT); - } - // Update database - - $query->bindValue(':id', $id, PDO::PARAM_INT); - $query->execute() or error(db_error($query)); - - buildThread($post['thread']); - } + ?> \ No newline at end of file -- cgit v1.3