Where To Place Adsense Code In My Header?

Discussion in 'HTML & Website Design' started by yaskevic, Apr 1, 2008.

  1. #1
    [​IMG]

    Please take a look at the above image. I'd like to replace a blue rectangle with an adsense ad. Below is my header. Could you tell me please what should I replace with adsense code in order for adsense ad to be shown instead of a blue rectangle? Thank you in advance. Here is my header code :

    <table width="100%" align="center" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td style="background: url($stylevar[imgdir_misc]/nav_bg.gif) repeat-x center center;">$header_advertisement</td>
    </tr>
    </table>
    <table width="100%" align="center" border="0" cellspacing="0" cellpadding="0" style="background: url(images/bigred/gradients/gradient_nav.gif) repeat-x;">
    <tr>
    <td><a href="index.php"><img src="$stylevar[imgdir_misc]/home.gif" alt="" border="0" /></a></td>
    <td><a href="usercp.php"><img src="$stylevar[imgdir_misc]/usercp.gif" alt="" border="0" /></a></td>
    <td><a href="memberlist.php"><img src="$stylevar[imgdir_misc]/members.gif" alt="" border="0" /></a></td>
    <td><a href="search.php$session[sessionurl_q]" accesskey="4" rel="nofollow"><img src="$stylevar[imgdir_misc]/search.gif" alt="" border="0" /></a></td>
    <if condition="$bbuserinfo['userid']">
    <td id="usercptools"><img src="$stylevar[imgdir_misc]/quick.gif" alt="" border="0" /><script type="text/javascript">vbmenu_register("usercptools", true); </script></td></if>
    <if condition="$show['registerbutton']">
    <td><a href="register.php$session[sessionurl_q]" rel="nofollow"><img src="$stylevar[imgdir_misc]/register.gif" alt="" border="0" /></a></td>
    </if>
    </tr>
    </table>
    <table width="100%" align="center" border="0" cellspacing="0" cellpadding="0">
    <tr style="height: 15px;">
    <td colspan="3" style="background: #610000;">$header_advertisement</td>
    </tr>
    <tr style="height: 110px;" valign="top">
    <td width="191"><img src="$stylevar[imgdir_misc]/logo.gif" alt="" /></td>
    <td style="background: url('$stylevar[imgdir_misc]/ad_bkg.gif') no-repeat;" width="542"><img src="$stylevar[imgdir_misc]/banner.gif" alt="banner" style="display: block; margin: 29px 0px 0px 40px;" /></td>
    <td style="background: url(images/bigred/gradients/gradient_banner.gif) repeat-x;">$header_advertisement</td></tr>
    </tr>
    <table width="100%" align="center" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td background="$stylevar[imgdir_misc]/nav_bg.gif"><img src="$stylevar[imgdir_misc]/nav_bg.gif" alt="" width="738" height="38"></td>
    </tr>
    </table>
    <!-- content table -->
    $spacer_open
    $leftcolumn_advertisement
    $_phpinclude_output



    Waiting for your help
     
    yaskevic, Apr 1, 2008 IP
  2. wd_2k6

    wd_2k6 Peon

    Messages:
    1,740
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I think it's this part:

    <td style="background: url('$stylevar[imgdir_misc]/ad_bkg.gif') no-repeat;" width="542"><img src="$stylevar[imgdir_misc]/banner.gif" alt="banner" style="display: block; margin: 29px 0px 0px 40px;" /></td>
    <td style="background: url(images/bigred/gradients/gradient_banner.gif) repeat-x;">$header_advertisement</td></tr>

    Put the Adsense code in one of the table columns (td), try one at a time it should be one of them.
     
    wd_2k6, Apr 1, 2008 IP
  3. yaskevic

    yaskevic Active Member

    Messages:
    116
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #3

    I tried to replace <img src="$stylevar[imgdir_misc]/banner.gif" alt="banner" style="display: block; margin: 29px 0px 0px 40px;" /> in the header template with adsense code. Please take a look at the below image. This is the result. What am I doing wrong?

    [​IMG]


    I got the next tip:
    "For a non-image in that space like adsense code, you will have to include the style="display: block; margin: 29px 0px 0px 40px;" code in your adsense code as well to position it." But according to google TOS I can't change adsense code. So, how to place adsense ad exactly into the rectangle???
     
    yaskevic, Apr 1, 2008 IP
  4. wd_2k6

    wd_2k6 Peon

    Messages:
    1,740
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Yes it wouldn't be modifying the actual adsense code, the TOS means modifying the code you are given in any way, you are allowed to position it of course!! try replacing it with this:

    <td style="display: block; margin: 29px 0px 0px 40px;">ADSENSE CODE GOES HERE</td>

    and if that doesn't work replace it with this:

    <td><div style="display: block; margin: 29px 0px 0px 40px;">ADSENSE CODE GOES HERE</div</td>
     
    wd_2k6, Apr 1, 2008 IP
  5. yaskevic

    yaskevic Active Member

    Messages:
    116
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #5
    wd_2k6,
    Thank you very much! :) I tried your second line and it works!
     
    yaskevic, Apr 2, 2008 IP