AjaxChat Integration (latest version 3.2.1)

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

Previous topic - Next topic

IDunc



hcfwesker

i'm on smf2 rc4

I need some help with an IF statement regarding private messages in the chat.

Under chat > lib > config.php

$config['allowPrivateMessages'] = false;

Is there an IF statement that can be added , where I can add membergroup IDs that would only allow them to use the private message option?

something like ... else if membergroupid = (1,2,3) then $config['allowPrivateMessages'] = true;

I know that's worng, lol, but something liek that, i just don't know how to write it out.

TheListener

Posting to confirm the mod does work on 2.0

All I had to do was edit my sources/subs file.

IDunc

Quote from: Brack1 on June 17, 2011, 09:38:00 AM
Posting to confirm the mod does work on 2.0

All I had to do was edit my sources/subs file.

Can you share with us what you edited?


TheListener

#7764
Quote from: IDunc on June 17, 2011, 11:14:28 AM
Quote from: Brack1 on June 17, 2011, 09:38:00 AM
Posting to confirm the mod does work on 2.0

All I had to do was edit my sources/subs file.

Compare the file with the parser.

virtualdave

QuoteCompare the file with the parser.

If you set the parser on 2.0 it kicks back an imcompatibility message? So how did you compare?

TheListener

Keep trying the previous versions.

I would look at RC4.

IDunc

I don't understand what compare the file with the parser means lol....


TheListener

Quote from: IDunc on June 17, 2011, 08:58:08 PM
I don't understand what compare the file with the parser means lol....

You should do with the amount of posts you have.

Look at the area where you would usually download the mod.


IDunc

Haha most, if not all, of my posts are asking for support for coding something.

So, you want me to look at this page? http://custom.simplemachines.org/mods/index.php?mod=1319


TheListener

Manual Install Instructions for SMF

is what you are looking for below Download this mod.

Try RC4 if RC5 doesn't work.

IDunc

To make this easier on me, which is selfish, I know, could you just make the necessary edits to my Subs.php for me?


TheListener

I'm not a coding person so will place the edits here.

/Sources/Subs.php

Find:
   $context['allow_pm'] = allowedTo('pm_read');

Add After:
[code]
$num = empty($modSettings['enableChatButtonNo']) ? 0 : count(chatOnlineUsers());
$chatButton = 'Chat';
$chatButton .= ($num > 0) ?  ('('.$num.')') : '';
$chatLink = str_replace("index.php", "chat/index.php", $scripturl);
if (!empty($modSettings['chatPopUp']))
$chatLink .= '" onclick="openWindow(this.href);this.blur();return false;';



Find:

               'mlist_search' => array(
'title' => $txt['mlist_search'],
'href' => $scripturl . '?action=mlist;sa=search',
'show' => true,
'is_last' => true,
),
),
),

Add After:


[code]'chat' => array(
'title' => $chatButton,
'href' => $chatLink,
'show' => true,
'sub_buttons' => array(
),
),


Remember to make backups first.

IDunc

For the second one, I see you're just adding a chat button to the main menu. Is that necessary to get Ajax to work on 2.0?

And do I modify my Subs.php before or after I install the mod?


TheListener

For the first question YES if chat isn't in the menu.

For the second it's personal choice.

IDunc

So I can't have this mod just display on my forum index? It needs to be on its own page?


TheListener

In the admin section you will find a check box which gives you the option to have the chat as a pop up.

IDunc

Is there any way to make it display on my forum index as a shoutbox?


TheListener

You can have the shoutbox and chat seperated or integrated.

However I noticed you are using simple portal (as do I) so I would suggest using their shoutbox.

IDunc

Yeah I guess I will do that, I just like the look of the Ajax shoutbox. But to save space and time, I'll stick with the SP shoutbox. Thanks a lot, and sorry for me wasting your time.


Advertisement: