From 5c094429d7fdcd6dbac4d1d9ff3d7cb190ad2b53 Mon Sep 17 00:00:00 2001 From: Savetheinternet Date: Sun, 2 Jan 2011 22:25:17 +1100 Subject: [PATCH] Locks --- inc/functions.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/inc/functions.php b/inc/functions.php index bdb8298c..57980283 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -133,7 +133,7 @@ function post($post, $OP) { global $pdo, $board; - $query = prepare(sprintf("INSERT INTO `posts_%s` VALUES ( NULL, :thread, :subject, :email, :name, :trip, :body, :time, :time, :thumb, :thumbwidth, :thumbheight, :file, :width, :height, :filesize, :filename, :filehash, :password, :ip, :sticky)", $board['uri'])); + $query = prepare(sprintf("INSERT INTO `posts_%s` VALUES ( NULL, :thread, :subject, :email, :name, :trip, :body, :time, :time, :thumb, :thumbwidth, :thumbheight, :file, :width, :height, :filesize, :filename, :filehash, :password, :ip, :sticky, :locked)", $board['uri'])); // Basic stuff $query->bindValue(':subject', $post['subject']); @@ -151,6 +151,12 @@ $query->bindValue(':sticky', 0, PDO::PARAM_INT); } + if($post['mod'] && $post['locked']) { + $query->bindValue(':locked', 1, PDO::PARAM_INT); + } else { + $query->bindValue(':locked', 0, PDO::PARAM_INT); + } + if($OP) { // No parent thread, image $query->bindValue(':thread', null, PDO::PARAM_NULL);