View Full Version : VB Condition to show Ads in certain forums only
popular
10-28-2011, 11:48 PM
I'm trying to disable ads in certain forum sections, I tried this
<vb:if condition="$forum[forumid] != 42">
ad code
</vb:if>
where 42 is the forum section I don't want ads to show, this doesn't seem to work. anyone know why?
$forum[forumid] might not be the right variable to check. It depends on what template you're putting the code in - assuming you are putting it in a template. If you're putting it in the ad html, that's probably why it isn't working. Edit: that's wrong - you *can* put conditionals in the ad code.
popular
10-29-2011, 12:13 AM
I've tried putting it in several templates some that were created by mod and default templates.
SHOWTHREAD
ad_global_above_footer
postbit_legacy_ads_after_firstpost
I tried all the same condition in all three templates and it doesn't seem to work. What other variables could I use to get this to work?
Thanks!
Actually I just noticed this in the "Similar Threads" below: https://vborg.vbsupport.ru/showthread.php?t=250513
So that might help you. It also seems to say that you *can* put it in the ad code, so maybe I'm wrong about that (I'll check the code when I get a chance).
Edit: no need to check the code, it says right on the ad editing page that conditionals *are* allowed. So, try the one at the link above.
popular
10-29-2011, 01:58 AM
thanks kh99, worked :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.