News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

AjaxChat Integration (latest version 3.2.1)

Started by .HuNTeR., August 27, 2008, 12:59:06 AM

Previous topic - Next topic

TheListener

As a reminder for folks due to the amount of pages:

Here are some of the most common questions and answers to getting your Chat Room and Shoutbox going on your forum for AJAX Chat Integration 3.2.1           
   
Please be sure to check the following settings in the Admin Panel.

For SMF 1.1.X  Admin/Configuration/Features and Options/

For SMF 2 RC1  Admin/Configuration/Modifications/Chat/

Enable the ShoutBox?   
Check for ShoutBox on any page or uncheck for only in index page:   
Integrate shout box and chat room?   
Chat in popup page?   
Enable online chat users numbering on chat button?   
Show online users below total logged in time section?

Also be sure to CHECK PERMISSIONS ;)

If you are using a custom theme you will need to edit the following files in your custom theme using a Package Parser.
Themes/yourtheme/index.template.php
Themes/yourtheme/style.css

And possibly...

Themes/yourtheme/BoardIndex.template.php
If your theme does not have a BoarIndex.template don't worry about it, that means your forum is using the default BoardIndex.template           

If you get a 500 Connection error you might have to set your file permissions as well.

There are 2 folder for the AJAX Chat Intergration Mod "Chat" and "Shoutbox".
For AJAX Chat Intergration Version 3 "Folders" be sure to change the file permissions (CHMOD) /chat/index.php and /shoutbox/index.php to 755

If you get a Connection  Status: 0 error from time to time it's harmless and you can stop it from showing

chat/js/chat.js
Find

Code: [Select]
this.addChatBotMessageToChatList('/error ConnectionStatus '+this.getHttpRequest(identifier).status);

Replace with
Code: [Select]
if (this.getHttpRequest(identifier).status != 0) {
this.addChatBotMessageToChatList('/error ConnectionStatus '+this.getHttpRequest(identifier).status);
}
Add a Welcome Message when you users enter the Chat

Open.....yourforum/chat/js/custom.js
Find

Code: [Select]
// Overriding client side functionality:

Add After (of course change Welcome to Paranormal Haunt  to whatever you like.)


Code: [Select]
ajaxChat.customInitialize = function() {
   ajaxChat.addChatBotMessageToChatList('Welcome to Paranormal Haunt')

   Change the name of your Chatbot

Open.....yourforum/chat/lib/config.php

Find and change Chatbot to whatever you'd like.

Code: [Select]
// The userName used for ChatBot messages
$config['chatBotName'] = 'ChatBot';
AWAY FROM KEYBOARD

So people don't start saying they are being ignored this is very handy. I use this myself.

Open lib/class/CustomAJAXChat.php and add the following before the last closing bracket } at the end of the file:

Code: [Select]
function parseCustomCommands($text, $textParts) {
      switch($textParts[0]) {
         // Away from keyboard message:
         case '/afk':
            // Set the userName:
            $this->setUserName('<AFK>_'.$this->getUserName());
            // Update the online user table:
            $this->updateOnlineList();
            // Add info message to update the client-side stored userName:
            $this->addInfoMessage($this->getUserName(), 'userName');
            // Store AFK status as session variable:
            $this->setSessionVar('AwayFromKeyboard', true);
            return true;
         default:
            return false;
      }
   }

   function onNewMessage($text) {
      // Reset AFK status on first inserted message:
      if($this->getSessionVar('AwayFromKeyboard')) {
         $this->setUserName($this->subString($this->getUserName(), 6));
         $this->updateOnlineList();
         $this->addInfoMessage($this->getUserName(), 'userName');
         $this->setSessionVar('AwayFromKeyboard', false);
      }
      return true;
   }
PROFANITY WORD FILTER

This modification is short and simple.

Open chat/js/custom.js

Add the following to the end of the file:

Code: [Select]
//Replace stuff people say:
ajaxChat.replaceCustomText = function(text) {
text=text.replace(/frug/gi, 'Fruggles');
return text;
}

This will replace the word frug in chat with Fruggles. You can, of course, replaced the word frug with whatever you like, and you can add more replacements by copying the relevant line. For example:

