summaryrefslogtreecommitdiffstats
path: root/includes/chats.php
diff options
context:
space:
mode:
authorPatrick Davison <snapwilliam@gmail.com>2013-02-18 00:00:08 -0800
committerPatrick Davison <snapwilliam@gmail.com>2013-02-18 00:00:08 -0800
commitc96d16159f15e14a188c9261833686dca240dee2 (patch)
tree4cc9752fe1fc2275682614c3145b74a7956b9253 /includes/chats.php
parentd51b87d9a31f5914fe8509e6ac47eace1872d0ba (diff)
downloadpathery-c96d16159f15e14a188c9261833686dca240dee2.tar.xz
Chat updates. Commands /say to speak as server. Notification of new maps in chat.
Diffstat (limited to 'includes/chats.php')
-rw-r--r--includes/chats.php15
1 files changed, 5 insertions, 10 deletions
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;