Log in

View Full Version : if condition forumdisplay only


treasureman
01-21-2011, 07:39 PM
I show adsense on all pages by putting the code at the bottom of the navbit template.

I want to exclude showing adsense on forums 23 and 24 on the forumdisplay page ONLY. I still want the ads to show on the showthread pages for forums 23 and 24.

I tried the below code but it excluded the ads not only on forums 23 and 24 forumdisplay page but all showthread pages for forums 23 and 24.

<if condition="!in_array($foruminfo['forumid'], array(23,24)) AND THIS_SCRIPT != 'forumdisplay'">



Any help is appreciated.

kh99
01-21-2011, 08:31 PM
I think you just want OR instead of AND.

treasureman
01-21-2011, 08:51 PM
kh99 thank you so much!

I don't know why I didn't try OR, it just didn't seem to make sense, but it works!

kh99
01-21-2011, 09:27 PM
Yeah, it's kind of backwards to think about the conditions where it *would* display instead of where you don't want it. You could also use:

<if condition="!(in_array($foruminfo['forumid'], array(23,24)) AND THIS_SCRIPT == 'forumdisplay')">


since !(A AND B) = !A OR !B.

treasureman
01-21-2011, 11:29 PM
I don't understand why it works, but it does, thanks again!