diff options
author | Patrick Davison <snapwilliam@gmail.com> | 2013-02-18 23:29:31 -0800 |
---|---|---|
committer | Patrick Davison <snapwilliam@gmail.com> | 2013-02-18 23:29:31 -0800 |
commit | 895690e7e54079851d534bea2b35a25840434ac7 (patch) | |
tree | 0759ec35c368ce965380860153ac744482c299dd /includes | |
parent | 05b682c22f2dadf483b8a2842b4065acc34872af (diff) | |
download | pathery-895690e7e54079851d534bea2b35a25840434ac7.tar.xz |
More chat fixes
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;
|