summaryrefslogtreecommitdiff
path: root/inc/functions.php
diff options
context:
space:
mode:
authorMichael <savetheinternet@tinyboard.org>2013-01-18 23:03:16 -0800
committerMichael <savetheinternet@tinyboard.org>2013-01-18 23:03:16 -0800
commitaccc3992f324da39f7725971cff86d080c8f9177 (patch)
treeca7a0f222d0fb5629311850c69b843cfa154b70e /inc/functions.php
parent6aac2472e66f87d2d38a3b0bd361e355836be49d (diff)
parent91e8547b0469e0e046bc15cd9c86f7d7abe86999 (diff)
Merge pull request #93 from Macil/image_reject_repost_in_thread
Add image_reject_repost_in_thread option
Diffstat (limited to 'inc/functions.php')
-rw-r--r--inc/functions.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/inc/functions.php b/inc/functions.php
index 8ce81e25..7437bde9 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;