Ejemplo n.º 1
0
 /**
  * ブラウザがSafari系ならtrueを返す
  */
 public static function isBrowserSafariGroup()
 {
     return UA::isSafariGroup();
 }
Ejemplo n.º 2
0
$_conf['accesskey'] = 'accesskey';
$_conf['accept_charset'] = 'Shift_JIS';
$_conf['extra_headers_ht'] = '';
$_conf['use_cookies'] = true;
$userAgent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : null;
$mobile = Net_UserAgent_Mobile::singleton($userAgent);
// iPhone, iPod Touch or Android
if (UA::isIPhoneGroup($userAgent)) {
    $_conf['ktai'] = true;
    $_conf['iphone'] = true;
    $_conf['input_type_search'] = true;
    $_conf['accept_charset'] = 'UTF-8';
    // PC等
} elseif ($mobile->isNonMobile()) {
    // Safari
    if (UA::isSafariGroup($userAgent)) {
        $_conf['input_type_search'] = true;
        $_conf['accept_charset'] = 'UTF-8';
        // Windows Mobile
    } elseif (P2Util::isClientOSWindowsCE()) {
        $_conf['ktai'] = true;
        // 携帯ゲーム機
    } elseif (UA::isNintendoDS($userAgent) || UA::isPSP($userAgent)) {
        $_conf['ktai'] = true;
    }
    // 携帯
} else {
    $_conf['ktai'] = true;
    // NTT docomo iモード
    if ($mobile->isDoCoMo()) {
        // iモードブラウザ2.0からCookieに対応している
Ejemplo n.º 3
0
        } elseif ($r == 1) {
            $r_msg_ht = '1';
            // 完了
        }
    }
    // }}}
    // {{{ 書き込みフォームのオートセーブ(※これは使っていない。通信負荷を避けて、クッキーにまかせた)
} elseif ($cmd == 'auto_save_post_form') {
    // 未実装のテスト
    ob_start();
    var_dump($_POST);
    $r_msg = ob_get_clean();
    $r_msg_ht = hs($r_msg);
}
// }}}
if (UA::isSafariGroup()) {
    $r_msg_ht = mb_convert_encoding($r_msg_ht, 'UTF-8', 'SJIS-win');
}
// 結果出力
echo $xmldecTag;
echo $r_msg_ht;
/*
 * Local Variables:
 * mode: php
 * coding: cp932
 * tab-width: 4
 * c-basic-offset: 4
 * indent-tabs-mode: nil
 * End:
 */
// vim: set syn=php fenc=cp932 ai et ts=4 sw=4 sts=4 fdm=marker:
Ejemplo n.º 4
0
/**
 * 端末判定
 *
 * @return  void
 */
function _checkBrowser()
{
    global $_conf;
    // 基本(PC)
    $_conf['ktai'] = false;
    $_conf['disable_cookie'] = false;
    if (UA::isSafariGroup()) {
        $_conf['accept_charset'] = 'UTF-8';
    } else {
        $_conf['accept_charset'] = 'Shift_JIS';
    }
    $mobile =& Net_UserAgent_Mobile::singleton();
    if (PEAR::isError($mobile)) {
        trigger_error($mobile->toString(), E_USER_WARNING);
        // UAが携帯なら
    } elseif ($mobile and !$mobile->isNonMobile()) {
        $_conf['ktai'] = true;
        $_conf['disable_cookie'] = false;
        $_conf['accept_charset'] = 'Shift_JIS';
        // ベンダ判定
        // docomo i-Mode
        if ($mobile->isDoCoMo()) {
            // [todo] docomoの新しいのはCookieも使える…
            $_conf['disable_cookie'] = true;
            // EZweb (au or Tu-Ka)
        } elseif ($mobile->isEZweb()) {
            $_conf['disable_cookie'] = false;
            // SoftBank(旧Vodafone Live!)
        } elseif ($mobile->isSoftBank()) {
            //$_conf['accesskey_for_k'] = 'DIRECTKEY';
            // W型端末と3GC型端末はCookieが使える
            if ($mobile->isTypeW() || $mobile->isType3GC()) {
                $_conf['disable_cookie'] = false;
            } else {
                $_conf['disable_cookie'] = true;
            }
            // WILLCOM(旧AirH"Phone)
        } elseif ($mobile->isWillcom()) {
            $_conf['disable_cookie'] = false;
        }
    }
    // iPhone指定
    if (UA::isIPhoneGroup()) {
        $_conf['ktai'] = true;
        UA::setForceMode(UA::getMobileQuery());
        define('P2_IPHONE_LIB_DIR', './iphone');
        $_conf['subject_php'] = 'subject_i.php';
        $_conf['read_new_k_php'] = 'read_new_i.php';
        $_conf['menu_k_php'] = 'menu_i.php';
        $_conf['editpref_php'] = 'editpref_i.php';
    }
}