summaryrefslogtreecommitdiff
path: root/inc/functions.php
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@n0v4.com>2011-01-03 01:23:34 +1100
committerSavetheinternet <savetheinternet@n0v4.com>2011-01-03 01:23:34 +1100
commit5df6f85854f25581df787241773b8b39e23e8f00 (patch)
tree066f1ef0fd730574bb3f73e70e6f1cb2c32cb2c0 /inc/functions.php
parent567d37c62ee30ed1f94e4e73659c96cea94afcf0 (diff)
Don't allow users to post in locked threads'
Diffstat (limited to 'inc/functions.php')
-rw-r--r--inc/functions.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/inc/functions.php b/inc/functions.php
index e5a8023d..a5ec0093 100644
--- a/inc/functions.php
+++ b/inc/functions.php
@@ -118,6 +118,21 @@
}
}
+ function threadLocked($id) {
+ global $board;
+
+ $query = prepare(sprintf("SELECT `locked` FROM `posts_%s` WHERE `id` = :id AND `thread` IS NULL LIMIT 1", $board['uri']));
+ $query->bindValue(':id', $id, PDO::PARAM_INT);
+ $query->execute() or error(db_error());
+
+ if(!$post = $query->fetch()) {
+ // Non-existant, so it can't be locked...
+ return false;
+ }
+
+ return (bool) $post['locked'];
+ }
+
function threadExists($id) {
global $board;