[Tutorial] Google Adsense Mod for Phpbb3 RC7

Discussion forum for MOD Writers regarding MOD Development.
Locked
louiedave
Registered User
Posts: 3
Joined: Sun Nov 25, 2007 6:09 am

[Tutorial] Google Adsense Mod for Phpbb3 RC7

Post by louiedave »

This Google Adsense Mod Allows you to display Google Adsense on Phpbb3 RC7. I Use Black Pearl Theme but this will also work on other themes, but you must know where to place it, all you have to do is just edit the following files. Google Adsense Will Appear at Index, forum and topic. see sample at my forum/site LCTrainerUSA.Phpnet.Us
Three (3) Files to be Modified.
forumlist_body.html
viewforum_body.html
viewtopic_body.html

First of to be modified is forumlist_body.html
Find

Code: Select all

<div class="tbl-f-l"><div class="tbl-f-r"><div class="tbl-f-c">&nbsp;</div></div></div></div></div>
Add your Google Adsense Code After it. Adsense Will Show Below in every Forum on Index or Default Page.


"Sample code"

Code: Select all

<div class="tbl-f-l"><div class="tbl-f-r"><div class="tbl-f-c">&nbsp;</div></div></div></div></div>
<center>
<script type="text/javascript"><!--
google_ad_client = "pub-0232854482370277";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel = "";
google_color_border = "111111";
google_color_bg = "111111";
google_color_link = "FFCC33";
google_color_text = "C0C0C0";
google_color_url = "C0C0C0";
//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</center>
	<br />
Second File To Be Edited viewforum_body.html
I will going to show you how to display it on the Forum title and after forum title list.
for clarification you may refer to my site above. feel free to navigate my site.

This will display below the forum title.
Find this procedure after that procedure add your Google Code

Code: Select all

<!-- IF S_IS_POSTABLE or S_NO_READ_ACCESS -->
	<div id="pageheader">
		<h2><a class="titles" href="{U_VIEW_FORUM}">{FORUM_NAME}</a></h2>

		<!-- IF MODERATORS -->
			<p class="moderators"><!-- IF S_SINGLE_MODERATOR -->{L_MODERATOR}<!-- ELSE -->{L_MODERATORS}<!-- ENDIF -->: {MODERATORS}</p>
		<!-- ENDIF -->

		<!-- IF U_MCP -->
			<p class="linkmcp">[ <a href="{U_MCP}">{L_MCP}</a> ]</p>
		<!-- ENDIF -->
	</div>

	<br clear="all" /><br />
<!-- ENDIF -->
Sample code

Code: Select all

<!-- IF S_IS_POSTABLE or S_NO_READ_ACCESS -->
	<div id="pageheader">
		<h2><a class="titles" href="{U_VIEW_FORUM}">{FORUM_NAME}</a></h2>

		<!-- IF MODERATORS -->
			<p class="moderators"><!-- IF S_SINGLE_MODERATOR -->{L_MODERATOR}<!-- ELSE -->{L_MODERATORS}<!-- ENDIF -->: {MODERATORS}</p>
		<!-- ENDIF -->

		<!-- IF U_MCP -->
			<p class="linkmcp">[ <a href="{U_MCP}">{L_MCP}</a> ]</p>
		<!-- ENDIF -->
	</div>

	<br clear="all" /><br />
<!-- ENDIF -->

<center>
<script type="text/javascript"><!--
google_ad_client = "pub-0232854482370277";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel = "";
google_color_border = "111111";
google_color_bg = "111111";
google_color_link = "FFCC33";
google_color_text = "C0C0C0";
google_color_url = "C0C0C0";
//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</center>
This will appear after forum topic list
find

Code: Select all

<!-- INCLUDE breadcrumbs.html -->
add your AdSense before it

Sample Code

Code: Select all

<center>
<script type="text/javascript"><!--
google_ad_client = "pub-0232854482370277";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel = "";
google_color_border = "111111";
google_color_bg = "111111";
google_color_link = "FFCC33";
google_color_text = "C0C0C0";
google_color_url = "C0C0C0";
//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</center>
<center>
<script type="text/javascript"><!--
google_ad_client = "pub-0232854482370277";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel = "";
google_color_border = "111111";
google_color_bg = "111111";
google_color_link = "FFCC33";
google_color_text = "C0C0C0";
google_color_url = "C0C0C0";
//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</center>
<!-- INCLUDE breadcrumbs.html -->
Third and last to be mod is viewtopic_body.html
Find this procedure and add AdSense after it

Code: Select all

<!-- IF MODERATORS -->
	<p class="moderators"><!-- IF S_SINGLE_MODERATOR -->{L_MODERATOR}<!-- ELSE -->{L_MODERATORS}<!-- ENDIF -->: {MODERATORS}</p>
<!-- ENDIF -->
<!-- IF U_MCP -->
	<p class="linkmcp">[ <a href="{U_MCP}">{L_MCP}</a> ]</p>
<!-- ENDIF -->

</div>

<br clear="all" /><br />

Sample code

Code: Select all

