From 133c2dbbb90c489c95b1e7b50823e9e0cfe9c71f Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Thu, 14 Feb 2013 04:11:33 -0800 Subject: Mute-User and Lockdown for chat. :). --- includes/chats.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'includes') diff --git a/includes/chats.php b/includes/chats.php index 6a36fe3..ee222c9 100644 --- a/includes/chats.php +++ b/includes/chats.php @@ -7,6 +7,21 @@ include_once('sqli.php'); define('CHAT_ROWS_TO_KEEP', 50); +function isMuted($userID) { + global $mysqli; + + $sql = "SELECT `dateChatGaggedUntil` FROM `users` + WHERE `ID` = ? + AND `dateChatGaggedUntil` > CURDATE()"; + $stmt = $mysqli->prepare($sql); + $stmt->bind_param("i", $userID); + $stmt->execute(); + $stmt->bind_result($date); + $stmt->fetch(); + if ($date) return $date; + else return false; +} + function addChat($userID, $message) { global $mysqli; if ($message == '') -- cgit v1.2.3