tansqrx 0 Report post Posted February 4, 2009 This tutorial will explain how to add Google Adsense to phpBB version 3 (http://forums.xisto.com/no_longer_exists/) 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 (https://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://forums.xisto.com/no_longer_exists/) 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://forums.xisto.com/no_longer_exists/ 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 pageI 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 MOD2. Open /styles/subsilver2/theme/stylesheet.css3. 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.css5. 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.html7. Find â<!-- INCLUDE forumlist_body.html -->â8. Place Google Code before â<!-- INCLUDE forumlist_body.html -->â for top of the main page ad placement9. Place Google Code after â<!-- INCLUDE forumlist_body.html -->â for bottom of the main page ad placement10. Save and close /styles/subsilver2/template/index_body.html11. Open /styles/subsilver2/template/viewforum_body.html12. Find â<!-- INCLUDE forumlist_body.html -->â13. Place Google Code before â<!-- INCLUDE forumlist_body.html -->â for top of the forum ad placement14. Save and close /styles/subsilver2/template/viewforum_body.html15. Open /styles/subsilver2/template/viewtopic_body.html16. Find â<!-- BEGIN postrow -->â17. Place Google Code before â<!-- BEGIN postrow -->â for top of the topic ad placement18. Find â<!-- END postrow -->â19. Place â<!-- IF postrow.S_FIRST_ROW -->â Google Code â<!-- ENDIF -->â before â<!-- END postrow -->â for topic ad placement after the first post20. Save and close /styles/subsilver2/template/viewtopic_body.html21. Open /styles/subsilver2/template/search_results.html22. Find â<!-- IF S_SHOW_TOPICS -->â23. Place Google Code before â<!-- IF S_SHOW_TOPICS -->â for top of the search page ad placement24. Save and close /styles/subsilver2/template/search_results.htmlThe 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://forums.xisto.com/no_longer_exists/. Share this post Link to post Share on other sites
kingdomtroy 0 Report post Posted March 2, 2009 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.tkormaplekingdom.splendidtips.com/forum Share this post Link to post Share on other sites
andreip 0 Report post Posted March 15, 2009 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? Share this post Link to post Share on other sites
tansqrx 0 Report post Posted March 16, 2009 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. Share this post Link to post Share on other sites
iGuest 3 Report post Posted February 24, 2010 Great modHowto Add Google Adsense To Phpbb3 Subsilver2 (3.0.4) I followed your instruction step by step and it works great. -reply by john Share this post Link to post Share on other sites