PhpBB -Adsense on pages where you want in overall_header.tpl

Discussions about the Google AdSense System, Use, Integration, experiences ...

Moderator: Moderators

PhpBB -Adsense on pages where you want in overall_header.tpl

Postby 993ti » Fri Oct 06, 2006 10:37 am

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: Select all
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: Select all
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: Select all
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
993ti
 
Posts: 16
Joined: Sat Aug 26, 2006 6:25 pm

Advertisement

Postby dcz » Sat Oct 07, 2006 7:30 am

Yep, handy one thanks ;)
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21424
Joined: Fri Apr 28, 2006 9:03 pm

Postby HB. » Sat Nov 25, 2006 3:51 pm

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.
HB.
PR0
PR0
 
Posts: 62
Joined: Thu Oct 26, 2006 1:26 am

Re: PhpBB -Adsense on pages where you want in overall_header

Postby HB. » Sat Nov 25, 2006 3:55 pm

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}?
HB.
PR0
PR0
 
Posts: 62
Joined: Thu Oct 26, 2006 1:26 am

Postby dcz » Sat Nov 25, 2006 4:18 pm

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 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21424
Joined: Fri Apr 28, 2006 9:03 pm

Postby HB. » Sat Nov 25, 2006 4:49 pm

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.
HB.
PR0
PR0
 
Posts: 62
Joined: Thu Oct 26, 2006 1:26 am

Postby dcz » Sat Nov 25, 2006 4:59 pm

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 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21424
Joined: Fri Apr 28, 2006 9:03 pm

Postby WC » Fri Jul 13, 2007 1:49 pm

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:

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
WC
 
Posts: 2
Joined: Fri Jul 13, 2007 1:40 pm

Postby dcz » Fri Jul 13, 2007 5:31 pm

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:

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 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21424
Joined: Fri Apr 28, 2006 9:03 pm

Postby WC » Fri Jul 13, 2007 10:27 pm

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.
WC
 
Posts: 2
Joined: Fri Jul 13, 2007 1:40 pm

Postby dcz » Thu Jul 19, 2007 9:06 am

You can extend the adds output to all phpBB pages if you like, by repeating this part on other files :
Code: Select all
FIND

define('IN_PHPBB', true);

BEFORE, ADD

$googlead="1";


faq.php, search.php, memberlist.php could be interesting as well. The idea is to avoid them on pages like privmsg.php.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21424
Joined: Fri Apr 28, 2006 9:03 pm

Postby abhishek1711 » Tue Aug 07, 2007 12:29 pm

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 :evil:
abhishek1711
PR0
PR0
 
Posts: 64
Joined: Thu May 03, 2007 6:53 am

Postby SeO » Tue Aug 07, 2007 5:06 pm

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 :lol:
SeO
Admin
Admin
 
Posts: 6334
Joined: Wed Mar 15, 2006 9:41 pm

Postby abhishek1711 » Tue Aug 07, 2007 7:03 pm

yeah ill take the risk then :wink:
abhishek1711
PR0
PR0
 
Posts: 64
Joined: Thu May 03, 2007 6:53 am


Return to Google AdSense

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 2 guests