<!-- IF MODERATORS -->
	<p class="moderators"><!-- IF S_SINGLE_MODERATOR -->{L_MODERATOR}<!-- ELSE -->{L_MODERATORS}<!-- ENDIF -->: {MODERATORS}</p>
<!-- ENDIF -->
<!-- IF U_MCP -->
	<p class="linkmcp">[ <a href="{U_MCP}">{L_MCP}</a> ]</p>
<!-- ENDIF -->

</div>

<br clear="all" /><br />

<center>
<script type="text/javascript"><!--
google_ad_client = "pub-0232854482370277";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel = "";
google_color_border = "111111";
google_color_bg = "111111";
google_color_link = "FFCC33";
google_color_text = "C0C0C0";
google_color_url = "C0C0C0";
//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</center>
This will appear after topic list
find

Code: Select all

<!-- INCLUDE breadcrumbs.html -->
add your AdSense before it

Sample Code

Code: Select all

<center>
<script type="text/javascript"><!--
google_ad_client = "pub-0232854482370277";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel = "";
google_color_border = "111111";
google_color_bg = "111111";
google_color_link = "FFCC33";
google_color_text = "C0C0C0";
google_color_url = "C0C0C0";
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</center>
<center>
<script type="text/javascript"><!--
google_ad_client = "pub-0232854482370277";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel = "";
google_color_border = "111111";
google_color_bg = "111111";
google_color_link = "FFCC33";
google_color_text = "C0C0C0";
google_color_url = "C0C0C0";
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</center>
<!-- INCLUDE breadcrumbs.html -->
I hope This Mod Help You. I have also successfully mod to show google on login page and other pages but not now coz I'm so tired next time when i will make tutorial i will include it.
Author = Louiedave
Last edited by A_Jelly_Doughnut on Sun Nov 25, 2007 3:53 pm, edited 1 time in total.
Reason: Make use of code BBCode
itsacraig
Registered User
Posts: 8
Joined: Sun Feb 07, 2010 1:32 pm

Re: [Tutorial] Google Adsense Mod for Phpbb3 RC7

Post by itsacraig »

I have just modified the 3 files but I am not seeing anything displayed and I dont know why. Do you know what the problem might be?
User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 51889
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: [Tutorial] Google Adsense Mod for Phpbb3 RC7

Post by stevemaury »

Purge the cache.
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)
ChaosBringer
Registered User
Posts: 412
Joined: Mon Apr 19, 2004 11:30 pm
Contact:

Re: [Tutorial] Google Adsense Mod for Phpbb3 RC7

Post by ChaosBringer »

And refresh the templates too.

01000001 01101100 01101100 00100000 01111001 01101111 01110101 01110010 00100000 01100010 01101001 01101110 01100001 01110010 01111001 00100000 01100001 01110010 01100101 00100000 01100010 01100101 01101100 01101111 01101110 01100111 00100000 01110100 01101111 00100000 01110101 01110011 00100001
diveguy
Registered User
Posts: 58
Joined: Wed Sep 01, 2010 4:38 am

Re: [Tutorial] Google Adsense Mod for Phpbb3 RC7

Post by diveguy »

Hi,

I have all the code in but anything within the script tags does not show.

I added some text outside the script tags but within the div and it shows just fine.

Is there something I need to turn on?

Thanks,
Diveguy
User avatar
_Vinny_
Style Customisations
Style Customisations
Posts: 8799
Joined: Tue Aug 11, 2009 12:45 am
Location: Brazil
Name: Marcus Vinicius
Contact:

Re: [Tutorial] Google Adsense Mod for Phpbb3 RC7

Post by _Vinny_ »

diveguy wrote:Hi,

I have all the code in but anything within the script tags does not show.

I added some text outside the script tags but within the div and it shows just fine.

Is there something I need to turn on?

Thanks,
Diveguy
Read:
Advertisements in phpBB3
Can't see changes editing styles? Changes have disappeared?

And wait for the Google system to display ads, usually 10 minutes.
diveguy
Registered User
Posts: 58
Joined: Wed Sep 01, 2010 4:38 am

Re: [Tutorial] Google Adsense Mod for Phpbb3 RC7

Post by diveguy »

Thanks. I am using the recommended post.

I figured out that the problem was that my adsense option wasn't created correctly and that was the problem.

But now I find out that Google only allows 3 ads per page so if I put it after the posts and if there is more than 3 posts there is a blank section between the rest of the posts where ads would go if more than 3 were allowed.

I'm trying to figure out how to turn it off after 3.

Thanks again for your help.
lazko
Registered User
Posts: 3
Joined: Fri Dec 23, 2011 5:34 pm

Re: [Tutorial] Google Adsense Mod for Phpbb3 RC7

Post by lazko »

Thank you all for this guide! I used it, refreshed the template & purged the cache and it works nice.
Thanks!
8-)
Thumper1337x
Registered User
Posts: 63
Joined: Tue Sep 27, 2011 6:46 pm

Re: [Tutorial] Google Adsense Mod for Phpbb3 RC7

Post by Thumper1337x »

Thanks for share :)
Regards,
Thumper
Locked

Return to “[3.0.x] MOD Writers Discussion”