diff options
author | Patrick Davison <snapwilliam@gmail.com> | 2013-02-18 00:00:08 -0800 |
---|---|---|
committer | Patrick Davison <snapwilliam@gmail.com> | 2013-02-18 00:00:08 -0800 |
commit | c96d16159f15e14a188c9261833686dca240dee2 (patch) | |
tree | 4cc9752fe1fc2275682614c3145b74a7956b9253 /pages/chat.php | |
parent | d51b87d9a31f5914fe8509e6ac47eace1872d0ba (diff) | |
download | pathery-c96d16159f15e14a188c9261833686dca240dee2.tar.xz |
Chat updates. Commands /say to speak as server. Notification of new maps in chat.
Diffstat (limited to 'pages/chat.php')
-rw-r--r-- | pages/chat.php | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/pages/chat.php b/pages/chat.php index e165457..8aec336 100644 --- a/pages/chat.php +++ b/pages/chat.php @@ -65,6 +65,15 @@ function getChatDone(data) { //var timestamp = postDate.format("ddd h:MM TT");
//var timestamp = postDate.format("h:MM:ss");
var timestamp = postDate.format("hh:MM:ss");
+
+ var strClass = '';
+ if (user.userID == userObj.ID) {
+ strClass += ' self';
+ }
+ if (user.userID == '-1') {
+ strClass += ' server';
+ user.displayName = 'SERVER'
+ }
//console.log("INSIDE BUILD START");
p = '';
@@ -77,8 +86,11 @@ function getChatDone(data) { p = p+ " </div>";
p = p+ " <div class='chatColumn2'>";
-
- p = p+ "<span class='chatUsername'><a href='achievements?id="+user.userID+"' style='color:"+user.displayColor+"'>";
+ if (user.userID == '-1') {
+ p = p+ "<span class='chatUsername'><a href='home' style='color:#FA3'>";
+ } else {
+ p = p+ "<span class='chatUsername'><a href='achievements?id="+user.userID+"' style='color:"+user.displayColor+"'>";
+ }
p = p+ user.displayName+"</a>:</span>";
p = p+ " <span class='chatText'>";
@@ -86,15 +98,7 @@ function getChatDone(data) { p = p+ " </span>";
p = p+ " </div>";
- lastID = user.ID;
-
- var strClass = '';
- if (user.userID == userObj.ID) {
- strClass += ' self';
- }
- if (user.serverMessage == 'true') {
- strClass += ' server';
- }
+ if (user.ID > 0) lastID = user.ID;
items.push('<div class="chatMessage'+strClass+'" id="C_' + user.ID + '">' + p + '</div>');
newChats = true;
|