| :: |
| Author |
Message |
993ti
Joined: 26 Aug 2006 Posts: 16
|
Posted: Fri Oct 06, 2006 10:37 am Post subject: PhpBB -Adsense on pages where you want in overall_header.tpl |
|
|
Placing adsense code in the overall_header.tpl also shows it on pages without content (registration, posting replies etc.)
Here's a handy tip for those who are using one template:
| Code: | OPEN INCLUDES/PAGE_HEADER.PHP
FIND
define('HEADER_INC', TRUE);
AFTER, ADD //Only visible for guests
if ( $userdata['session_logged_in'] && ($googlead=="1") ){
$google_ad = '';
}
if ($googlead=="1") {
$google_ad = '<table class="forumline" width="95%" cellspacing="1" cellpadding="3" border="0">
<tr>
<td class="row1" height="100%" valign="top">
<div align="center">
YOUR ADSENSE CODE
</div>
</td>
</tr>
</table>';
}
FIND
'SITENAME' => $board_config['sitename'],
BEFORE, ADD
'GOOGLE_AD' => $google_ad,
OPEN TEMPLATES/YOURTEMPLATE/OVERALL_HEADER.TPL
FIND
</table></td>
</tr>
</table>
AFTER, ADD
{GOOGLE_AD} |
Now you can add this code on every page where you want the ads to show like in index.php, viewforum.php and viewtopic.php
| Code: | FIND
define('IN_PHPBB', true);
BEFORE, ADD
$googlead="1"; |
The code in page_header.php makes it only visible to guests.
If you want it to also show for logged in users, use this:
| Code: |
AFTER, ADD //Visible for everyone
if ($googlead=="1") {
$google_ad = '<table class="forumline" width="95%" cellspacing="1" cellpadding="3" border="0">
<tr>
<td class="row1" height="100%" valign="top">
<div align="center">
YOUR ADSENSE CODE
</div>
</td>
</tr>
</table>';
} |
I hope it's useful.
You can see it in action on my Aibo forum |
|
|
| Back to top |
|
 |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
|
| Back to top |
|
 |
HB. PR0

Joined: 26 Oct 2006 Posts: 62
|
Posted: Sat Nov 25, 2006 3:51 pm Post subject: Re: PhpBB -Adsense on pages where you want in overall_header.tpl |
|
|
| It appears that it doesn't really matter to Google. Every free forum host places their google Ads in the overall_header and footer, that displays on low ot no content pages, but yet they are not banned from Google. |
|
|
| Back to top |
|
 |
HB. PR0

Joined: 26 Oct 2006 Posts: 62
|
Posted: Sat Nov 25, 2006 3:55 pm Post subject: Re: PhpBB -Adsense on pages where you want in overall_header |
|
|
| 993ti wrote: |
FIND
</table></td>
</tr>
</table>
AFTER, ADD
{GOOGLE_AD}
|
Just a quick question, does {GOOGL_AD} mean insert your google code there, or just leave saying {GOOGLE_AD}? |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
Posted: Sat Nov 25, 2006 4:18 pm Post subject: Re: PhpBB -Adsense on pages where you want in overall_header.tpl |
|
|
That's true many forums do output adds on login pages without any problems with Google, but, this does not mean it's the best thing to do.
The best with AdSense it to use them on pages with good content, in order to obtain related adds that can really interest users. I don't think the one on the login pages are really useful to increase incomes.
{GOOGLE_AD} in the above code stands for the AdSense code that will be parsed in the template, you should leave it as is.
It's in the php file that you need to put your AdSense html code : look for "YOUR ADSENSE CODE".
++ |
_________________ Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________
Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche |
|
| Back to top |
|
 |
HB. PR0

Joined: 26 Oct 2006 Posts: 62
|
Posted: Sat Nov 25, 2006 4:49 pm Post subject: Re: PhpBB -Adsense on pages where you want in overall_header.tpl |
|
|
| dcz wrote: | That's true many forums do output adds on login pages without any problems with Google, but, this does not mean it's the best thing to do.
The best with AdSense it to use them on pages with good content, in order to obtain related adds that can really interest users. I don't think the one on the login pages are really useful to increase incomes.
|
You are very true, I wouldn't advise it. I'm just surprised that Google allows for it. I guess if those sites are making Google a lot of money, then they just brush it aside. |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
Posted: Sat Nov 25, 2006 4:59 pm Post subject: Re: PhpBB -Adsense on pages where you want in overall_header.tpl |
|
|
This and the fact these problematic pages are far from the being the majority in a phpBB forum.
So I guess that's why Google does not bother yet too much about them.
Doing this could be more problematic for a young forum with few pages, but I do myself wait until a web site as grown a bit before I implement AdSense. It's just safer, as the averages will be performed over more events, avoiding the extremes reachable with few visits (like one page loaded some day and one click, eg an 100% and suspicious ratio).
++ |
_________________ Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________
Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche |
|
| Back to top |
|
 |
