Awesome trick!
I had placed a table in header.tpl of my YGET template, and inserted my google code there, along side my logo image. The trouble was it showed on every page.
I took your "if" argument, and used it around my google code and it works like a charm. The only problem I had was when I first did it, using the " " around the pagenames I got a MySQL error. I changed the " " to ' ' and all was well. My mods to header.tpl began after line 36.
PHP Code:
Line 36: </div>
<!-- My Mods Begin Here -->
<p> </p>
<table border="0" cellpadding="4" width="100%"><tr>
<td align="center" valign="top">
<img src="http://www.mydomain.com/templates/yget/images/logo.jpg" alt="MyLogo" />
</td>
<td align="center" valign="top">
{if $pagename eq 'index' || $pagename eq 'story' || $pagename eq 'search' || $pagename eq 'upcoming'}
<script type="text/javascript"><!--
google_ad_client = "pub-xxxxxxxxxxxxxxxx";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text";
google_ad_channel = "";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "E1771E";
google_color_text = "000000";
google_color_url = "940F04";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
{/if}
</td></tr></table>
<p> </p>
<!-- My Mods End Here -->
<div id="cab">
<ul class="postin">
I also added: || $pagename eq 'upcoming' to the list.