How to add the google adsense code in your forum?

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Ideas Centre
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Fattony
Registered User
Posts: 17
Joined: Sun Dec 03, 2006 11:42 am

Re: How to add the google adsense code in your forum?

Post by Fattony »

Great advice however I only chose to place ads on these pages for now:

viewforum_body
viewtopic_body


I also moved them slightly as I didnt like the 'Title' being above the ad this is how my code looks:

Code: Select all

[color=#40BF40]<script type="text/javascript"><!--
google_ad_client = "pub-977528";
/* 728x90, created 14/06/08 */
google_ad_slot = "9235268";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

<!-- IF S_IS_POSTABLE or S_NO_READ_ACCESS -->
	<div id="pageheader">
		<h2><a class="titles" href="{U_VIEW_FORUM}">{FORUM_NAME}</a></h2>[/color]
I just place the google ad code before the 'Title'. Take a look at how it looks http://www.vidripscript.com/forums
totalgruv
Registered User
Posts: 48
Joined: Tue May 09, 2006 6:34 pm

Re: How to add the google adsense code in your forum?

Post by totalgruv »

great mod looked allover for this and it works great...

my question is... is there any way to get the ads to show up every X number of replies?
User avatar
buyloewen
Registered User
Posts: 43
Joined: Thu Aug 14, 2008 7:12 am
Contact:

Re: How to add the google adsense code in your forum?

Post by buyloewen »

Ok I followed the posts on the very first page refreshed and changed recompile to yes. I still can't my ads to appear what should I do. thx for the help.
User avatar
buyloewen
Registered User
Posts: 43
Joined: Thu Aug 14, 2008 7:12 am
Contact:

Re: How to add the google adsense code in your forum?

Post by buyloewen »

Nevermind I got it working sometimes I take the shortbus to school. thx for your help. oh ya check out my site now that's up www.recsportsleague.com gl everyone.
durtyrok
Registered User
Posts: 31
Joined: Tue Aug 19, 2008 2:42 am
Location: South Carolina USA!
Contact:

Re: How to add the google adsense code in your forum?

Post by durtyrok »

Do you have to add the same ad code to each or could you make a different ad for each time you paste the code? Or is that not needed?
Last edited by durtyrok on Sun Sep 07, 2008 6:38 am, edited 1 time in total.
durtyrok
Registered User
Posts: 31
Joined: Tue Aug 19, 2008 2:42 am
Location: South Carolina USA!
Contact:

Re: How to add the google adsense code in your forum?

Post by durtyrok »

bbrian017 wrote:Okay here's another that will get you really great impressions :)

____________________________________________________________________________________________

Open: posting_layout.html

Find: <!-- IF TOPIC_TITLE -->

Add in new line before: Google ad code

Find: <!-- INCLUDE overall_footer.html -->

Add in new line before: Google add code
the file "posting_layout.html" is in prosilver but not subsilver2. What file would I post this code in for subsilver2? Thanks!
durtyrok
Registered User
Posts: 31
Joined: Tue Aug 19, 2008 2:42 am
Location: South Carolina USA!
Contact:

Re: How to add the google adsense code in your forum?

Post by durtyrok »

I would like to add google ads to the bottom of the "post reply" page. Where would I put the code for this?

Thanks!
manudevil20
Registered User
Posts: 33
Joined: Fri Sep 12, 2008 12:21 am

Re: How to add the google adsense code in your forum?

Post by manudevil20 »

I cant figure out where to put the codes to center the ads and align the forum to the left. Where do i put them.
manudevil20
Registered User
Posts: 33
Joined: Fri Sep 12, 2008 12:21 am

Re: How to add the google adsense code in your forum?

Post by manudevil20 »

Sorry i solved it
glitzyglamgirl
Registered User
Posts: 70
Joined: Tue Oct 25, 2005 7:53 am
Location: wales
Contact:

Re: How to add the google adsense code in your forum?

Post by glitzyglamgirl »

Hi, I have just created my google ads and was wondering how to align them centre without altering the forum layout on a theme based on subsilver2, phpbb3.0.1

Here is what it looks like now www.losties.net/phpbb3

I have the code placed in viewforum_body.html, viewtopic_body.html, and index_body.html

Thanks :)
durtyrok
Registered User
Posts: 31
Joined: Tue Aug 19, 2008 2:42 am
Location: South Carolina USA!
Contact:

