PDA

View Full Version : How to exclude multiple forums/threads using if condition?


profanitytalker
01-30-2010, 10:35 PM
Does anyone here know how to exclude mulitiple forums/threads?

I am trying to place ads on all forums except certain forums. I know how to exclude each forum for the code to show but I don't know how to include all but certain forums...


Example of the code to exclude all but certain forums...

For Forums...
<if condition="in_array($forumid, array(5,7,6,8,9,12,10,11,14,16,13,15,18,19,20,17,6 6))">

For threads..
<if condition="in_array($thread['forumid'], array(
5,7,6,8,9,12,10,11,14,16,13,15,18,19,20,17,66
))">





What I need though is to include the code in all forums and threads except for certain forums/threads. Can anyone give me the code? I have been trying real hard to try to find the code but to no avail. Please help. Thank you in advance.:D

kh99
01-31-2010, 11:47 AM
I think you just want to negate your condition using "!",

<if condition="!in_array($thread['forumid'], array(5,7,6,8,9,12,10,11,14,16,13,15,18,19,20,17,6 6
))">

should include code for any forum not in the given array.

profanitytalker
02-03-2010, 04:41 PM
Thank you kh99. It worked. :)