phpBB – Create a Vertical Cell or Pane on the Left Side of the Forum for Google AdSense

»»»phpBB – Create a Vertical Cell or Pane on the Left Side of the Forum for Google AdSense
This step by step guide will add a vertical cell / pane on the left hand side of the phpBB board, which can be used to accommodate a Google AdSense Skyscraper or Wide Skyscraper ads.

Due to Google AdSense’s terms and conditions, the AdSense ads shouldn’t appear on every page. The pages that shouldn’t have any Google AdSense ads includes, but not limited to, such as log-in page, member-lists and search-results pages. Apart from violating Google AdSense’s terms and conditions, you may found that the ads won’t get good results in these pages because there is insufficient content to deliver meaningful ads.

So, the best place to put the Google AdSense ads is on the index page, the forum page, and the topic page.

The layout of these pages is controlled by the following (.tpl) template files:

index_body.tpl – For the index page.
viewforum_body.tpl – For the forum page.
viewtopic_body.tpl – For the topic page.

So for each of these files, a left side vertical cell needs to be added in order to add the Google AdSense code.

These files can be found at the forum web server in this directory:

templates/subSilver

These files are text files. Open the files in any text editor, make the changes, then save them. If you downloaded them to edit them, you will need to upload the modified versions to the same templates/subSilver directory.

Basically, the following changes will add a table with two cells to each page. The left cell will contain the Google AdSense ads. The right cell will contain the forum information.

index_body.tpl

Open index_body.tpl in any text editor.

Locate these lines in the file (roughly lines 12, 13, 14):

<a href=”{U_SEARCH_UNANSWERED}” mce_href=”{U_SEARCH_UNANSWERED}” class=”gensmall”>{L_SEARCH_UNANSWERED}</a></td>
</tr>
</table>

BELOW these lines, insert this code:

<table width=”100%” border=”0″><tr><td valign=”top”>
Google AdSense Code
</td>
<td width=”100%” valign=”top”>

This section of code should now looks like this:

<a href=”{U_SEARCH_UNANSWERED}” mce_href=”{U_SEARCH_UNANSWERED}” class=”gensmall”>{L_SEARCH_UNANSWERED}</a></td>
</tr>
</table>
<table width=”100%” border=”0″><tr><td valign=”top”>
Google AdSense Code
</td>
<td width=”100%” valign=”top”>

Replace the words Google AdSense Code with your actual Google AdSense code.

Locate these lines (near the bottom):

<table cellspacing=”3″ border=”0″ align=”center” cellpadding=”0″>
<tr>
<td width=”20″ align=”center”><img src=”templates/subSilver/images/folder_new_big.gif” mce_src=”templates/subSilver/images/folder_new_big.gif” alt=”{L_NEW_POSTS}”/></td>

ABOVE these lines, insert this code:

</td>
</tr></table>

This section of code should now looks like this:

</td>
</tr></table>
<table cellspacing=”3″ border=”0″ align=”center” cellpadding=”0″>
<tr>
<td width=”20″ align=”center”><img src=”templates/subSilver/images/folder_new_big.gif” mce_src=”templates/subSilver/images/folder_new_big.gif” alt=”{L_NEW_POSTS}”/></td>

viewforum_body.tpl

Open viewforum_body.tpl in any text editor.

Locate this line in the file (roughly line 15):

<table border=”0″ cellpadding=”4″ cellspacing=”1″ width=”100%” class=”forumline”>

ABOVE this line, include this code:

<table width=”100%” border=”0″><tr><td valign=”top”>
Google AdSense Code
</td>
<td width=”100%” valign=”top”>

This section of code should now looks like this:

<table width=”100%” border=”0″><tr><td valign=”top”>
Google AdSense Code
</td>
<td width=”100%” valign=”top”>
<table border=”0″ cellpadding=”4″ cellspacing=”1″ width=”100%” class=”forumline”>

As above, replace the words Google AdSense Code with actual Google AdSense Code.

Locate this line (last line):

</table>

BELOW this line, include this code:

</td>
</tr></table>

This section of code should now look like this:

</table>
</td>
</tr></table>

viewtopic_body.tpl

Open viewtopic_body in any text editor.

Locate this line in the file (possibly line 1):

<table class=”forumline” width=”100%” cellspacing=”1″ cellpadding=”3″ border=”0″>

ABOVE this line, include this code:

<table width=”100%” border=”0″><tr><td valign=”top”>
Google AdSense Code
</td>
<td width=”100%” valign=”top”>

This section of code should now looks like this:

<table width=”100%” border=”0″><tr><td valign=”top”>
Google AdSense Code
</td>
<td width=”100%” valign=”top”>
<table class=”forumline” width=”100%” cellspacing=”1″ cellpadding=”3″ border=”0″>

As above, remember to replace the words Google AdSense Code with the actual Google AdSense code.

Locate this line (last line in the file):

</table>

BELOW this line, include this code:

</td>
</tr></table>

This section of code should now look like this:

</table>
</td>
</tr></table>

Google AdSense Colour Code for Standard Colours of phpBB subSilver Forum

006699 darkish blue-green – for ad border and links.
000000 black – for text.
EFEFEF light grey – for ad background.

The only other issue is in the topic page at resolution 800×600 where the page is a little too wide for the screen. There’s a lot of competition for space there! There’s the Google ads, avatars and poster info, plus the post itself, all going across the page.

The modification with Wide Skycraper Google AdSense ads looks perfect in screen resolution of 1024×768. To accomodate lower screen resolution, it’s better to use narrower Skycraper instead of Wide Skycraper.

By |2016-12-09T08:43:38+00:00December 9th, 2016|Categories: Advertising|Tags: , , |11 Comments

About the Author:

LK is a technology writer for Tech Journey with background of system and network administrator. He has be documenting his experiences in digital and technology world for over 15 years.Connect with LK through Tech Journey on Facebook, Twitter or Google+.