AjaxChat Integration (latest version 3.2.1)

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

Previous topic - Next topic

Dblog

hi, on a fresh install of smf 2.0 without any other MODS installed and using default theme, i could install ajax chat 3.2.2 and run succesfully.
but on an existing forum with mods like :

SA facebook inetgration
google + button
twitter integration
and few more

i get these errors in popup chat window

http://www.simplemachines.org/community/index.php?topic=257973.msg3152811#msg3152811

Dblog

i've edited the chat/lib/class/AJAXChatHTTPHeader.php file and removed code that sends header info
now errors on top of chat page disappeared but messages types are invisible
but they're stored in database. !!!!!

how to rectify this

Farjo

I get this problem on one of my servers but not another, so I assume it is server related. I never chased it up with the server admin as I now only use the chat mod on the server that works.

However, it worked if I unset the option to not show previous messages.

Dblog

both my running forum and test forum are on same server

hcfwesker

OK, I'm hoping I can get an answer for this.

I'm on SMF 2.0

When a memebr is given permission to moderate the chat, their given the color green in the chat.  Well, I have chat mods who we don't want to appear green, kinda like a secret chat mod.  How can I add member IDs to not have their name appear green in the chat?  like an IF statement in the /chat/css/[STYLE_NAME].css  file.


sunny1mill

I have downloaded the most uptodate AJAX CHAT but in order to add this to my installed packages do I simple upload the zip file to my site. Or do I have to extract it all then upload the instal.php ?? would apreciate if someone could advise thanks

Farjo

Cblog, does it work correctly on either forum?

hcfwesker, maybe perhaps in /chat/lib/class/CustomAJAXChat.php ??

if($context['user']['is_admin'])
$userData['userRole'] = AJAX_CHAT_ADMIN;
elseif(allowedTo('chat_mod'))
$userData['userRole'] = AJAX_CHAT_MODERATOR;
else
$userData['userRole'] = AJAX_CHAT_USER;

return $userData;
}

Perhaps maybe you could code an exception for a list of user names or a membergroup?

sunny1mill, you use the Package Manager to upload the zip file, see http://wiki.simplemachines.org/smf/Package_manager#Download_Packages
Be sure to backup your files and database first and do not install through any error messages - post them here.

Dblog

yes, i tried it on another forum where there were no other mods and it worked smoothly
i guess some mod has altered something that ajax chat is not able to mod

if someone can explain why messages typed are stored in database but not visible in chat room and why are online users not visible in sidebar, then i can try something again

Danni_X

I got the same problem. chat window is empty does not show users
but write database.
What can I do?

Maybe it's a conflict with other modules?

Dblog

i got this line in my error_log

CSRF state token does not match one provided.

PHP Notice:  Undefined index:  utf8 in /public_html/forums/Sources/Subs-Post.php on line 1259

Danni_X

problem is the theme used
I changed the theme and works
want to see where the theme is the problem
keep you informed  ;)

hcfwesker

Quote from: Farjo on September 09, 2011, 05:08:14 AM
hcfwesker, maybe perhaps in /chat/lib/class/CustomAJAXChat.php ??

if($context['user']['is_admin'])
$userData['userRole'] = AJAX_CHAT_ADMIN;
elseif(allowedTo('chat_mod'))
$userData['userRole'] = AJAX_CHAT_MODERATOR;
else
$userData['userRole'] = AJAX_CHAT_USER;

return $userData;
}

Perhaps maybe you could code an exception for a list of user names or a membergroup?

Thanx for the response.  I have global mods that i still want to show as chat mods, green.  The membergroup I'm trying to negate as green, are BDTL staff, member group id 44

I also have them their own custom color, I used the edits linked from the this topics FAQ.  And I kept it as AJAX_CHAT_VIP , which they appear as yellow html color #FFD700  .  The members names with member ids are Camden(1828), Vio(1027), blkmajik(801) , if that helps any.

Thanx for looking into this.  :)



