diff options
Diffstat (limited to 'inc/functions.php')
| -rw-r--r-- | inc/functions.php | 15 |
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']); |
