2012-03-21, 12:22 PM
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
2012-03-21, 04:42 PM
Hey, got the chat installed and it's great!
One problem though, I can't seem to figure out how to add channels, I have all the files in the right place, but it doesn't seem to matter if the files are there or not. All the channels that are available are the main channel and the user private channel.
Also, is it possible to add moderator/admin powers to a certain group? Thanks!
One problem though, I can't seem to figure out how to add channels, I have all the files in the right place, but it doesn't seem to matter if the files are there or not. All the channels that are available are the main channel and the user private channel.
Also, is it possible to add moderator/admin powers to a certain group? Thanks!
2012-03-22, 09:55 AM
I am not sure how to add channels via the interface, though I know a couple of people who have it working, but you can add another usergroup to the moderators by editing the CustomAjaxChat.php.
Just copy and paste the lines as below
so you have this extra line in your AJAX chat
That will make all of the users in group2 moderators. Adjust the group id to fit your needs.
function getValidLoginUserData() {
global $mybb;
// 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();
}
}
Just copy and paste the lines as below
else if($mybb->user['usergroup'] == 2)
$userData['userRole'] = AJAX_CHAT_MODERATOR;
so you have this extra line in your AJAX chat
else if($mybb->user['usergroup'] == 3)
$userData['userRole'] = AJAX_CHAT_MODERATOR;
else if($mybb->user['usergroup'] == 2)
$userData['userRole'] = AJAX_CHAT_MODERATOR;
That will make all of the users in group2 moderators. Adjust the group id to fit your needs.
2012-03-22, 03:16 PM
Thanks for your help.
However, I get this error when I paste that code below the bracket
Parse error: syntax error, unexpected T_ELSE, expecting T_FUNCTION in /home/xxx/public_html/forums/chat/lib/class/CustomAJAXChat.php on line 97
However, I get this error when I paste that code below the bracket
Parse error: syntax error, unexpected T_ELSE, expecting T_FUNCTION in /home/xxx/public_html/forums/chat/lib/class/CustomAJAXChat.php on line 97
2012-03-22, 04:05 PM
Ah - formatting issue in post - two code blocks combined. I have fixed that.
I used that EXACT code on my own chat and tested it. It worked.
I used that EXACT code on my own chat and tested it. It worked.
2012-03-23, 03:36 AM
Okay, I got that working. Thank you!
Now I need to figure out the channels, I understand I need to edit channels.php in the data folder, which I did
This is my code
$channels[0] = 'Main';
$channels[1] = 'Private';
$channels[2] = 'Room1';
$channels[3] = 'Room2';
However it doesn't show up, the only thing i see is Main and Private, the others don't show up
Now I need to figure out the channels, I understand I need to edit channels.php in the data folder, which I did
This is my code
$channels[0] = 'Main';
$channels[1] = 'Private';
$channels[2] = 'Room1';
$channels[3] = 'Room2';
However it doesn't show up, the only thing i see is Main and Private, the others don't show up
2012-03-23, 10:38 AM
Hmm, I don't have a data folder or a channels.php. That could be why I can't get it to work
2012-03-25, 03:01 PM
Unfortunately, after a year of use, it seems I'm going to have to switch to IRC. AJAX Chat worked well on my old server because it was faster. I've switched to a more economic server, but nevertheless it seems AJAX Chat is using an insane amount of resources, certainly more than you'd expect. Time to look for IRC implementing then...
It's been nice knowing you, AJAX Chat plugin. You served me well!
It's been nice knowing you, AJAX Chat plugin. You served me well!
2012-03-28, 02:11 AM
2012-05-09, 08:00 AM
All I get is a blank page. I've ran the sql-installation manually with phpmyadmin, still everything is blank. Install and /chat, nothing.
Any ideas?
Any ideas?