TheListener

Have a look at this too:

      // Check if we have a valid registered user:
if($userData['chat_access']) {
if ($context['user']['is_guest'])
return $this->getGuestUser($userData);
else{
$userData['userID'] = $context['user']['id'];

$userData['userName'] = $this->trimUserName($context['user']['name']);

if($context['user']['is_admin'])
$userData['userRole'] = AJAX_CHAT_ADMIN;
elseif(allowedTo('chat_mod'))
$userData['userRole'] = AJAX_CHAT_MODERATOR;
else
{
// Check if we have a member of our custom user group
if(in_array(9, $user_info['groups']))
$userData['userRole'] = AJAX_CHAT_VIP;
else
$userData['userRole'] = AJAX_CHAT_USER;
}

return $userData;
}
}else
return null;

hcfwesker

I already done the edits for custom group color in the chat.  And it works.  The problem is, the group is showing green in the chat, because they have permissions to moderaqte the chat.  I want global moderators (with chat mod permissions)  to show as green.  BUT, this other group called BDTL staff (with chat mod permissions)  to show as yellow in the chat.

They appear as yellow in the chat, but once i give them chat mod powers, they turn green.   which i only want global mods to appear as green in the chat.

Farjo

Could you please post up your bit of code.

hcfwesker

// Check if we have a valid registered user:
      if($userData['chat_access']) {
         if ($context['user']['is_guest'])
            return $this->getGuestUser($userData);
         else{   
            $userData['userID'] = $context['user']['id'];
               
            $userData['userName'] = $this->trimUserName($context['user']['name']);
     
            if($context['user']['is_admin'])
               $userData['userRole'] = AJAX_CHAT_ADMIN;
            elseif(allowedTo('chat_mod'))
               $userData['userRole'] = AJAX_CHAT_MODERATOR;
            else
            {
               // Check if we have a member of our custom user group
               if(in_array(44, $user_info['groups']))
                  $userData['userRole'] = AJAX_CHAT_VIP;
               else
                  $userData['userRole'] = AJAX_CHAT_USER;
            }

         return $userData;
         }
      }else
         return null;


As I said, the group appears yellow in the chat.  But when I give anyone from this group chat mod permissions, they become green colored.  i'd just like the members from group id 44 , to always be yellow in the chat, and the yellow custom color, would override the green color assigned for them when given chat mod permission.

I still want green for those I want to be "recognized" as chat mods, but this group ( 44 ) I don't want members knowing they're chat mods, and the green gives them away.




Farjo

I'm not a php coder however my understanding of the logic of that code is that if a member is in group 44 and a moderator then it will hit the bit of code saying "elseif(allowedTo('chat_mod'))", execute that bit of code to become AJAX_CHAT_MODERATOR, but then will skip the next bit because it doesn't need an else.

How about putting the group 44 bit above the mod bit? In this case the group 44 people will execute the VIP code then skip the MODERATOR code.

hcfwesker

Quote from: Farjo on September 10, 2011, 06:29:34 AM
I'm not a php coder however my understanding of the logic of that code is that if a member is in group 44 and a moderator then it will hit the bit of code saying "elseif(allowedTo('chat_mod'))", execute that bit of code to become AJAX_CHAT_MODERATOR, but then will skip the next bit because it doesn't need an else.

How about putting the group 44 bit above the mod bit? In this case the group 44 people will execute the VIP code then skip the MODERATOR code.

I actually had the same theory that the code above was overwriting the chat_vip else statement.  I'll try it out and report back.  thanx again for being patient with me, and helping me through this process.  :)

T3CHN0

Hi all.
long time ago I asked this but never saw any reply to my post and can't find it now.
thought I would ask again...

on the shoutbox where you type before just before clicking the [shout] button to send your text
it's only about 2 inches long. where do I find the code for that so I can edit it to make it longer?

would make it allot better if everyone could see everything they write and re-read back over it before sending it.

cheers


Advertisement: