summaryrefslogtreecommitdiff
path: root/inc/functions.php
diff options
context:
space:
mode:
authorMacil Tech <maciltech@gmail.com>2012-11-14 13:33:27 -0700
committerMacil Tech <maciltech@gmail.com>2013-01-19 00:25:24 -0600
commit91e8547b0469e0e046bc15cd9c86f7d7abe86999 (patch)
tree4820be9122ed72f200966dc4dc61e025a8cc4354 /inc/functions.php
parentced540a66ee223ba2e3e2b8dbaaf50e5b48a13d8 (diff)
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 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;