diff options
Diffstat (limited to 'includes')
-rw-r--r-- | includes/chats.php | 12 |
1 files changed, 11 insertions, 1 deletions
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;
|