Ajax Chat - Channelification
#1 28-03-2012 
If you are a simmer please do not bother reading further Big Grin

For all none simmers....

....the AJAX chat is a super popular addon for mybb boards. To be honest, I have a love/hate relationship with it - I love it because it is so slick - I hate it because it is such a resource hog without a socket server.

Anyway, a popular request is to have the forums show as channels in the mybb chat, but the documentation is very vague.

Here is how to do it:

Assumptions: You have the 0.8.5 version of the chat and have installed it in the standard location. You have made no edits to the core files.

there are TWO files you need to check:

chat/lib/class/CustomAJAXChat.php

and

chat/lib/config.php

In CustomAJAXChat, round about line 121 you will see this code:

PHP Code:
                // Add the valid channels to the channel list (the defaultChannelID is always valid):
                
if($forumPermissions[$value]['canview'] == 'yes' ||  $value == $this->getConfig('defaultChannelID')) {
                    
$this->_channels[$key] = $value;
                } 

Change it to:

PHP Code:
                // Add the valid channels to the channel list (the defaultChannelID is always valid):
                
if($forumPermissions[$value]['canview'] == '1' ||  $value == $this->getConfig('defaultChannelID')) {
                    
$this->_channels[$key] = $value;
                } 

then in config.php, round about line 78, you will see this

PHP Code:
// Defines an array of channelIDs (e.g. array(0, 1)) to limit the number of available channels, will be ignored if set to null:
$config['limitChannelList'] = null

If you leave that at null, then ALL forums will be displayed as channels. If you want to limit that, then you can do this

PHP Code:
// Defines an array of channelIDs (e.g. array(0, 1)) to limit the number of available channels, will be ignored if set to null:
$config['limitChannelList'] = array(0182); 

where 0 = default channel, 1 = forum1 and 82 equals forum 82.

I hope this is useful to someone and thanks to YIN at cavernofcreativity.com for the info.
The site don't jive? PRESS F5 Flower

0
#2 12-05-2012 
Hey Lee, would you happen to know how to get awaiting activation users to not have access to the chat? I have my guests set to not view the chat, but I don't want awaiting activationers to see the chat either. (I've use <ifs> and stuff to hide it, but they can still access through direct link)

Also, I hope this edit works on my version because I plan on getting rid of a lot of rooms.

Edit: Think I found a workaround. Just remove the public chat and then make all of my rooms forums. Then link to them in the config.

New question: Any way to organize the rooms??????? I want public to be on top, but it's in the middle some where.
Yin, proud to be a member of LeeFish since Mar 2012.
And proud to be the owner of Atlas Productions - Cavern Of Creativity!

0
#3 12-05-2012 
Yes I do

Try this in your CustomAJAXChat.php

http://yoursite/pathtoforum/chat/lib/class/CustomAJAXChat.php round about line 73

Adjust usergroups to fit your needs.

Code:
function getValidLoginUserData() {
         global $mybb;
                       // users in the group below will never be able to login
                        if (in_array($mybb->user['usergroup'], array(6,7))) {
        
         return false;
         }
         else    
         // Check if we have a valid registered user:

         if($mybb->user['uid']) {
             $userData = array();
             $userData['userID'] = $mybb->user['uid'];

             $userData['userName'] = $this->trimUserName($mybb->user['username']);
            
             // Take the userrole from the MyBB users primary group:
             if($mybb->user['usergroup'] == 4)
                 $userData['userRole'] = AJAX_CHAT_ADMIN;
             else if($mybb->user['usergroup'] == 3)
                 $userData['userRole'] = AJAX_CHAT_MODERATOR;
             else
                 $userData['userRole'] = AJAX_CHAT_USER;

             return $userData;
         } else {
             // Guest users:
             return $this->getGuestUser();
         }
     }
     }
The site don't jive? PRESS F5 Flower

0
#4 12-05-2012 
o_o
Nice Big Grin
I was editing my post and didn't even see that you answered. But I added a new question.
Yin, proud to be a member of LeeFish since Mar 2012.
And proud to be the owner of Atlas Productions - Cavern Of Creativity!

0
#5 12-05-2012 
I think public might have to be forum 1. Not tried. I only have one room.

* leefish glares at the tea fishes. Shhhh.
The site don't jive? PRESS F5 Flower

0
#6 12-05-2012 
Tongue yeah. I saw lol. But I thought it was the order of the forums too. So I made it in order Public, registered, VIP, Mods, then Admin. But they're all out of wack
Yin, proud to be a member of LeeFish since Mar 2012.
And proud to be the owner of Atlas Productions - Cavern Of Creativity!

0
#7 12-05-2012 
Do you mean the order in the config file, or the actual forum order?
The site don't jive? PRESS F5 Flower

0
#8 12-05-2012 
I've done both. my config file is (155, 156, 157, 158, 159, 160, 161, 162, 163)

And the forums are ordered how i want them as well. So the forums go in the right order just like the config file.
Yin, proud to be a member of LeeFish since Mar 2012.
And proud to be the owner of Atlas Productions - Cavern Of Creativity!

0
#9 12-05-2012 
AwesomeBig Grin

Also my goodness you have a lot of forums....
The site don't jive? PRESS F5 Flower

0
#10 12-05-2012 
But in the chat, it still doesn't work lol. I mean they work, I'm talking about the order.
Yin, proud to be a member of LeeFish since Mar 2012.
And proud to be the owner of Atlas Productions - Cavern Of Creativity!

0


Sorry, that is a members only option