How do I add Google Adsense to a PhpBB 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.
Scam Warning
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Gary Compton
Registered User
Posts: 49
Joined: Sat Jun 25, 2011 11:42 am

How do I add Google Adsense to a PhpBB forum

Post by Gary Compton »

Hi, does the PHpBB forum software have the facility, like VBulletin, to place Google Adsense onto the forums?

Thankyou

User avatar
Mick
Support Team Member
Support Team Member
Posts: 22431
Joined: Fri Aug 29, 2008 9:49 am
Location: Cardiff

Re: How do I add Google Adsense to a PhpBB forum

Post by Mick »

Knowledge Base - Advertisements in phpBB3

Take particular note of the important notice half way down regarding Google ads. Due to the google terms and conditions, the ads should only go in the index_body.html, viewtopic_body.html and viewforum_body.html files. Do not put them in the overall_header or footer.

You need to refresh the template to make the changes show up.
"The more connected we get the more alone we become" - Kyle Broflovski©

Gary Compton
Registered User
Posts: 49
Joined: Sat Jun 25, 2011 11:42 am

Re: How do I add Google Adsense to a PhpBB forum

Post by Gary Compton »

I'm a novice here, how do I access these areas through the admin control panel?

User avatar
KevC
Support Team Member
Support Team Member
Posts: 69899
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: How do I add Google Adsense to a PhpBB forum

Post by KevC »

You don't. You access the files on the server through FTP. Assuming you're not on a free forum host and do actually have access to them.
-:|:- Support Request Template -:|:-
Image
Cheap UK Hosting
"In the land of the blind the little green bloke with no pupils is king - init!"

Gary Compton
Registered User
Posts: 49
Joined: Sat Jun 25, 2011 11:42 am

Re: How do I add Google Adsense to a PhpBB forum

Post by Gary Compton »

Okay cheers. I'm with Hostgator so thats not a prob. If I want to put a Google adsense 728 pixel banner just under the forum name/logo.

Which file do I access and do I just past the adsense code in their? :D

User avatar
KevC
Support Team Member
Support Team Member
Posts: 69899
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: How do I add Google Adsense to a PhpBB forum

Post by KevC »

The highest up the board you can put it without contravening the T&Cs is at the top of the index_body.html file, just after the <!-- INCLUDE overall_header.html --> line.
-:|:- Support Request Template -:|:-
Image
Cheap UK Hosting
"In the land of the blind the little green bloke with no pupils is king - init!"

Gary Compton
Registered User
Posts: 49
Joined: Sat Jun 25, 2011 11:42 am

Re: How do I add Google Adsense to a PhpBB forum

Post by Gary Compton »

Kevin Clark wrote:The highest up the board you can put it without contravening the T&Cs is at the top of the index_body.html file, just after the <!-- INCLUDE overall_header.html --> line.
Which directory is that file in?

User avatar
KevC
Support Team Member
Support Team Member
Posts: 69899
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: How do I add Google Adsense to a PhpBB forum

Post by KevC »

It says in the linked article above.

styles/yourstylename/template
-:|:- Support Request Template -:|:-
Image
Cheap UK Hosting
"In the land of the blind the little green bloke with no pupils is king - init!"

Gary Compton
Registered User
Posts: 49
Joined: Sat Jun 25, 2011 11:42 am

Re: How do I add Google Adsense to a PhpBB forum

Post by Gary Compton »

Okay found the file but cant find what you say. Here is what the file contains:

{LAST_VISIT_DATE}{CURRENT_TIME}
{CURRENT_TIME}
[ {L_MCP} ]

{CURRENT_TIME}

{L_SEARCH_UNANSWERED} • {L_SEARCH_UNREAD} • {L_SEARCH_NEW} • {L_SEARCH_ACTIVE_TOPICS}
{L_MARK_FORUMS_READ}
{L_LOGIN_LOGOUT} • {L_REGISTER}{L_USERNAME}: {L_PASSWORD}: | {L_LOG_ME_IN} {S_LOGIN_REDIRECT}
{L_WHO_IS_ONLINE}

{L_WHO_IS_ONLINE}

{TOTAL_USERS_ONLINE} ({L_ONLINE_EXPLAIN})
{RECORD_USERS}

{LOGGED_IN_USER_LIST}
{L_LEGEND}: {LEGEND}
{L_BIRTHDAYS}

