diff options
author | Snap <snapwilliam@gmail.com> | 2015-04-28 15:53:05 -0700 |
---|---|---|
committer | Snap <snapwilliam@gmail.com> | 2015-04-28 15:53:05 -0700 |
commit | e90a8d192446fce277dc3efe4f2913d5fecca0dc (patch) | |
tree | f091064290aa73a2b54ec83262b09725f74d7ff8 | |
parent | 79d3c716e38084beab01d34a5f49a5aee7e72526 (diff) | |
download | pathery-e90a8d192446fce277dc3efe4f2913d5fecca0dc.tar.xz |
Chat improvements.
Fixed "&P" or ";P" bug.
Reduced size of chat-request size considerably with use of
header_remove();
-rw-r--r-- | ajax/chat.ajax.php | 1 | ||||
-rw-r--r-- | includes/chats.php | 1 | ||||
-rw-r--r-- | 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, '<img title=":D" class="chatSmiley" src="images/smileys/Grinning.png" />');
chat = chat.replace(/\:o/gi, '<img title=":O" class="chatSmiley" src="images/smileys/Gasping.png" />');
chat = chat.replace(/\:p/gi, '<img title=":P" class="chatSmiley" src="images/smileys/Tongue_Out.png" />');
- chat = chat.replace(/;p/gi, '<img title=":s" class="chatSmiley" src="images/smileys/Tongue_Out_Winking.png" />');
+ chat = chat.replace(/;p/gi, '<img title=";p" class="chatSmiley" src="images/smileys/Tongue_Out_Winking.png" />');
chat = chat.replace(/\:c/gi, '<img title=":c" class="chatSmiley" src="images/smileys/Childish.png" />');
chat = chat.replace(/\:s/gi, '<img title=":s" class="chatSmiley" src="images/smileys/Confused.png" />');
chat = chat.replace(/\>_\</g, '<img title=">_<" class="chatSmiley" src="images/smileys/Gah.png" />');
@@ -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+ "<tr style='"+styleClass+" background-color: "+u.background+"; color:"+u.displayColor+";' title=''>";
+ p = p+ "<tr style='"+styleClass+" background-color: "+u.background+"; color:"+u.displayColor+";' title='Entered channel " + dateEntered.format("ddd h:MM TT") + "'>";
p = p+ "<td style='vertical-align: middle;width:100px;'>";
p = p+ " <div class='grid_td' style='float:left; width:35px; height:35px; background:"+u.wallColor+" url("+linkEmblem(u.wallEmblem, u.wallOrientation)+");'>";
|