Don't allow users to post in locked threads'

This commit is contained in:
Savetheinternet 2011-01-03 01:23:34 +11:00
parent 567d37c62e
commit 5df6f85854
3 changed files with 21 additions and 0 deletions

View file

@ -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;