Source for file htf_tlb_google.phl
Documentation is available at htf_tlb_google.phl
* @package HtmlTemplateFramework
* @author Yamauchi Shogo <htf@as-prj.com>
* @version $Id: htf_tlb_google.phl ,v 1.0 $
require_once("htf_com_initialize.inc"); //共通初期処理
require_once("htf_tag_element.phl"); //エレメントクラス
* googleの各種検索オプションを指定することにより、さまざまなgoogle検索タグを
* 生成するクラス。サイト内指定検索やファイルタイプ指定検索、言語指定指定などが可能。
* @author Yamauchi Shogo <htf@as-prj.com>
* google検索エンジンの呼び出しURL。(デフォルトは、'http://www.google.co.jp/search')
* google検索エンジンインターフェイス・入力エンコード指定。(デフォルトは空文字・指定なし)
* 'Shift_JIS' 'euc-jp' 'UTF-8'等が指定可能なようです。
* google検索エンジンインターフェイス・出力エンコード指定。(デフォルトは空文字・指定なし)
* 'Shift_JIS' 'euc-jp' 'UTF-8'等が指定可能なようです。
* google検索エンジンインターフェイス・メッセージを表示する言語指定。(デフォルトは"ja")
* google検索エンジンインターフェイス・検索の対象にする言語指定。(デフォルトは空文字・全ての国が対象)
* 以下のような言語が指定可能なようです。<br>
* google検索エンジンインターフェイス・表示件数指定。(デフォルトは空文字・10件出力)
* google検索エンジンインターフェイス・ファイルタイプを検索対象にする・しない指定(デフォルトは空文字)
var $as_ft; //ファイル形式を検索対象にする・しない(i:対象にする e:しない)
* google検索エンジンインターフェイス・ファイルタイプを指定(デフォルトは空文字・指定なし)以下の指定が可能なようです。
* pdf→Adobe Acrobat PDF (.pdf)<br>
* ps →Adobe Postscript (.ps)<br>
* doc→Microsoft Word (.doc)<br>
* xls→Microsoft Excel (.xls)<br>
* ppt→Microsoft Powerpoint (.ppt)<br>
* rtf→Rich Text Format (.rtf)<br>
* google検索エンジンインターフェイス・ページ最終更新日指定(デフォルトは空文字・指定なし)
var $as_qdr; //ページ最終更新日条件(all/m3/m6/y)
* google検索エンジンインターフェイス・検索対象箇所指定(デフォルトは空文字・指定なし)
var $as_occt; //検索の対象にする箇所(any/title/body/url/links)
* google検索エンジンインターフェイス・サイト・ドメインを対象にする・しない(デフォルトは空文字・指定なし)
var $as_dt; //サイト・ドメインを検索対象にする・しない(i:対象にする e:除く)
* google検索エンジンインターフェイス・検索対象にするサイト指定(デフォルトは空文字・指定なし)
* サイト・ドメインを対象にするオプションで'i'を指定した場合、検索対象のサイト・ドメインURLを設定してください。
* テキストボックスの長さ指定(デフォルトは空文字・指定なし)
* 結果を表示するウインドウ名指定(デフォルトは空文字・指定なし)
* 検索ボタンのラベル表示値(デフォルトは'Search')
* 引数の設定値からgoogle検索タグオブジェクトを生成します。
* @param string $textwidth 検索文字入力テキストボックスの長さ(デフォルトは空文字)
* @param string $strhl メッセージを表示する言語指定(デフォルトは日本語)
* @param string $strlr 検索対象にする言語指定(デフォルトは空文字)
* @param string $strenc google検索エンジンへの入出力エンコード指定(デフォルトは空文字)
function htf_tlb_google($textwidth= "", $strhl= "ja", $strlr= "", $strenc= "") {
$searchform = $this->make_element_form($this->url, $this->target);
$input_ie = $this->make_element_input("ie", $this->ie);
$input_oe = $this->make_element_input("oe", $this->oe);
$input_hl = $this->make_element_input("hl", $this->hl);
$input_lr = $this->make_element_input("lr", $this->lr);
$input_num = $this->make_element_input("num", $this->num);
$input_as_ft = $this->make_element_input("as_ft", $this->as_ft);
$input_as_filetype = $this->make_element_input("as_filetype", $this->as_filetype);
$input_as_qdr = $this->make_element_input("as_qdr", $this->as_qdr);
$input_as_occt = $this->make_element_input("as_occt", $this->as_occt);
$input_as_dt = $this->make_element_input("as_dt", $this->as_dt);
$input_as_sitesearch = $this->make_element_input("as_sitesearch", $this->as_sitesearch);
$inputtext = $this->make_element_inputtext("q", $this->width);
$submitbutton = $this->make_element_submitbutton($this->buttonlabel);
if (!is_null($input_ie)) { $searchform->add_content($input_ie); }
if (!is_null($input_oe)) { $searchform->add_content($input_oe); }
if (!is_null($input_hl)) { $searchform->add_content($input_hl); }
if (!is_null($input_lr)) { $searchform->add_content($input_lr); }
if (!is_null($input_num)) { $searchform->add_content($input_num); }
if (!is_null($input_as_ft)) { $searchform->add_content($input_as_ft); }
if (!is_null($input_as_filetype)) { $searchform->add_content($input_as_filetype); }
if (!is_null($input_as_qdr)) { $searchform->add_content($input_as_qdr); }
if (!is_null($input_as_occt)) { $searchform->add_content($input_as_occt); }
if (!is_null($input_as_dt)) { $searchform->add_content($input_as_dt); }
if (!is_null($input_as_sitesearch)) { $searchform->add_content($input_as_sitesearch); }
if (!is_null($inputtext)) { $searchform->add_content($inputtext); }
if (!is_null($submitbutton)) { $searchform->add_content($submitbutton); }
$strret = $searchform->get_htmltag();
* googleサイト検索タグ(関連サイト検索タグ)を取得します。
$searchform = $this->make_element_form($this->url, $this->target);
$input_ie = $this->make_element_input("ie", $this->ie);
$input_oe = $this->make_element_input("oe", $this->oe);
$input_hl = $this->make_element_input("hl", $this->hl);
$input_lr = $this->make_element_input("lr", $this->lr);
$input_num = $this->make_element_input("num", $this->num);
$inputtext = $this->make_element_inputtext("as_rq", $this->width);
$submitbutton = $this->make_element_submitbutton($this->buttonlabel);
if (!is_null($input_ie)) { $searchform->add_content($input_ie); }
if (!is_null($input_oe)) { $searchform->add_content($input_oe); }
if (!is_null($input_hl)) { $searchform->add_content($input_hl); }
if (!is_null($input_lr)) { $searchform->add_content($input_lr); }
if (!is_null($input_num)) { $searchform->add_content($input_num); }
if (!is_null($inputtext)) { $searchform->add_content($inputtext); }
if (!is_null($submitbutton)) { $searchform->add_content($submitbutton); }
$strret = $searchform->get_htmltag();
* googleサイト検索タグ(リンクページ検索タグ)を取得します。
$searchform = $this->make_element_form($this->url, $this->target);
$input_ie = $this->make_element_input("ie", $this->ie);
$input_oe = $this->make_element_input("oe", $this->oe);
$input_hl = $this->make_element_input("hl", $this->hl);
$input_lr = $this->make_element_input("lr", $this->lr);
$input_num = $this->make_element_input("num", $this->num);
$inputtext = $this->make_element_inputtext("as_lq", $this->width);
$submitbutton = $this->make_element_submitbutton($this->buttonlabel);
if (!is_null($input_ie)) { $searchform->add_content($input_ie); }
if (!is_null($input_oe)) { $searchform->add_content($input_oe); }
if (!is_null($input_hl)) { $searchform->add_content($input_hl); }
if (!is_null($input_lr)) { $searchform->add_content($input_lr); }
if (!is_null($input_num)) { $searchform->add_content($input_num); }
if (!is_null($inputtext)) { $searchform->add_content($inputtext); }
if (!is_null($submitbutton)) { $searchform->add_content($submitbutton); }
$strret = $searchform->get_htmltag();
$this->url = "http://www.google.co.jp/search";
* @param string $url ポスト先のURL
* @param string $target targetウィンドウ名設定値
* @return htf_tag_element formタグ指定htf_tag_elementオブジェクト
function make_element_form($url, $target) {
* input hiddenタグオブジェクトを生成します。
* @param string $strname nameの属性値
* @param string $strvalue valueの属性設定値
* @return htf_tag_element inputタグ指定htf_tag_elementオブジェクト
function make_element_input($strname, $strvalue) {
* input textタグオブジェクトを生成します。
* @param string $namevalue nameの属性値
* @param string $widthvalue widthの属性設定値
* @return htf_tag_element inputタグ指定htf_tag_elementオブジェクト
function make_element_inputtext($namevalue, $widthvalue) {
* submit buttonタグオブジェクトを生成します。
* @param string $labelstr ボタンのvalue設定値
* @return htf_tag_element inputタグ指定htf_tag_elementオブジェクト
function make_element_submitbutton($labelstr) {
|