View Full Version : How to insert adsense code in the serenity style pages ?
Hi Guys,
I am using the serenity style on my phpBB3 RC1 board and I must say it is the best style I have seen so far. Its very classy and fresh.
I need to insert google adsense code in some pages of this style, like overall_header, overall_footer, viewtopics, index_body and view_forum for now. Can you please help me with how exactly it can be added to these pages. I have tried some ways I found on the web, on star trek forum and phpbb forum etc., which were meant for the Prosilver style but they don't work with serenity. The ads dont show up.
Has anyone used adsense with serenity ? Can you please share how did you do it ?
BTW, you can check out my board here, www.dogmatingforum.com , I played with the colors in ColorizeIt and its come out pretty good.
Thanks a lot.
Sean.
CyberAlien
31 May 07, 16:07
Put it in index_body.html, viewforum_body.html and viewtopic_body.html after <!-- INCLUDE forumlist_body.html -->
Thanks buddy,
I believe its not advisable (for adsense policies) to put it in overall_header and overall_footer , right ??
Should I insert the code with a table or just the bare code after this line ??
Thanks,
Sean
will_hough
31 May 07, 16:32
Have a look at this very simple MOD -
http://www.phpbb.com/community/viewtopic.php?f=70&t=545929
Thanks buddy,
I believe its not advisable (for adsense policies) to put it in overall_header and overall_footer , right ??
Should I insert the code with a table or just the bare code after this line ??
Thanks,
Sean
Bare code should work fine. And yes you are right, don't put it in you overall_header because it will display on pages that break Google TOS. Just put it on the 3 pages that CA said.
Will,
This mod looks great.
Tell me, I am using serenity. Does there have to be 1 file (horizontal_container.html) or 2 files (horizontal_ad.html too) in the template folder ?
The mod mentions ad file but contains only container file.
Do i just change horizontal_ad.html to horizontal_container.html in the code ?
Thanks,
Sean.
will_hough
31 May 07, 19:16
Oops, I forgot to change that. I'll update that now.
You just need 'horizontal_container.html'
Then add <!-- INCLUDE horizontal_container.html -->
where ever you want it to display.
Here is a snip of my index_body.html for AcidTech.
<!-- IF U_MCP -->
<div id="pageheader">
<p class="linkmcp">[ <a href="{U_MCP}">{L_MCP}</a> ]</p>
</div>
<br clear="all" /><br />
<!-- ENDIF -->
<!-- INCLUDE forumlist_body.html -->
<br clear="all" />
<!-- INCLUDE horizontal_container.html -->
<span class="gensmall"><a href="{U_DELETE_COOKIES}">{L_DELETE_COOKIES}</a> | <a href="{U_TEAM}">{L_THE_TEAM}</a></span><br />
<br clear="all" />
<!-- INCLUDE breadcrumbs.html -->
<!-- IF S_DISPLAY_ONLINE_LIST -->
<br clear="all" />
You can see the container displayed here at the bottom above 'Who Is Online' - http://www.hydraheadboard.com/forum
Will,
my index_body.html looks exaclty like your snip, but I dont see nothing on my page when I load my index page.
also in the container page, {$CA_CAP_START}my title{$CA_CAP_END} , is this ok ?
sean.
will_hough
31 May 07, 19:42
MOD file has been updated.
Go to your ACP and click on the button next to: 'Purge the cache'
Then reload your page.
CA,
I inserted the code in index_body and viewforum_body (couldnt find <!-- INCLUDE forumlist_body.html --> in the viewtopic_body page) but yet the ads dont show up on my page. Any idea what am I missing ?
Thanks,
Sean.
will_hough
31 May 07, 19:44
also in the container page, {$CA_CAP_START}my title{$CA_CAP_END} , is this ok ?
Yes, thats correct.
I did that already . . .
still no ads . . .
guys,
can you see any ads / horizontal box on my page ?? maybe my PC is delivering cache . . . http://www.dogmatingforum.com/forum/phpBB3/
Sean.
will_hough
31 May 07, 19:53
guys,
can you see any ads / horizontal box on my page ?? maybe my PC is delivering cache . . . http://www.dogmatingforum.com/forum/phpBB3/
Sean.
No, I don't see it,
Try going in to ACP, Styles.
Under - Style components click on Templates.
Next to serenity click on Refresh, then Yes, the reload your page.
If your editing templates, and you want to disable your cache for a bit. In the General tab, in the left menu click 'Load settings' then next to 'Recompile stale style components:' select no then submit.
There is no need for a MOD :)
Just edit those templates as previously mentined by pasting Google Adsense code in there.
Will,
That didnt help. Still nothing on my index page. I have just changed my index_body file yet. Do you think I should try with the other 2 ? viewtopic and viewforum , will they be treated any different ?
Also have a look at what my code looks like . . .
<br clear="all" /><br />
<!-- ENDIF -->
<!-- INCLUDE forumlist_body.html -->
<br clear="all" />
<!-- INCLUDE horizontal_container.html -->
<span class="gensmall"><a href="{U_DELETE_COOKIES}">{L_DELETE_COOKIES}</a> | <a href="{U_TEAM}">{L_THE_TEAM}</a></span><br />
<br clear="all" />
<!-- INCLUDE breadcrumbs.html -->
<!-- IF S_DISPLAY_ONLINE_LIST -->
<br clear="all" />
<table class="tablebg" width="100%" cellspacing="{$CA_SPACING}">
{$CA_CAP_START}<a href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a>{$CA_CAP_END}
what the hell could be wrong here ??
Sean.
CyberAlien
31 May 07, 20:44
Why use mod for simple adsense code when it requires much more edits than adding adsense directly to html files?
because adding adsense code directly to html files somehow is not working for me CA, I dont know why but nothing ever shows up on my pages.
I inserted the code in index_body and viewforum_body (couldnt find <!-- INCLUDE forumlist_body.html --> in the viewtopic_body page) but yet the ads dont show up on my page. Any idea what am I missing ?
Regards,
Sean.
PS: I refreshed and purged the cache . . .
will_hough
31 May 07, 21:02
Make sure you are Overwriting the files when you upload them.
Edit Files.
Upload them overwriting template file.
Clear cache.
If it fails, go into ACP > Styles > Templates
Browse to the file you uploaded and check code in ACP to make sure new code you added is in there. if it is then manually press submit on that file to clear cache for that file, otherwise your FTP client is not overwriting files.
DooBDee,
Finally, after 2 days of head scratching and changing trying replacing adding deleting all templates, all combinations, all positions, all codes . . . it worked . . . when I "Browsed to the file I uploaded and checked the code in ACP to make sure new code I added is in there. if it is then manually press submit on that file to clear cache for that file . . . "
Surprisingly, 'Purge cache' and 'Template' -> 'refresh' dont seem to work the way this does . . .
Thanks a million . . . does it have to be so bloody complicated ??
I was trying all the ideas I got all over the web for 2 days and I guess if I knew that I should have done the above, maybe they all would have worked . . .
Also i would like to mention that this mod by WILL is really good looking . . . not only does it look cool, it also very clearly says 'these are ads' which is ethically good . . .
Thanks a lot . . . Will, DooBDee and CyberAlien . . .
Regards,
Sean.
will_hough
31 May 07, 21:31
Looks good man.
As far as the questions by DooBDee and CyberAlien about "why you want the MOD and not just add the code"
Because people like the way the container looks around the ad, makes it look like 'it's supposed to be there' You guys make a nice style and people like the looks.
Oh, the container looks classy man . . .
The same box, the border . . . its much much better than just a plain adsense code anyday . . .
It looks specially created for the space . . .
It rocks Will . . . good work.
Regards,
Sean.
greek_manager
16 Oct 07, 01:07
May I ask why you suggest that putting the adsense code in overall_header would violates Google TOS?
CyberAlien
16 Oct 07, 01:43
Because if you put it in overall_header it will be shown on all pages. Adsense ToS clearly state that ads should not be displayed on error pages, registration pages, etc... which all use overall_header in phpBB.
vBulletin® v3.6.4, Copyright ©2000-2008, Jelsoft Enterprises Ltd.