From e90a8d192446fce277dc3efe4f2913d5fecca0dc Mon Sep 17 00:00:00 2001 From: Snap Date: Tue, 28 Apr 2015 15:53:05 -0700 Subject: Chat improvements. Fixed "&P" or ";P" bug. Reduced size of chat-request size considerably with use of header_remove(); --- ajax/chat.ajax.php | 1 + includes/chats.php | 1 + pages/chat.php | 18 +++++++++++------- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/ajax/chat.ajax.php b/ajax/chat.ajax.php index 576ab39..2ffa878 100644 --- a/ajax/chat.ajax.php +++ b/ajax/chat.ajax.php @@ -6,6 +6,7 @@ session_start(); // exit; // } +header_remove(); //ini_set('display_errors',1); //ini_set('display_startup_errors',1); diff --git a/includes/chats.php b/includes/chats.php index 5bfd61f..d9616fd 100644 --- a/includes/chats.php +++ b/includes/chats.php @@ -160,6 +160,7 @@ function getChannelList($channel = 1) { chatUsers.dateEntered, TIME_TO_SEC(TIMEDIFF(NOW(), chatUsers.dateLastActive)) as secFromLastActive, + TIME_TO_SEC(TIMEDIFF(NOW(), chatUsers.dateEntered)) as secFromEntered, TIME_TO_SEC(TIMEDIFF(NOW(), users.dateChatGaggedUntil)) as secSinceGagged, chatUsers.isAdmin, diff --git a/pages/chat.php b/pages/chat.php index 4f10a1c..cc8d0eb 100644 --- a/pages/chat.php +++ b/pages/chat.php @@ -46,12 +46,13 @@ function getChatTimer() { //addChatMessage("Debug", "Chat timer called!"); } -pollChannelListTimer(); -function pollChannelListTimer() { - setTimeout("pollChannelListTimer()", channelTimerDelay); - pollChannelList(); -} +var pollChannelListTimer = setInterval(function () {pollChannelList()}, channelTimerDelay); +// pollChannelListTimer(); +// function pollChannelListTimer() { + // setTimeout("pollChannelListTimer()", channelTimerDelay); + // pollChannelList(); +// } var firstGetChat = true; function getChatDone(data) { @@ -212,7 +213,7 @@ function replaceSmileys(chat) { chat = chat.replace(/\:d/gi, ''); chat = chat.replace(/\:o/gi, ''); chat = chat.replace(/\:p/gi, ''); - chat = chat.replace(/;p/gi, ''); + chat = chat.replace(/;p/gi, ''); chat = chat.replace(/\:c/gi, ''); chat = chat.replace(/\:s/gi, ''); chat = chat.replace(/\>_\</g, ''); @@ -314,8 +315,11 @@ function channelListShow(JO) { // u.secFromLastActive could be used in here someplace.. + var dateEntered = new Date(); + dateEntered.setTime(dateEntered.getTime() + u.secFromEntered * 1000); + if (u.wallEmblem == undefined) u.wallEmblem = 'blank.png'; - p = p+ ""; + p = p+ ""; p = p+ ""; p = p+ "
"; -- cgit v1.2.3