WC
Joined: 13 Jul 2007 Posts: 2
|
Posted: Fri Jul 13, 2007 1:49 pm Post subject: Re: PhpBB -Adsense on pages where you want in overall_header.tpl |
|
|
I have a question about this "mod" in the intial post. What exactly is it supposed to do? It mentions something about how the Adsense will appear in non-content pages such as the registration pages, posting replies etc. Is this mod supposed to make the Google Ads no appear in these kinds of pages even though it is in the overall_header.tpl?
I have put my leaderboard into the overall_header.tpl for my forum. I
can't see however how else to put it right at the top as this would be
the file to place the code in. But if it is in the overall_header,
then it would automatically appear in the registration page etc. How else can you put it onto the page at the top?
Does this mod get around that?
And could someone clarify what it's supposed to do exactly when it says:
| Quote: | The code in page_header.php makes it only visible to guests.
If you want it to also show for logged in users, use this:
Code: |
What exactly is only appearing to guests or potentially to logged in users?
Any help appreciated.
Thanks |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
Posted: Fri Jul 13, 2007 5:31 pm Post subject: Re: PhpBB -Adsense on pages where you want in overall_header.tpl |
|
|
| WC wrote: | I have a question about this "mod" in the intial post. What exactly is it supposed to do? It mentions something about how the Adsense will appear in non-content pages such as the registration pages, posting replies etc. Is this mod supposed to make the Google Ads no appear in these kinds of pages even though it is in the overall_header.tpl?
I have put my leaderboard into the overall_header.tpl for my forum. I
can't see however how else to put it right at the top as this would be
the file to place the code in. But if it is in the overall_header,
then it would automatically appear in the registration page etc. How else can you put it onto the page at the top?
Does this mod get around that?
And could someone clarify what it's supposed to do exactly when it says:
| Quote: | The code in page_header.php makes it only visible to guests.
If you want it to also show for logged in users, use this:
Code: |
What exactly is only appearing to guests or potentially to logged in users?
Any help appreciated.
Thanks |
Yes this piece of code is supposed to only output adds on content pages, eg index.php, viewtopic.php and viewforum.php. Then it is supposed to only output them for guest, but looking at the code, I'm not this sure.
We'll release a real mod for this sometime
++ |
_________________ Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________
Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche |
|
| Back to top |
|
 |
WC
Joined: 13 Jul 2007 Posts: 2
|
Posted: Fri Jul 13, 2007 10:27 pm Post subject: Re: PhpBB -Adsense on pages where you want in overall_header.tpl |
|
|
| Ok thanks. I installed it on my board and it worked - I was able to display the leaderboard in the overall header only on the index, viewtopic and viewforum pages. I don't know what that bit about visible to guests or registered users is though. It all seems to appear the same whether logged in or not. |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
|
| Back to top |
|
 |
abhishek1711 PR0

Joined: 03 May 2007 Posts: 59
|
Posted: Tue Aug 07, 2007 12:29 pm Post subject: Re: PhpBB -Adsense on pages where you want in overall_header.tpl |
|
|
is this really required. does google actually care to ban publishers coz of this? i have it out in overall_header and it shows in all pages....but thts the way it is for past 4 months
if its serious then id have to implement it or else why take the trouble  |
|
|
| Back to top |
|
 |
SeO Administrateur - Site Admin

Joined: 15 Mar 2006 Posts: 3103
|
Posted: Tue Aug 07, 2007 5:06 pm Post subject: Re: PhpBB -Adsense on pages where you want in overall_header.tpl |
|
|
Well, I personally never heard of anyone being banned from the Google Adsense program for showing adds on pages bots cannot see, this mod is more to create the possibility to prevent from doing so.
The problem, if we really want to find one, is that we all agreed not to talk about their guidelines and documentation. It makes it pretty hard to just talk about it  |
_________________
|
|
| Back to top |
|
 |
abhishek1711 PR0

Joined: 03 May 2007 Posts: 59
|
Posted: Tue Aug 07, 2007 7:03 pm Post subject: Re: PhpBB -Adsense on pages where you want in overall_header.tpl |
|
|
yeah ill take the risk then  |
|
|
| Back to top |
|
 |
|
|