Log in

View Full Version : Displaying Adsense ad's only in specific forums


tutusinghsohi
03-30-2007, 02:10 AM
well i have adult contents on my board...
and i dont want to get kicked out of adsense because i was showing ad's in the adult section..
so is there any way i can select which forums the ad's should be shown?

thanks..

Reeve of shinra
03-30-2007, 02:26 AM
<if condition="$forumid = in_array(12,14,16)">

That should be it or very close.

http://www.vbulletin.com/docs/html/ and search for template conditionals

tobybird
03-30-2007, 10:14 AM
I had a similar question at one point and it was suggest I use this format:

<if condition="in_array($GLOBALS[forumid], array(1,2,3,5))">
<tr>content</tr>
</if>

It's worked well so far.

tutusinghsohi
03-30-2007, 07:23 PM
I had a similar question at one point and it was suggest I use this format:

<if condition="in_array($GLOBALS[forumid], array(1,2,3,5))">
<tr>content</tr>
</if>

It's worked well so far.

so do you guys want me to enter this code...

<if condition="in_array($GLOBALS[forumid], array(1,2,3,5))">
<tr>Adsense Code</tr>
</if>
but where?
and do i put in the adsense code in the "content" place?

sorry for these questions, dont know anything about this :(

Reeve of shinra
03-30-2007, 10:26 PM
Yes, ad your asense code where he types in content.

Goto your admincp, styles and templates - edit the style you are using. You will need to edit the template where you want the ad to show but I recommend the bottom of the navbar.

tutusinghsohi
04-03-2007, 03:40 PM
and how do i make it to display in every where else expect the adult area..
i mean the control panel, forum home, profile page, advanced reply area, calander, etc..

Staxed
04-03-2007, 06:43 PM
those numbers... 1, 2, 3, 4, 5, etc...should be whatever the forumids of your non-adult forums are...that will make the ads show in those forums and no other ones...

tobybird
04-03-2007, 07:04 PM
<if condition="$forumid = in_array(12,14,16)">




<if condition="in_array($GLOBALS[forumid], array(1,2,3,5))">




Which of these is correct? I'm wondering if I'm doing it incorrectly. Thanks!

Smoothie
04-04-2007, 02:23 AM
<if condition="!in_array($forum[forumid], array(xx,xx))">
ad content
</if>

Since I run ads in all but 2 forums, I use this conditional to show ads in all forums except the ones I add. So, xx,xx would be the forums you don't want ads to show in.

tutusinghsohi
04-04-2007, 04:03 PM
<if condition="!in_array($forum[forumid], array(xx,xx))">
ad content
</if>

Since I run ads in all but 2 forums, I use this conditional to show ads in all forums except the ones I add. So, xx,xx would be the forums you don't want ads to show in.

thanks dude...
this is much easier than typing in all the forums where i want the ad's to be shown..

but do the ad's show in the forum home, cp, p.m., profile, etc pages?

Smoothie
04-05-2007, 01:48 AM
thanks dude...
this is much easier than typing in all the forums where i want the ad's to be shown..

but do the ad's show in the forum home, cp, p.m., profile, etc pages?You need to add to that condition to only show ads on forum home (index)/forumdisplay and showthread, otherwise the ads will show on all pages.

2 FN LOW
04-10-2007, 02:54 AM
<if condition="in_array($GLOBALS[forumid], array(1,2,3,5))">
<tr>content</tr>
</if>



Im using this code and its working pretty well but i have lost my adds on the main forum page that shows all the sections, as well as the profile page, private message page and etc etc...

could anybody tell me how to change that please?

2 FN LOW
04-13-2007, 08:38 PM
anybody?