﻿Google AdSense Plugin v0.2

說明
這個外掛程式提供管理介面中設定 Google AdSense 的相關參數.

安裝
將下載的外掛程式 zip 檔解壓縮到 lifetype 的 plugins 目錄下, 然後在管理介面的外掛程式中心重新整理網頁,
便可看到 googleadsense 外掛已經安裝了.

設定
1.進入管理介面 -> 個人網誌設定 -> Google AdSense
2.啟用外掛程式，並且輸入你的 client 代碼, 以及相關的 content, suggestion 與 search 設定.

修改樣版

1. Content

{if $googleadsense && $googleadsense->isContentEnabled()}
<script type="text/javascript"><!--
google_ad_client = "{$googleadsense->getClient()}";
google_ad_width = {$googleadsense->getContentWidth()};
google_ad_height = {$googleadsense->getContentHeight()};
google_ad_format = "{$googleadsense->getContentFormat()}";
google_ad_type = "{$googleadsense->getContentType()}";
google_ad_channel = "{$googleadsense->getContentChannel()}";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
{/if}

2. Suggestion

{if $googleadsense && $googleadsense->isSuggestionEnabled()}
<script type="text/javascript"><!--
google_ad_client = "{$googleadsense->getClient()}";
google_ad_width = {$googleadsense->getSuggestionWidth()};
google_ad_height = {$googleadsense->getSuggestionHeight()};
google_ad_format = "{$googleadsense->getSuggestionFormat()}";
google_cpa_choice = "{$googleadsense->getSuggestionChoice()}";
google_ad_channel = "{$googleadsense->getSuggestionChannel()}";
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
{/if}

3. Search
{if $googleadsense && $googleadsense->isSearchEnabled()}
<!--
複製你由 Google 取得的 search 代碼, 只要要 client 的值修改如下列的部份:
<input type="hidden" name="client" value="{$googleadsense->getClient()}"></input>
-->
{/if}

當然，你必須先申請一個 Google AdSense 帳號才行。