Code: [Select]
//Replace stuff people say:
ajaxChat.replaceCustomText = function(text) {
text=text.replace(/frug/gi, 'Fruggles');
text=text.replace(/foo/gi, 'Donkey Foo');
return text;
}

ATHOUGH THERE ARE OTHER EDITS WHICH CAN BE MADE THE ONES I HAVE SHOWN ARE THE ONES I USE  ON MY CHAT.

Thanks go to mrtrc266 for the work he has endlessy put in to this mod.

kingkingston

7. Execute Modification ./Themes/default/index.template.php Test failed

had this problem when i went to install it.

TheListener

Quote from: kingkingston on September 01, 2009, 01:17:36 AM
7. Execute Modification ./Themes/default/index.template.php Test failed

had this problem when i went to install it.

All this means is you have to manually edit the file.

Urbanite

I've been playing around with different settings of this great mod over a number of days now and all things considered it comes out on top of  Hack's Park ShoutBox, the only feature insofar as I can make out that stops it being used as a standalone ShoutBox is that you cant turn access to the chat off completely.

I have an application where I would only want to use the ShoutBox part of this mod, is there any way I can stop the 'chat' button appearing on the menu without removing it from the code? Or if it I have to remove code can someone point me to what would need to be removed, thanks
Just when you finally get it idiot proof ...along comes a bigger idiot!

kingkingston

Quote from: TheListener on September 01, 2009, 10:30:27 AM
Quote from: kingkingston on September 01, 2009, 01:17:36 AM
7. Execute Modification ./Themes/default/index.template.php Test failed

had this problem when i went to install it.

All this means is you have to manually edit the file.
yeah i worked that out but how do i get the chat to work ? i enable it but when i click the chat button it pops up and doesn't show the chat,is there something else i need to do ?

TheListener


kingkingston


TheListener

You will be unable to use the chat until the file is edited manually.

Once done then all should be set. 

Don't forget the permissions.

danielwmoore

This chat mod is really great.  I have installed AjaxChat on SMF before without trouble, but I love the ease of how it is accomplished with this mod.  Also, with this mod, I am able to keep banned members out of chat because of the permissions that have been set.  That is really awesome.  That is why I changed over to this mod after testing it.

I have done further modifications with mine, and added a "chat" action (?action=chat) and changed the menu button destination so that it opens up into a chat.template.php in my theme I set up.  Now the chat room is contained within the forum itself, or so appears to be.  I used Javascript to detect a person's screen size and use that to calculate an iframe height, and use 100% width.  I have trimmed the top of the chat so that it fits in seamlessly.  No need to repeat titles.

I've also moved the shoutbox to the bottom of all the forum pages, and integrated it with the chat to encourage more participation.

It's been working out great.  We were using x7chat before and chat was empty all the time.  Now we have conversations going on and chat rooms filling up several times every day. 

Thanks for this mod.  Awesome, really.  I still went in and did a lot of custom edits, but I usually do that with all mods.  This made the whole thing a lot easier.

TheListener

Daniel can you please share how you moved the shoutbox to the bottom of your forum.

many people have asked how to do so.


Frosted Flake

Members of my forum are having trouble logging into the Ajax chat except for the admins. Here's what they get:

TheListener

Frosted Flake

I believe it may be your permissions.

Please pm an admin account and I will have a look for you.


Frosted Flake

Please help and tell me what I should do. I don't want to PM you an admin account.

TheListener

Without knowing what the exact problem is I am unable to help.

It could be the permissions, the file permissions may not be set to 755

Frosted Flake

Quote from: TheListener on September 01, 2009, 05:39:32 PM
Without knowing what the exact problem is I am unable to help.

It could be the permissions, the file permissions may not be set to 755
What file would it be called?

TheListener

Look in the permissions in the admin area.

Frosted Flake


TheListener

that has to be done either via your control panel or ftp

Frosted Flake

Quote from: TheListener on September 01, 2009, 06:10:16 PM
that has to be done either via your control panel or ftp
Dude I know. Just tell me what file name I have to set to 755.

Advertisement: