View Full Version : conditionals help (exclude certain forums)
Hi All !
I've been advised by google to remove adsense ads from my adult forum sections (i just just a couple, forum is technology related).
Could you please help me out correcting this codes?
This code stand alone works fine to exclude certain forums
<if condition="!in_array($forumid, array(472,417,474,475,473,476))">
adsense here
</if>
How about this conditionals, how to add the above code to exclude the same forums?
<if condition="THIS_SCRIPT == 'showthread' AND !$GLOBALS['FIRSTPOSTID'] AND $bbuserinfo['usergroupid'] == '1, 3' AND (!$show[member])">
And for last, how to add the exclude conditionals here also:
<if condition="THIS_SCRIPT == 'showthread' AND !$GLOBALS['FIRSTPOSTID'] AND ($show[member])">
Thank you
Lynne
01-10-2010, 06:09 PM
I'm not sure what you are asking. You should be able to add the condition from your first code block into the conditions in the other two code boxes. Is it not working?
First sorry if i'm not explaining OK, english is my second language.
No, they are not working. They are not excluding ads from those forumsID.
But maybe i'm doing something wrong and not putting the conditional code in the right way.
I've tried in different ways:
<if condition="!in_array($forumid, array(472,417,474,475,473,476))">
<if condition="THIS_SCRIPT == 'showthread' AND !$GLOBALS['FIRSTPOSTID'] AND $bbuserinfo['usergroupid'] == '1, 3' AND (!$show[member])">
adsense code here
</if>
</if>
and
<if condition="THIS_SCRIPT == 'showthread' AND !$GLOBALS['FIRSTPOSTID'] AND $bbuserinfo['usergroupid'] == '1, 3' AND (!$show[member]) AND !$foruminfo['forumid'] == '472, 417, 474, 475, 473, 476'">
adsense code here
</if>
I'm trying also to make this work with vb ad management mod here: https://vborg.vbsupport.ru/showthread.php?p=1952139#post1952139
<if condition="$forum['forumid'] != '472 , 417 , 474 , 475 , 473, 476'">
<div align="left">$template_hook[navbar_below]</div>
</if>
nothing from this is excluding ads from those forumID ...
Lynne
01-11-2010, 03:27 AM
I'm not sure why the first code box doesn't work as it looks like it should. But, you can try this which combines the two:
<if condition="!in_array($forumid, array(472,417,474,475,473,476)) AND (THIS_SCRIPT == 'showthread' AND !$GLOBALS['FIRSTPOSTID'] AND $bbuserinfo['usergroupid'] == '1, 3' AND (!$show[member]))">
adsense code here
</if>
You may want to try $threadinfo['forumid'] instead of $forumid if it still isn't working.
MuhammadC
03-30-2010, 06:09 PM
I would do it with custom forum styles... and just remove the adsense tag from those styles.
struff
12-15-2011, 04:55 AM
I would do it with custom forum styles... and just remove the adsense tag from those styles.
Just stumbled upon this. Has this worked for people? Think this would work in vB4 too?
I don't have much experience in custom styles. In theory I should just be able to pick the style I want to use, search the templates for "adsense", and remove those instances, right?
Thanks.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.