From c96d16159f15e14a188c9261833686dca240dee2 Mon Sep 17 00:00:00 2001 From: Patrick Davison Date: Mon, 18 Feb 2013 00:00:08 -0800 Subject: Chat updates. Commands /say to speak as server. Notification of new maps in chat. --- includes/chats.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'includes/chats.php') diff --git a/includes/chats.php b/includes/chats.php index ee222c9..a399d86 100644 --- a/includes/chats.php +++ b/includes/chats.php @@ -4,7 +4,7 @@ */ include_once('sqli.php'); -define('CHAT_ROWS_TO_KEEP', 50); +define('CHAT_ROWS_TO_KEEP', 75); function isMuted($userID) { @@ -24,8 +24,7 @@ function isMuted($userID) { function addChat($userID, $message) { global $mysqli; - if ($message == '') - return; + if ($message == '') return; $stmt = $mysqli->prepare("INSERT INTO `chat` (`userID`, `message`) @@ -35,7 +34,6 @@ function addChat($userID, $message) { $ID = $stmt->insert_id; $stmt->close(); - // $mysqli->close; return $ID; } @@ -43,12 +41,10 @@ function getChat($startID = 0) { global $mysqli; $array = array(); - if (!is_numeric($startID)) - return false; + if (!is_numeric($startID)) return false; //Not sure why this happens; but just return nothing.. - if (!is_object($mysqli)) - die("Error creating object"); + if (!is_object($mysqli)) die("mysqli is not an object"); $res = $mysqli->query(" SELECT @@ -74,8 +70,7 @@ function getChat($startID = 0) { } $res->close(); - if (count($array) < 1) - return false; + if (count($array) < 1) return false; //Turnicate messages. $deleteFromID = $lastID - CHAT_ROWS_TO_KEEP; -- cgit v1.2.3