PDA

View Full Version : if conditional in plugin for multiple pages


basketmen
09-05-2010, 11:39 PM
Guys, is this already correct if conditional in plugin for multiple pages

if the scripts is

if (in_array(THIS_SCRIPT, array('index', 'showthread', 'forumdisplay')))
{
stuff
}

if the scripts is not

if (!in_array(THIS_SCRIPT, array('index', 'showthread')))
{
stuff
}

thank you before

Lynne
09-05-2010, 11:44 PM
I know the first one is valid. The second one is valid except I have no idea if there are any pages with THIS_SCRIPT defined with those values.

basketmen
09-06-2010, 12:22 AM
I know the first one is valid. The second one is valid except I have no idea if there are any pages with THIS_SCRIPT defined with those values.
ah i am sorry its just for example, fixed the second one with more general values

so now the second one is correct too?

Lynne
09-06-2010, 03:36 AM
Yes, your second one looks correct also.