Closed Thread
Results 1 to 5 of 5

Thread: AJAX Chat help

  1. #1
    Bash is offline Newbie
    Join Date
    Oct 2009
    Location
    London
    Posts
    3
    Rep Power
    0

    AJAX Chat help

    Hello

    (sorry, I'm a noob to AJAX, Java and PHP)

    I recently installed an Ajax chat on my site, not knowing that Ajax is actually a type of coding? (I thought 'AJAX Chat' was just a name, like 'Chatango' etc) so I'm finding it confusing on where to find support specifically for the version? of AJAX chat I'm using (I've found several different variations of AJAX chats available for download on the web).

    Anyway, I'd like to know how I can add an avatar for chat users? I know it's possible, since I've found lots of support for this function, but only for the phpbb forum mod which exracts the forum members avatar (and I'm using a standalone version).

    Thanks in advance for any advice.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Location
    Advertising world
    Posts
    Many

     
  3. #2
    Join Date
    Jul 2006
    Posts
    16,486
    Blog Entries
    75
    Rep Power
    143

    Re: AJAX Chat help

    It's going to depend a LOT on the actual code. AJAX is just the language/technology the chat is coded in. Your question would be about the same as saying "I have a Java Chat client, how do I add user avatars?" There's so many ways this could be coded that there isn't a single meaningful answer.
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  4. #3
    Bash is offline Newbie
    Join Date
    Oct 2009
    Location
    London
    Posts
    3
    Rep Power
    0

    Re: AJAX Chat help

    Thanks for your reply

    Yes it was a bit vague (sorry) it's just difficult when I don't know what it is that I'm looking for.

    I just found a way to change username colours, so that a particular user has a different coloured name (not just the user group colour). Perhaps the entries I need to change are around there?

    This was the code before I altered it:

    Code:
    getChatListMessageString: function(dateObject, userID, userName, userRole, messageID, messageText, channelID, ip) {
    		var rowClass = this.DOMbufferRowClass;
    		var userClass = this.getRoleClass(userRole);
    		var colon;
    		if(messageText.indexOf('/action') == 0 || messageText.indexOf('/me') == 0 || messageText.indexOf('/privaction') == 0) {
    			userClass += ' action';
    			colon = ' ';
    		} else {
    			colon = ': ';
    		}
    		var dateTime = this.settings['dateFormat'] ? '<span class="dateTime">'
    						+ this.formatDate(this.settings['dateFormat'], dateObject) + '</span> ' : '';
    		return	'<div id="'
    				+ this.getMessageDocumentID(messageID)
    				+ '" class="'
    				+ rowClass
    				+ '">'
    				+ this.getDeletionLink(messageID, userID, userRole, channelID)
    				+ dateTime
    				+ '<span class="'
    				+ userClass
    				+ '"'
    				+ this.getChatListUserNameTitle(userID, userName, userRole, ip)
    				+ ' dir="'
    				+ this.baseDirection
    				+ '" onclick="ajaxChat.insertText(this.firstChild.nodeValue);">'
    				+ userName
    				+ '</span>'
    				+ colon
    				+ this.replaceText(messageText)
    				+ '</div>';
    	},
    This is how I added seperate colours for individual usernames:

    Code:
    	getChatListMessageString: function(dateObject, userID, userName, userRole, messageID, messageText, channelID, ip) {
    		var rowClass = this.DOMbufferRowClass;
    		var userClass = this.getRoleClass(userRole);
    		var colon;
    		if(messageText.indexOf('/action') == 0 || messageText.indexOf('/me') == 0 || messageText.indexOf('/privaction') == 0) {
    			userClass += ' action';
    			colon = ' ';
    		} else {
    			colon = ': ';
    		}
    		var dateTime = this.settings['dateFormat'] ? '<span class="dateTime">'
    						+ this.formatDate(this.settings['dateFormat'], dateObject) + '</span> ' : '';
    		var strfixed = '<div id="'
    				+ this.getMessageDocumentID(messageID)
    				+ '" class="'
    				+ rowClass
    				+ '">'
    				+ this.getDeletionLink(messageID, userID, userRole, channelID)
    				+ dateTime
    				+ '<span class="'
    				+ userClass
    				+ '"'
    				+ this.getChatListUserNameTitle(userID, userName, userRole, ip)
    				+ ' dir="'
    				+ this.baseDirection
    				+ '" onclick="ajaxChat.insertText(this.firstChild.nodeValue);">'
    				+ userName
    				+ '</span>'
    				+ colon
    				+ this.replaceText(messageText)
    				+ '</div>';
    				if(strfixed.match("Username1")) {
                    strfixed=strfixed.replace('onclick', 'style="color: #888888;" onclick');
                    }
    				if(strfixed.match("Username2")) {
                    strfixed=strfixed.replace('onclick', 'style="color: #00FFFF;" onclick');
                    }
    				if(strfixed.match("Username3")) {
                    strfixed=strfixed.replace('onclick', 'style="color: #009F51;" onclick');
                    }
                    return strfixed;
    	},
    What do you call 'getChatListMessageString' for example? is it string? and are they standard commands like 'background-color' is in CSS for example?

  5. #4
    Join Date
    Jul 2006
    Posts
    16,486
    Blog Entries
    75
    Rep Power
    143

    Re: AJAX Chat help

    I think your username span needs another span after it with an image tag.

    getChatListMessageString might be a class or a constructor. I'm not sure, since I haven't done any advanced JavaScript.
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  6. #5
    Bash is offline Newbie
    Join Date
    Oct 2009
    Location
    London
    Posts
    3
    Rep Power
    0

    Re: AJAX Chat help

    ok well, looks like my search continues...

    Thanks anyway

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Intermediate Simple Chat system using PHP, MySQL and Ajax
    By Csabi in forum PHP Tutorials
    Replies: 4
    Last Post: 09-27-2010, 12:46 PM
  2. php ajax chat
    By alilg in forum Freebies
    Replies: 5
    Last Post: 10-01-2009, 06:35 AM
  3. CC Chat?
    By Fairy Fighter in forum The Lounge
    Replies: 69
    Last Post: 08-23-2009, 07:48 PM
  4. [Chat] Chat slang decoder:)
    By Donovan in forum The Lounge
    Replies: 34
    Last Post: 01-09-2009, 12:59 PM
  5. Vb6 Chat App
    By Flame142 in forum Visual Basic Programming
    Replies: 3
    Last Post: 09-06-2007, 10:40 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts