From efa06c270e69e012c43368dfa05e51970762e59b Mon Sep 17 00:00:00 2001 From: Savetheinternet Date: Sat, 19 Feb 2011 19:45:54 +1100 Subject: Increased `filehash` length and made the reject-post-if-image-already-exists-in-active-content thing --- inc/functions.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'inc/functions.php') diff --git a/inc/functions.php b/inc/functions.php index 535defb5..2cb55016 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -1121,7 +1121,20 @@ return $res; } - + + function getPostByHash($hash) { + global $board; + $query = prepare(sprintf("SELECT `id`,`thread` FROM `posts_%s` WHERE `filehash` = :hash", $board['uri'])); + $query->bindValue(':hash', $hash, PDO::PARAM_STR); + $query->execute() or error(db_error($query)); + + if($post = $query->fetch()) { + return $post; + } + + return false; + } + function undoImage($post) { unlink($post['file']); unlink($post['thumb']); -- cgit v1.3