« ドメインは・・・ | メイン | 簡単にセットアップ »
2005年04月19日
このブログにGoogleの検索機能をつける

Googleの検索バーをつける
メインメニュー ⇒ テンプレート ⇒ メインページを書き換える
==========================================
下記の部分を切り取り
------------------------------------------
<h2>検索</h2>
<div class="link-note">
<form method="get" action="<$MTCGIPath$><$MTSearchScript$>">
<input type="hidden" name="IncludeBlogs" value="<$MTBlogID$>" />
<label for="search" accesskey="4">このサイトの検索</label><br />
<input id="search" name="search" size="20" /><br />
<input type="submit" value="検索" />
</form>
</div>
------------------------------------------
下記のように書き換えます。
------------------------------------------
<!-- SiteSearch Google -->
<form method="get" action="http://www.google.co.jp/custom"
target="google_window">
<table border="0" bgcolor="#ffffff">
<tr><td nowrap valign="top" align="left" height="32">
<a href="http://www.google.com/">
<img src="http://www.google.com/logos/Logo_25wht.gif"border="0"
alt="Google"></a>
<br/>
<input type="hidden" name="domains" value="shoukun.com">
<input type="text" name="q" size="15" maxlength="255"
value="">
<input type="submit" name="sa" value="検索">
</td></tr>
<tr>
<td nowrap>
<table>
<tr>
<td>
<input type="radio" name="sitesearch" value="">
<font size="-1" color="#000000">Web</font>
</td>
<td>
<input type="radio" name="sitesearch" value="shoukun.com"
checked>
<font size="-1" color="#000000">サイト内</font>
</td>
</tr>
</table>
<input type="hidden" name="client" value="pub-
*****************">
<input type="hidden" name="forid" value="1">
<input type="hidden" name="ie" value="Shift_JIS">
<input type="hidden" name="oe" value="Shift_JIS">
<input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC
:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1;">
<input type="hidden" name="hl" value="ja">
</td></tr></table>
</form>
<!-- SiteSearch Google -->
------------------------------------------
はい出来上がり
*印の部分は自分の環境に変えてください
サイト名2ヶ所も変更
太字は環境にあわせて
投稿者 shoukun : 2005年04月19日 11:30