Davey-UK
04-05-2012, 06:48 AM
Hopefully you will be able to understand my needs here. I will try to explain the best i can.
I have the following piece of code in a plugin i am trying to work with:
$schbot = ($vbulletin->superglobal_size['_COOKIE'] == 0 AND preg_match("#(google|msnbot)#si", $_SERVER['HTTP_USER_AGENT']));
// check if user is in a certain usergroup and if system is enabled
if ($show['guest'] AND !$schbot AND $vbulletin->options['schison'])
The part highlighted in red is the bit i need to modify. I want it to check if the user is in a certain usergroup (2).
I have read about the conditionals, and got the following:
is_member_of($bbuserinfo, 2)
But if i simply exchange one for the other, as below, it doesnt work.
$schbot = ($vbulletin->superglobal_size['_COOKIE'] == 0 AND preg_match("#(google|msnbot)#si", $_SERVER['HTTP_USER_AGENT']));
// check if user is in a certain usergroup and if system is enabled
if (is_member_of($bbuserinfo, 2) AND !$schbot AND $vbulletin->options['schison'])
Can someone point me in the right direction, before i pull my hair out! Please. :)
Basically the code is making sure i am not from google or msn, and if i am in usergroup 2 it will fire a message.
I have the following piece of code in a plugin i am trying to work with:
$schbot = ($vbulletin->superglobal_size['_COOKIE'] == 0 AND preg_match("#(google|msnbot)#si", $_SERVER['HTTP_USER_AGENT']));
// check if user is in a certain usergroup and if system is enabled
if ($show['guest'] AND !$schbot AND $vbulletin->options['schison'])
The part highlighted in red is the bit i need to modify. I want it to check if the user is in a certain usergroup (2).
I have read about the conditionals, and got the following:
is_member_of($bbuserinfo, 2)
But if i simply exchange one for the other, as below, it doesnt work.
$schbot = ($vbulletin->superglobal_size['_COOKIE'] == 0 AND preg_match("#(google|msnbot)#si", $_SERVER['HTTP_USER_AGENT']));
// check if user is in a certain usergroup and if system is enabled
if (is_member_of($bbuserinfo, 2) AND !$schbot AND $vbulletin->options['schison'])
Can someone point me in the right direction, before i pull my hair out! Please. :)
Basically the code is making sure i am not from google or msn, and if i am in usergroup 2 it will fire a message.