PDA

View Full Version : Can't seem to figure out how to exclude styles from showing a code


HMBeaty
07-09-2011, 06:08 PM
Maybe I'm tired, I dunno lol, but I can't seem to figure out how to exclude style(s) from showing a plugin code.

I've started off with this, which I know is right (I think lol)
$navnetstyle = explode(',', $vbulletin->options['usml_navnet_styles']);and I've already got the plugin so certain usergroups can be excluded by using this:
$navnetugs = explode(',', $vbulletin->options['usml_navnet_ugrest']);

if (!is_member_of($vbulletin->userinfo, $navnetugs))
{
code here
}But, how do I do it for styles? :confused:

kh99
07-09-2011, 06:22 PM
You want to eliminate some code if a certain style is showing? I think you want

$navnetstyle = explode(',', $vbulletin->options['usml_navnet_styles']);

if (!in_array(STYLEID, $navnetstyle))
{
code here
}

HMBeaty
07-09-2011, 06:31 PM
You want to eliminate some code if a certain style is showing? I think you want

$navnetstyle = explode(',', $vbulletin->options['usml_navnet_styles']);

if (!in_array(STYLEID, $navnetstyle))
{
code here
}
That doesn't work either :(

kh99
07-09-2011, 06:33 PM
I guess I should have asked, what is the format of the 'usml_navnet_styles' options (comma separated style ids?) and what hook locaiton are you using (hopefully it's after the style is loaded)?

HMBeaty
07-09-2011, 06:35 PM
I guess I should have asked, what is the format of the 'usml_navnet_styles' options (comma separated style ids?) and what hook locaiton are you using (hopefully it's after the style is loaded)?
Yes, comma separated list. The hook location is parse_templates

kh99
07-09-2011, 06:56 PM
Hmm...then I'm stumped, seems like it should work.

Badshah93
07-09-2011, 07:01 PM
try this it will work

if (!in_array(STYLEID, explode(",", $vbulletin->options['usml_navnet_styles'])))
{
COde here
}

HMBeaty
07-09-2011, 07:20 PM
try this it will work

if (!in_array(STYLEID, explode(",", $vbulletin->options['usml_navnet_styles'])))
{
COde here
}
Awesome, thanks :) Tested and working