I am having an issue with Adsense that seems pretty common at the moment but due to my lack of programming skills I need to ask a question.

I put the adsense code into my node.tpl.php file so that it renders on 3 times on the main page and below each page under the content area. It is my understanding that Google has changed how they are rendering the adsense iframes and thus on my main page I now have 6 adsense areas, 3 of them have ads and 3 are blank.

Here is my node.tpl.php file:

print ($sticky) ? " sticky" : ""; ">
if ($page == 0):

print $node_url " rel="bookmark" title="Permanent Link to print $title "> print $title

endif;
print $submitted

print $content

if ($links):

endif;

Does anyone have a suggestion or know how I could modify this code so that it only displays the adsense script 3 times? I have looked at a few of the adsense modules and they have limitations in where adsense can be placed, currently I like where i have adsense showing. It is just broken with the most recent Google update.

Thank you,

Keto

Comments

keto-1’s picture

Sorry about the prior post, here is the code I was referring to:

<div class="node<?php print ($sticky) ? " sticky" : ""; ?>"> 
  <?php if ($page == 0): ?> 
  <h2><a href="<?php print $node_url ?>" rel="bookmark" title="Permanent Link to <?php print $title ?>"><?php print $title ?></a></h2> 
  <?php endif; ?> 
  <small><?php print $submitted ?></small> 
  <div class="entry"> <?php print $content ?> </div>
<script type="text/javascript"><!--
google_ad_client = "pub-removed-for-post";
google_ad_type = "text";
google_ad_channel = "";
google_ad_width = 336;
google_ad_height = 280;
google_ad_format = "336x280_as";
google_color_border = "ffffff";
google_color_bg = "ffffff";
google_color_link = "0066CC";
google_color_url = "0066CC";
google_color_text = "0066CC";
//--></script>
<script type="text/javascript"
 src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
 
  <?php if ($links): ?> 
 <p class="postmetadata">Posted in <?php print $terms ?> | <?php print $links ?> &#187;</p>
  <?php endif; ?> 
</div>