Skip to content
Home > Other > This is how to add a Google Adsense skyscraper down the left

This is how to add a Google Adsense skyscraper down the left

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #191647
    imFiles
    Member

    How to – Step by step instructions for phpBB 2.0.8 subSilver

    This is how to add a Google Adsense skyscraper down the left-hand side of your board.

    Due to Google’s conditions, you don’t want ads appearing on every page, such as log-in pages, member-lists and search-results pages.

    Apart from anything else, you would not get good results here because there is insufficient content to deliver meaningful ads.

    The best place to put them is on the index page, the forum page, and the topic page.

    The layout of these pages is controlled by (.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 you need to add your Google code into each of these files.

    You will find these files in your forum webspace in this directory:

    templates/subSilver

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

    Basically, what we are going to do is add a table with two cells to each page. The left cell will contain your Google ads. The right cell will contain the forum information.

    ##########
    index_body.tpl
    ##########

    Open this file in your text editor.

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

    {L_SEARCH_UNANSWERED}

    BELOW these lines, include this code:

    google code

    This section of code should now look like this:

    {L_SEARCH_UNANSWERED}

    google code

    Replace the words “google code” with your actual Google code.

    Here is an example of this section of code including my own Google code:

    {L_SEARCH_UNANSWERED}



    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">

    Locate these lines (near the bottom):

    ABOVE these lines, include this code:

    This section of code should now look like this:

    Finished.

    ##############
    viewforum_body.tpl
    ##############

    Open this file in your text editor.

    Locate this line in the file (may be line 15):

    ABOVE this line, include this code:

    google code

    This section of code should now look like this:

    google code

    As before, just replace the words “google code” with your actual Google code.

    Locate this line (last line in the file):

    BELOW this line, include this code:

    This section of code should now look like this:

    Finished.

    #############
    viewtopic_body.tpl
    #############

    Open this file in your text editor.

    Locate this line in the file (may be line 1Cool:

    ABOVE this line, include this code:

    google code

    This section of code should now look like this:

    google code

    As before, just replace the words “google code” with your actual Google code.

    Locate this line (last line in the file):

    BELOW this line, include this code:

    This section of code should now look like this:

    Finished.

    You can experiment with different skyscrapers to see what suits you best.

    I have made my skyscraper in the standard colours of subSilver, these are:

    006699 Darkish bluey-green! For the ad border and links.
    000000 Black. For text.
    EFEFEF Light grey. Ad table background.

    I have tested this in Internet Explorer 6, and Mozilla Firefox 0.8

    The alignment of the “new topic” and “post reply” buttons is affected. This may, or may not be to your liking. To alter it, you would need to edit the code again, which I haven’t looked at.

    You can see what I mean here:

    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.

    Having said that, I was using a wider skyscraper, so a narrower one could be the answer here. You can choose various different lengths and widths from Google. If you do, you do not need to change my code! Just change the Google code.

    Looks excellent in the other pages, and in all the pages at 1024×768.

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.