Re: How to add the google adsense code in your forum?

Post by durtyrok »

glitzyglamgirl wrote:Hi, I have just created my google ads and was wondering how to align them centre without altering the forum layout on a theme based on subsilver2, phpbb3.0.1

Here is what it looks like now http://www.losties.net/phpbb3

I have the code placed in viewforum_body.html, viewtopic_body.html, and index_body.html

Thanks :)
I think this is what you are looking for. Its on the first page.
bbrian017 wrote:I also want to add another point to this topic. When making your ads centered you must re align the forums after accordingly, NOTE this code will add a "Subsilver border" around your ads. Looks real nice :)

For example,

Code: Select all

<!-- IF not S_HIDE_ADS -->
    <div id="ysfi_ads" style="text-align:center; margin: 10px 0;">
       <div class="<!-- IF SCRIPT_NAME eq "viewtopic" -->navbar<!-- ELSE -->forumbg<!-- ENDIF -->" style="width:750px; margin:0 auto;">
            <div class="inner"><span class="corners-top"><span></span></span>
                <div align="center">

<script type="text/javascript"><!--
google_ad_client = "pub-4639496444672477";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel = "";
google_color_border = "0D96DA";
google_color_bg = "D4E1EC";
google_color_link = "FFFFFF";
google_color_text = "FFFFFF";
google_color_url = "008000";
//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

            <span class="corners-bottom"><span></span></span></div>
        </div>
    </div><div align="left">
    <!-- ENDIF -->
When I centered the ad, the forums also centered

Code: Select all

<div align="center">
so I off set this action by adding this

Code: Select all

<div align="left">
I hope this helps :) This is in the index_body.html
example add.jpg
bottom half of the page also has an add :)
ottom half.jpg
User avatar
buyloewen
Registered User
Posts: 43
Joined: Thu Aug 14, 2008 7:12 am
Contact:

Re: How to add the google adsense code in your forum?

Post by buyloewen »

I was wonder if some could help me out, is there code to place adsense on the left or the right of main forum section. This is one of the best places for adsense to be according to the google hot chart.
durtyrok
Registered User
Posts: 31
Joined: Tue Aug 19, 2008 2:42 am
Location: South Carolina USA!
Contact:

Re: How to add the google adsense code in your forum?

Post by durtyrok »

I have run into a problem. I am removing the google code from my forum so I can add the ad managment mod but I cant seem to get the ad removed from the bottom of the forum. I thought I only added the code to ucp_footer, ucp_header, viewtopic_body and viewforum_body. How do I find out where else I posted the code? my forum is durtyrok. com/messageboard. And I did purge the cache. Thanks!


Nevermind! I found it.
User avatar
buyloewen
Registered User
Posts: 43
Joined: Thu Aug 14, 2008 7:12 am
Contact:

Re: How to add the google adsense code in your forum?

Post by buyloewen »

I answered my own question take a look here if you want to know how to add side bars
http://www.phpbb.com/community/viewtopi ... 4&t=624715
choo
Registered User
Posts: 1
Joined: Mon Dec 22, 2008 4:39 pm

Re: How to add the google adsense code in your forum?

Post by choo »

bbrian017 wrote:Okay there are some files you will have to add code to and I will mention the ones that will generate you the best money for impressions :) Go to your forums directory and select the styles folder, and then prosilver assuming your using prosilver.
I have tried to add Adsense code in the file "viewtopic_body.html" of my forum directory "styles/prosilver /template" but google ads won't show up.

However when I added Adsense code in the file "tpl_prosilver_viewtopic.html.php" of my forum directory "cache", and it works , my google ads is showing up.

Which directory suppose we have to add Adsense code ? Styles or cache folder?
According to Google TOS for adsense, can we allow to add Adsense code in the file "tpl_prosilver_viewtopic.html.php" in cache folder ? ( The ads is working fine in with contents page.)

Anyone can help please?
Locked

Return to “[3.0.x] Support Forum”