Loading...


bookmark - Howto Add Google Adsense To Phpbb3 Subsilver2 (3.0.4)

Howto Add Google Adsense To Phpbb3 Subsilver2 (3.0.4)

 
 Discussion by tansqrx with 4 Replies.
 Last Update: February 24, 2010, 8:50 am
 
bookmark - Howto Add Google Adsense To Phpbb3 Subsilver2 (3.0.4)  
Quickly Post to Howto Add Google Adsense To Phpbb3 Subsilver2 (3.0.4)  w/o signup Share Info about Howto Add Google Adsense To Phpbb3 Subsilver2 (3.0.4)  using Facebook, Twitter etc. email your friend about Howto Add Google Adsense To Phpbb3 Subsilver2 (3.0.4) Print
Reply / Comment New Discussion / Topic Share / Bookmark E-Mail a Friend Print

This tutorial will explain how to add Google Adsense to phpBB version 3 (http://www.phpbb.com/index.php) and specifically to version 3.0.4. Before upgrading to version 3.0.4 I had 3.0.1 installed and I was happily using a mod that I found on the phpBB forums called “Inline Banner Ad” by geocator (www.phpbb.com/community/viewtopic.php?t=306680). I found that upgrading to the latest version significantly changed the way phpBB worked and I was forced to find another solution. My search lead me to “Google Adsense Ads and phpBB3 Howto” (http://save.link.ba/viewtopic.html) but it was only for prosilver and did not work out of the box for subsilver2. Without finding any other sources I modified the code from “Google Adsense Ads and phpBB3 Howto” for subsilver2 and here the result.

Full credit goes to http://save.link.ba/viewtopic.html for most of the work. I never found a way to add ads to the sub-forum page but this will add ads to the following:
• Top and bottom of the main page
• Top of the forum page (not sub-forums of the forums)
• Top of each topic and directly under the first post
• Top of the search page

I also didn’t like the way the original ads were displayed so I created my own formatting and started from scratch. You can either edit the following files using the built-in editor in the Administrator Control Panel or download them via FTP and then re-upload them.

1. Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
2. Open /styles/subsilver2/theme/stylesheet.css
3. Add the following to the bottom of the file
.google_ad {
border: 1px solid #A9B8C2;
background-color: #ECECEC;
}

4. Save and close /styles/subsilver2/theme/stylesheet.css
5. In Notepad or similar text editor paste the following. Make sure that you replace your Google Adsense code with your own. From here own I will refer to this as the Google Code.
<div class="google_ad">
<div align="center">
<script type="text/javascript"><!--
google_ad_client = "pub-xxx";
google_ad_slot = "xxx";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
</div>

6. Open /styles/subsilver2/template/index_body.html
7. Find “<!-- INCLUDE forumlist_body.html -->”
8. Place Google Code before “<!-- INCLUDE forumlist_body.html -->” for top of the main page ad placement
9. Place Google Code after “<!-- INCLUDE forumlist_body.html -->” for bottom of the main page ad placement
10. Save and close /styles/subsilver2/template/index_body.html
11. Open /styles/subsilver2/template/viewforum_body.html
12. Find “<!-- INCLUDE forumlist_body.html -->”
13. Place Google Code before “<!-- INCLUDE forumlist_body.html -->” for top of the forum ad placement
14. Save and close /styles/subsilver2/template/viewforum_body.html
15. Open /styles/subsilver2/template/viewtopic_body.html
16. Find “<!-- BEGIN postrow -->”
17. Place Google Code before “<!-- BEGIN postrow -->” for top of the topic ad placement
18. Find “<!-- END postrow -->”
19. Place “<!-- IF postrow.S_FIRST_ROW -->” Google Code “<!-- ENDIF -->” before “<!-- END postrow -->” for topic ad placement after the first post
20. Save and close /styles/subsilver2/template/viewtopic_body.html
21. Open /styles/subsilver2/template/search_results.html
22. Find “<!-- IF S_SHOW_TOPICS -->”
23. Place Google Code before “<!-- IF S_SHOW_TOPICS -->” for top of the search page ad placement
24. Save and close /styles/subsilver2/template/search_results.html

The results are not as sophisticated as the original mod but I am happy with the results. You can see a working version of this mod at http://ycoderscookbook.com/forums.

   Wed Feb 4, 2009    Reply         

thanks, will try, but I'm using vertigo theme right now for my forum.

Since the theme looks quite different from subsilver as the size is less than 728x90, is there a way to fix it.

The forum is at:
mkforums.tk
or
maplekingdom.splendidtips.com/forum

   Sun Mar 1, 2009    Reply         

Awesome guide mate! I was just looking for this. Do you know if it's possible to put ads of other companies such AdsBrite, Clicksor or BidVertiser instead of Google AdSense too?

   Sun Mar 15, 2009    Reply         


Assuming they use JavaScript or something similar (code you insert into your webpage for an ad at a fixed location) yes you can. Replace what I call the Google Code in the above tutorial with the code supplied by your advertiser. I don’t believe this will work for other types of ads such as keyword highlighting (Kontera). Also, if the ads are the same form factor (roughly the same size and shape) as Google, you shouldn’t have to change the CSS styles or anything else.

   Mon Mar 16, 2009    Reply         

Great modHowto Add Google Adsense To Phpbb3 Subsilver2 (3.0.4)

I followed your instruction step by step and it works great. See the result yourself here

www.Bikefanzone.Co.Cc

-reply by john

 

   Wed Feb 24, 2010    Reply         

Quickly Post to Howto Add Google Adsense To Phpbb3 Subsilver2 (3.0.4)  w/o signup Share Info about Howto Add Google Adsense To Phpbb3 Subsilver2 (3.0.4)  using Facebook, Twitter etc. email your friend about Howto Add Google Adsense To Phpbb3 Subsilver2 (3.0.4) Print
Reply / Comment New Discussion / Topic Share / Bookmark E-Mail a Friend Print

Similar Topics:

Google Adsense Alternative

I was searching through Google for the best alternatives to Google Adsense.. There are a huge no. of Google Adsense publishers whose accounts have been disabled due to some reason or the other. Many are basically disabled because they try to cheat Google adsense script. Google terms are no doubt ver ...more

   22-Mar-2005    Reply         

Google Adsense Tips

Google Adsense Tips If you hear about people achieving high payments per click with AdSense, remember that's only part of the story. You also need lots of page views and a high click-through rate. Here are some ideas on how to achieve those three th ...more

   02-Apr-2005    Reply         

Can I Put Adsense Ads On My Site At...

Hi Everybody, Just a few things, particularly on Adsense. Does this hosting server allow adsense code? My friend has been using adsense for 2 days now and it says he has made $17.38. If you didn't include taxes, would this be t ...more

   20-Apr-2006    Reply         

Psychostats Psychostats tutorial for cs   Psychostats Psychostats tutorial for cs (1) (4) How To Make A Website From Scratch - Starting Your Document   How To Make A Website From Scratch - Starting Your Document