From 91e8547b0469e0e046bc15cd9c86f7d7abe86999 Mon Sep 17 00:00:00 2001 From: Macil Tech Date: Wed, 14 Nov 2012 13:33:27 -0700 Subject: Add image_reject_repost_in_thread option --- inc/functions.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'inc/functions.php') diff --git a/inc/functions.php b/inc/functions.php index a7b6b434..63fd4a27 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -1651,6 +1651,20 @@ function getPostByHash($hash) { return false; } +function getPostByHashInThread($hash, $thread) { + global $board; + $query = prepare(sprintf("SELECT `id`,`thread` FROM `posts_%s` WHERE `filehash` = :hash AND ( `thread` = :thread OR `id` = :thread )", $board['uri'])); + $query->bindValue(':hash', $hash, PDO::PARAM_STR); + $query->bindValue(':thread', $thread, PDO::PARAM_INT); + $query->execute() or error(db_error($query)); + + if ($post = $query->fetch()) { + return $post; + } + + return false; +} + function undoImage(array $post) { if (!$post['has_file']) return; -- cgit v1.3