some php help

hcfwesker

Seasoned Veteran
Joined
Jul 4, 2008
Messages
4,909
Reaction score
1
FP$
257
Im on SMF2 RC4 , which this question concerns the Ajax Chat

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

This line is what controls whether they're allowed or not

Code:
// Enable/Disable private Messages:
$config['allowPrivateMessages'] = false;

I want it where i can edit the line and add membergroup IDs that would only allow them to use the private message option?

I'm no pro, but tried myself, and came up with this, which only brings the chat down when i add it.

Code:
// Enable/Disable private Messages:
$config['allowPrivateMessages'] = false;
         else if (id_group == '2')
         {
            $config['allowPrivateMessages'] = true;
         }

member group id being "2" , cause i wanted to test it with staff only.

any help, or advice would be greatly appreciated. couldn't get much help from smf support, so gonna ask some pros around here. thanx
 
Have you tried?
Code:
// Enable/Disable private Messages:
if ( id_group == '2') {
$config['allowPrivateMessages'] = true;
}
         else {
            $config['allowPrivateMessages'] = false;
         }
 
looks very promising, I'll give it a shot once I'm at my home PC.

+ Rep
 
That should work.

Before you were assigning the value and then trying to use the "if" statement
 
Back
Top Bottom