{L_CONGRATULATIONS}: {BIRTHDAY_LIST}{L_NO_BIRTHDAYS}
{L_STATISTICS}

{TOTAL_POSTS} • {TOTAL_TOPICS} • {TOTAL_USERS} • {NEWEST_USER}

User avatar
KevC
Support Team Member
Support Team Member
Posts: 69899
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: How do I add Google Adsense to a PhpBB forum

Post by KevC »

You need to open it in a good text editor like notepad++.

The start of the file should look like this

Code: Select all

<!-- INCLUDE overall_header.html -->

<p class="{S_CONTENT_FLOW_END}<!-- IF S_USER_LOGGED_IN --> rightside<!-- ENDIF -->"><!-- IF S_USER_LOGGED_IN -->{LAST_VISIT_DATE}<!-- ELSE -->{CURRENT_TIME}<!-- ENDIF --></p>
<!-- IF U_MCP --><p>{CURRENT_TIME} <br />[&nbsp;<a href="{U_MCP}">{L_MCP}</a>&nbsp;]</p><!-- ELSEIF S_USER_LOGGED_IN --><p>{CURRENT_TIME}</p><!-- ENDIF -->

<!-- IF S_DISPLAY_SEARCH or (S_USER_LOGGED_IN and not S_IS_BOT) -->
<ul class="linklist">
	<!-- IF S_DISPLAY_SEARCH -->
		<li><a href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a><!-- IF S_LOAD_UNREADS --> &bull; <a href="{U_SEARCH_UNREAD}">{L_SEARCH_UNREAD}</a><!-- ENDIF --><!-- IF S_USER_LOGGED_IN --> &bull; <a href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a><!-- ENDIF --> &bull; <a href="{U_SEARCH_ACTIVE_TOPICS}">{L_SEARCH_ACTIVE_TOPICS}</a></li>
	<!-- ENDIF -->
	<!-- IF not S_IS_BOT and U_MARK_FORUMS --><li class="rightside"><a href="{U_MARK_FORUMS}" accesskey="m">{L_MARK_FORUMS_READ}</a></li><!-- ENDIF -->
</ul>
<!-- ENDIF -->

<!-- INCLUDE forumlist_body.html -->
-:|:- Support Request Template -:|:-
Image
Cheap UK Hosting
"In the land of the blind the little green bloke with no pupils is king - init!"

Gary Compton
Registered User
Posts: 49
Joined: Sat Jun 25, 2011 11:42 am

Re: How do I add Google Adsense to a PhpBB forum

Post by Gary Compton »

Opened it with Front page and you're right its there - hooray!!

So I just paste the adsense code there. Do I need to put it into a table to centralise it?

User avatar
KevC
Support Team Member
Support Team Member
Posts: 69899
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: How do I add Google Adsense to a PhpBB forum

Post by KevC »

Don't use frontpage. It'll mess things up. get notepad++

Paste the ad code in.
If you want to centre it you can use standard html for that.

Then save, upload, go to the admin panel, styles tab > template > refresh.
-:|:- Support Request Template -:|:-
Image
Cheap UK Hosting
"In the land of the blind the little green bloke with no pupils is king - init!"

Gary Compton
Registered User
Posts: 49
Joined: Sat Jun 25, 2011 11:42 am

Re: How do I add Google Adsense to a PhpBB forum

Post by Gary Compton »

Ok thank you so much for your help :D

One last question, whats the standard html to center this (Sorry I'm thick as pig sh**)

User avatar
KevC
Support Team Member
Support Team Member
Posts: 69899
Joined: Fri Jun 04, 2004 10:44 am
Location: Oxford, UK
Contact:

Re: How do I add Google Adsense to a PhpBB forum

Post by KevC »

Code: Select all

<div align = "center">

****google ad code in here ******

</div>
-:|:- Support Request Template -:|:-
Image
Cheap UK Hosting
"In the land of the blind the little green bloke with no pupils is king - init!"

Gary Compton
Registered User
Posts: 49
Joined: Sat Jun 25, 2011 11:42 am

Re: How do I add Google Adsense to a PhpBB forum

Post by Gary Compton »

When you say styles/templates/refresh.

Is that just a normal F5 refesh; as I cant see a refresh link?

Locked

Return to “[3.0.x] Support Forum”