View Full Version : Put Google AdSense in your forums
Dream
07-06-2005, 10:00 PM
Kinda interesting info to share.
The AdSense TOS says you can't put ads in pages that are exclusively asking input from the user, which means in vBulletin creating a thread page, replying or editing a post.
This code will put your ads between the navbar and forum/thread listing. Edit your "navbar" template, and after
<!-- / nav buttons bar -->
add
<br />
<if condition="THIS_SCRIPT != 'newthread' AND THIS_SCRIPT != 'newreply' AND THIS_SCRIPT != 'editpost' AND THIS_SCRIPT != 'search' AND THIS_SCRIPT != 'login' AND THIS_SCRIPT != 'register'">
<!-- Google AdSense -->
YOUR_ADSENSE_CODE_HERE
<!-- / Google AdSense -->
</if>
not sure about other locations, hope that helps.
updated added login and search and register
Trickyphillips
07-07-2005, 04:09 AM
Can't forget login.php
<if condition="THIS_SCRIPT != 'newthread' AND THIS_SCRIPT !='newreply' AND THIS_SCRIPT != 'editpost' AND THIS_SCRIPT != 'login'">
GoTTi
07-07-2005, 05:14 AM
wait....
adsense cant be placed on newthread and quickreply pages? is that what your telling me?
Biker_GA
07-07-2005, 05:33 AM
Looks like it..
No Google ad may be placed on any non-content-based pages. This includes error, login, registration, "thank you" or welcome pages.
You may get away with it on a quickreply, but newthread would definitely be in violation of the ToS.
Actually it also can't be on regiser and who's online. I think member's lists too but not sure on that one.
southernlady
07-14-2005, 06:25 PM
Have you tested the drop down/thread tools menu after adding this...in partucular anything that goes over 10 replies? I've discovered MAJOR issues with AJAX and anything that goes on the nav bar. I would love to try this but not if it is going to mess with the nav bar again. BTDT. Liz
Have you tested the drop down/thread tools menu after adding this...in partucular anything that goes over 10 replies? I've discovered MAJOR issues with AJAX and anything that goes on the nav bar. I would love to try this but not if it is going to mess with the nav bar again. BTDT. Liz
Liz, just stick it at the very very end of the template, after all the popup stuff. It will be cool. :)
(I would surround the google code with a <div align="center"> though. Makes it look nicer.)
Chris_D
07-22-2005, 12:39 PM
Looks like it..
You may get away with it on a quickreply, but newthread would definitely be in violation of the ToS.
Whoops.
thuffner
11-21-2005, 07:04 AM
What about the whole User CP? Isn't that asking for user input as well?
VBUsers
11-25-2005, 08:47 PM
if i want to put this right next to the main banner on the site how can i do this? what template do i edit and where do i put the code?
VBUsers
12-01-2005, 07:40 PM
if i want to put this right next to the main banner on the site how can i do this? what template do i edit and where do i put the code?
bump please
croportal
12-16-2005, 07:54 PM
can ise the demo of this
domregchief
05-15-2006, 12:01 PM
I have expanded it further in the if statement.. is there a better/optimized way to do this ?
<if condition="THIS_SCRIPT != 'newthread' AND THIS_SCRIPT != 'newreply' AND THIS_SCRIPT != 'editpost' AND THIS_SCRIPT != 'search' AND THIS_SCRIPT != 'login' AND THIS_SCRIPT != 'register' AND THIS_SCRIPT != 'memberlist' AND THIS_SCRIPT != 'calendar' AND THIS_SCRIPT != 'sendmessage' AND THIS_SCRIPT != 'faq' AND THIS_SCRIPT != 'usercp' AND THIS_SCRIPT != 'profile' AND THIS_SCRIPT != 'private' AND THIS_SCRIPT != 'subscription' AND THIS_SCRIPT != 'private' AND THIS_SCRIPT != 'online'">
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.