%META:TOPICINFO{author="TWikiContributor" date="1143538677" format="1.1" reprev="1.2" version="1.1"}%
%META:TOPICPARENT{name="TopicFunction"}%
---+!! Function: %TOPIC%
%FORMFIELD{"TopicDescription"}%

Note, that you must set your client code in the WebPreferences in
the variable GOOGLEADSENECODE. It will be used on the complete blog. If no 
client code is set this TopicFunction will return an empty string.

See [[https://www.google.com/support/adsense][google help center]] for
an explanation of the parameters. 

---++ Parameters
   * WIDTH: width of banner, defaults to 468
   * HEIGHT: height of banner, defaults to 60
   * FORMAT: ad format, defaults to 468x60_as
   * TYPE: ad type, defaults to text_image
   * CHANNEL: optional ad channel
   * BORDERCOLOR: border color, optional
   * TEXTCOLOR: text color, optional
   * BGCOLOR: background color, optional
   * LINKCOLOR: link color, optional
   * URLCOLOR: url colur, optional

All optional colors can be set globally in the WebPreferences.
   

---++ Implementation
<verbatim>
%STARTINCLUDE%
%IFDEFINEDTHEN{"%GOOGLEADSENSECODE%"}%
<table class="blogGoogleAds"><tr><td>
<script type="text/javascript"><!--
google_ad_client = "%GOOGLEADSENSECODE%";
google_ad_width = %IFDEFINED{"%WIDTH%" then="%WIDTH%" else="468"}%;
google_ad_height = %IFDEFINED{"%HEIGHT%" then="%HEIGHT%" else="60"}%;
google_ad_format = "%IFDEFINED{"%FORMAT%" then="%FORMAT%" else="468x60_as"}%";
google_ad_type = "%IFDEFINED{"%TYPE%" then="%TYPE%" else="text_image"}%";
google_ad_channel = "%IFDEFINED{"%CHANNEL%"}%";
google_color_border = "%IFDEFINED{"%BORDERCOLOR%" then="%BORDERCOLOR%" else="%GOOGLEADS_BORDERCOLOR%"}%";
google_color_text = "%IFDEFINED{"%TEXTCOLOR%" then="%TEXTCOLOR%" else="%GOOGLEADS_TEXTCOLOR%"}%";
google_color_bg = "%IFDEFINED{"%BGCOLOR%" then="%BGCOLOR%" else="%GOOGLEADS_BGCOLOR%"}%";
google_color_link = "%IFDEFINED{"%LINKCOLOR%" then="%LINKCOLOR%" else="%GOOGLEADS_LINKCOLOR%"}%";
google_color_url = "%IFDEFINED{"%URLCOLOR%" then="%URLCOLOR%" else="%GOOGLEADS_URLCOLOR%"}%";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</td></tr></table>
%FIDEFINED%
%STOPINCLUDE%
</verbatim>

<!-- interrupt glue -->
---++ Test
<div class="alt">
%DBCALL{"%TOPIC%" TYPE="text"}%
</div>


%DBCALL{"RenderFunctionCallers"}%

<!--
   * Set ALLOWTOPICCHANGE = %MAINWEB%.BlogAdminGroup
   * Set SIDEBAR = Admin
   * Set SIDEBARARG = TopicFunction
-->

%META:FORM{name="TopicForm"}%
%META:FIELD{name="TopicType" attributes="M" title="TopicType" value="TopicFunction"}%
%META:FIELD{name="TopicDescription" attributes="M" title="TopicDescription" value="Render google adsense banner"}%
