summaryrefslogtreecommitdiffstats
path: root/includes/chats.php
diff options
context:
space:
mode:
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;