summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@n0v4.com>2011-02-19 19:45:54 +1100
committerSavetheinternet <savetheinternet@n0v4.com>2011-02-19 19:45:54 +1100
commitefa06c270e69e012c43368dfa05e51970762e59b (patch)
tree9cd2cfb121f3db89c04ceab6e07c116bd85f2280 /inc
parent13ef38d7b72085dbf436fa62f1b5ae76a88df3bd (diff)
Increased `filehash` length and made the reject-post-if-image-already-exists-in-active-content thing
Diffstat (limited to 'inc')
-rw-r--r--inc/functions.php15
1 files changed, 14 insertions, 1 deletions
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']);