_Value['Mobile'] = false; //端末種別=PC $this->_Value['CarrierName'] = ""; //キャリア名 $this->_Value['CarrierShortName'] = ""; //キャリア略名(1文字) $this->_Value['Width'] = 240; //幅 $this->_Value['Height'] = 320; //高さ $this->_Value['ResolutionX'] = 0; //横方向解像度 $this->_Value['ResolutionY'] = 0; //縦方向解像度 $this->_Value['EasyLogin'] = ""; //簡単ログインID $this->_Value['CarrierShortName'] = "X"; if(ereg("^DoCoMo", $this->_UserAgent)) { $this->_Value['CarrierShortName'] = "D"; }else if(ereg("^J-PHONE|^Vodafone|^SoftBank", $this->_UserAgent)) { $this->_Value['CarrierShortName'] = "S"; }else if(ereg("^UP.Browser|^KDDI", $this->_UserAgent)) { $this->_Value['CarrierShortName'] = "E"; }else { $this->_Carrier = ""; } //携帯の場合 if (!$w_mob_obj->isNonMobile()){ $this->_Value['Mobile'] = true; //携帯 //幅、高さの取得 $w_agent_obj = &Net_UserAgent_Mobile::factory(); $w_display_obj = $w_agent_obj->getDisplay(); $this->_Value['Width'] = $w_display_obj->getWidth(); //幅 $this->_Value['Height'] = $w_display_obj->getHeight(); //高さ //簡単ログイン情報の取得 $agent = $_SERVER["HTTP_USER_AGENT"]; $this->_Value['SerialNo'] = ""; //シリアル№ switch(true){ case ($w_mob_obj->isDoCoMo()): // DoCoMo $this->_Value['CarrierShortName'] = "D"; $this->_Value['CarrierName'] = "Docomo"; preg_match("/^.+ser([0-9a-zA-Z]+).*$/", $agent, $match); if ($match[1] != "") { $this->_Value['SerialNo'] = $match[1]; } /* if (method_exists($w_mob_obj, "getSerialNumber")) { $this->_Value['SerialNo'] = $w_mob_obj->getSerialNumber(); } */ break; case ($w_mob_obj->isVodafone()): // SoftBank $this->_Value['CarrierShortName'] = "S"; $this->_Value['CarrierName'] = "SoftBank"; /* preg_match("/^.+\/SN([0-9a-zA-Z]+).*$/", $agent, $match); if ($match[1] != "") { _Value['SerialNo'] = $match[1]; } else { if (isset($_SERVER['HTTP_X_JPHONE_UID'])) $this->_Value['SerialNo'] = $_SERVER['HTTP_X_JPHONE_UID']; } */ if (method_exists($w_mob_obj, "getSerialNumber")) { $this->_Value['SerialNo'] = $w_mob_obj->getSerialNumber(); } break; case ($w_mob_obj->isEZweb()): // ezweb,au $this->_Value['CarrierShortName'] = "E"; $this->_Value['CarrierName'] = "au"; if (isset($_SERVER['HTTP_X_UP_SUBNO'])) { $this->_Value['SerialNo'] = $_SERVER['HTTP_X_UP_SUBNO']; } break; case ($w_mob_obj->isWillcom()): // WillCom $this->_Value['CarrierShortName'] = "W"; $this->_Value['CarrierName'] = "WillCom"; break; default: if ( $this->_Value['CarrierShortName'] == "D" ) { $this->_Value['CarrierName'] = "Docomo-D"; preg_match("/^.+ser([0-9a-zA-Z]+).*$/", $agent, $match); if ($match[1] != "") { $this->_Value['SerialNo'] = $match[1]; } } break; } //シリアルNo獲得時はキャリア名、キャリア略称、簡単ログインIDを設定 if ($this->_Value['SerialNo'] != "") { $this->_Value['CarrierName'] = $w_mob_obj->getCarrierLongName(); // $this->_Value['CarrierShortName'] = $w_mob_obj->getCarrierShortName(); if ($this->_Value['CarrierShortName'] == "" ) { $this->_Value['CarrierShortName'] = "X"; if ( $this->_Value['CarrierName'] != "" ) $this->_Value['CarrierShortName'] = substr( $this->_Value['CarrierName'], 0, 1); } $this->_Value['EasyLogin'] = $this->_Value['CarrierShortName'] . $this->_Value['SerialNo']; } //携帯以外 } else { $this->_Value['Width'] = 1024; //幅 $this->_Value['Height'] = 768; //高さ } return; } //------------------------------------------------------------------------------ // プロパティ値の獲得関連 //------------------------------------------------------------------------------ /* *=============================================================================== * プロパティの取得 * 機能概要 * 呼出し形式 * GetValue( $vItem ) Mobile //端末種別 true:携帯、false:PC CarrierName //キャリア名 CarrierShortNmae //キャリア略名 SerialNo //シリアルNo EasyLogin //簡単ログインID Width //幅 Height //高さ ResolutionX //横方向解像度 ResolutionY //縦方向解像度 * 戻り値 * variant *=============================================================================== */ public function GetValue( $vItem ) { if ( !ISSET( $this->_Value[$vItem] ) ) return false; return $this->_Value[$vItem]; } } ?>