function main() { //キャリアを判別 $carrier = Mobile::carrier(); //サーチの場合、テンプレート読込が別処理 if ($this->classmode == "overright") { //コンテンツごとの処理(内容の記述は下位クラスにて) $contents = $this->contentsMain(); $tempHTML = $contents[0]; if (isset($contents[1])) { $this->tempData += $contents[1]; } } else { //テンプレートファイル読み込み $tempHTML = $this->contentsMain(); } //クリニックのリンク情報の差し替えファイル。 global $clinicfile; require $clinicfile; $this->tempData += $clinicData; //全キャリア共通の差し替えファイル。 global $allfile; require $allfile; $this->tempData += $data; //キャリア別差し替えファイル $this->tempData += Mobile::carrierTemplate($carrier); //日付等のメタ生成 $this->tempData += Mobile::metaDate(); //テンプレート差し替え $html = Mobile::tempReplace($tempHTML, $this->tempData); //HTMLを出力 Mobile::output($html); }
public static function __import__() { $agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : null; if (strpos($agent, 'DoCoMo') !== false) { self::$carrier = 'docomo'; } else { if (strpos($agent, 'SoftBank') !== false || strpos($agent, 'Vodafone')) { self::$carrier = 'softbank'; } else { if (strpos($agent, 'KDDI') !== false) { self::$carrier = 'au'; } else { self::$carrier = null; } } } if (self::is_mobile()) { ini_set('session.use_cookies', 'off'); ini_set('session.use_only_cookies', 0); ini_set('session.use_trans_sid', '1'); } }