From 895690e7e54079851d534bea2b35a25840434ac7 Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Mon, 18 Feb 2013 23:29:31 -0800 Subject: More chat fixes --- includes/chats.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'includes') diff --git a/includes/chats.php b/includes/chats.php index a399d86..dcd46c9 100644 --- a/includes/chats.php +++ b/includes/chats.php @@ -12,7 +12,7 @@ function isMuted($userID) { $sql = "SELECT `dateChatGaggedUntil` FROM `users` WHERE `ID` = ? - AND `dateChatGaggedUntil` > CURDATE()"; + AND `dateChatGaggedUntil` > NOW()"; $stmt = $mysqli->prepare($sql); $stmt->bind_param("i", $userID); $stmt->execute(); @@ -22,6 +22,16 @@ function isMuted($userID) { else return false; } +function muteUser($userID, $numMinutes) { + global $mysqli; + $stmt = $mysqli->prepare("UPDATE `users` + SET `dateChatGaggedUntil` = ADDDATE(NOW(), INTERVAL ? MINUTE) + WHERE `ID` = ?"); + $stmt->bind_param('ii', $numMinutes, $userID); + $stmt->execute(); + return; +} + function addChat($userID, $message) { global $mysqli; if ($message == '') return; -- cgit v1.2.3