uniwiki

...testing twiki blog application

Function: RenderGoogleAdsense

Render google adsense banner

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 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

%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%

Test

Calls to 'RenderGoogleAdsense'

TopicForm
TopicType: TopicFunction
TopicDescription: Render google adsense banner

r1 - 05 Jan 2007 - 14:32:23 - TWikiGuest
Copyright © 1999-2009 by the contributing authors. All material on this collaboration platform is the property of the contributing authors. Ideas, requests, problems regarding TWiki? Send feedback.