本文整理汇总了PHP中Net_UserAgent_Mobile::singleton方法的典型用法代码示例。如果您正苦于以下问题:PHP Net_UserAgent_Mobile::singleton方法的具体用法?PHP Net_UserAgent_Mobile::singleton怎么用?PHP Net_UserAgent_Mobile::singleton使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Net_UserAgent_Mobile
的用法示例。
在下文中一共展示了Net_UserAgent_Mobile::singleton方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _is_keitai
/**
* Browser detection
*/
private function _is_keitai()
{
$agent = Net_UserAgent_Mobile::singleton();
switch( true )
{
case ($agent->isDoCoMo()): // DoCoMoかどうか
return true;
if( $agent->isFOMA() )
return true;
break;
case ($agent->isVodafone()): // softbankかどうか
return true;
if( $agent->isType3GC() )
return true;
break;
case ($agent->isEZweb()): // ezwebかどうか
return true;
if( $agent->isWIN() )
return true;
break;
default:
return false;
break;
}
}
示例2: from_tumblr
function from_tumblr()
{
global $sessionkey;
$db = get_db_connectiuon();
list($sessionkey, $cookies, $u) = get_login_cookie($db);
$page = getPage();
$agent = Net_UserAgent_Mobile::singleton();
// paging a page
if ($agent->isDoCoMo()) {
$page = ceil($page / 2);
}
//$postid = getPostId();
$url = 'http://www.tumblr.com/dashboard/';
if ($page > 1) {
$url .= $page;
}
if ($postid > 1) {
$url .= "/{$postid}";
}
#print "<!--$url-->";
$retry = 2;
while ($retry--) {
$req =& new HTTP_Request($url);
$req->setMethod(HTTP_REQUEST_METHOD_GET);
foreach ($cookies as $v) {
$req->addCookie($v['name'], $v['value']);
}
if (PEAR::isError($req->sendRequest())) {
$err = 1;
}
$code = $req->getResponseCode();
if ($code == 302) {
$err = true;
if ($u['email']) {
list($err, $cookies) = update_cookie_info($u['email'], $u['password'], true, $u['hash']);
}
if ($err) {
$retry = 0;
break;
}
} else {
if ($code == 200) {
return $req->getResponseBody();
} else {
print '<html><body><pre>x_x';
print " {$code} ";
print '</body></html>';
exit;
}
}
}
if ($retry == 0) {
header('Location: /login');
} else {
print '<html><body><pre>x_x';
print '</body></html>';
}
exit;
}
示例3: __construct
function __construct($content)
{
$html = $this->wash($content);
$dom = new DOMDocument();
$dom->loadXML($html);
$this->dom = $dom;
$this->agent = Net_UserAgent_Mobile::singleton();
}
示例4: smarty_function_emoji
/**
* Copyright (C) 2012 Vizualizer All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @author Naohisa Minagawa <info@vizualizer.jp>
* @copyright Copyright (c) 2010, Vizualizer
* @license http://www.apache.org/licenses/LICENSE-2.0.html Apache License, Version 2.0
* @since PHP 5.3
* @version 1.0.0
*/
function smarty_function_emoji($params, $smarty, $template)
{
// codeパラメータは必須です。
if (empty($params['code'])) {
trigger_error("emoji: missing code parameter", E_USER_WARNING);
return;
}
// パラメータを変数にコピー
$code = $params['code'];
if (preg_match("/[0-9]{1,3}/", $code) && is_numeric($code) && 0 < $code && $code < 253) {
// 変換表を配列に格納
$emoji_array = array();
$emoji_array[] = "";
$contents = @file(dirname(__FILE__) . "/emojix.csv");
foreach ($contents as $line) {
$line = rtrim($line);
$emoji_array[] = explode(",", $line);
}
if (Net_UserAgent_Mobile::isMobile()) {
// モバイルユーザーエージェントのインスタンスを取得
$agent = Net_UserAgent_Mobile::singleton();
if ($agent->isDoCoMo()) {
// DoCoMo
echo mb_convert_encoding($emoji_array[$code][1], "UTF-8", "SJIS");
} elseif ($agent->isEZweb()) {
// au
if (preg_match("/[^0-9]/", $emoji_array[$code][2])) {
echo $emoji_array[$code][2];
} else {
echo "<img localsrc=\"" . $emoji_array[$code][2] . "\" />";
}
} elseif ($agent->isSoftbank()) {
if ($agent->isType3GC()) {
// Softbank-UTF8
$e = new Emoji();
if (preg_match("/^[A-Z]{1}?/", $emoji_array[$code][3])) {
echo "\$" . $emoji_array[$code][3] . "";
} else {
echo $emoji_array[$code][3];
}
} else {
// Softbank-SJIS
if (preg_match("/^[A-Z]{1}?/", $emoji_array[$code][3])) {
echo "\$" . mb_convert_encoding($emoji_array[$code][3], "SJIS", "UTF-8") . "";
} else {
echo mb_convert_encoding($emoji_array[$code][3], "SJIS", "UTF-8");
}
}
}
} else {
echo "<img src=\"/emoji_images/" . $emoji_array[$code][0] . ".gif\" width=\"12\" height=\"12\" border=\"0\" alt=\"\" />";
}
} else {
// 絵文字のコードが規定値以外
return "[Error!]\n";
}
}
示例5: execute
public function execute($filterChain)
{
$response = $this->getContext()->getResponse();
if ($this->isFirstCall()) {
$agent = Net_UserAgent_Mobile::singleton();
$this->getContext()->getRequest()->setAttribute("userAgent", $agent);
$this->getContext()->getResponse()->setSlot("carrier_css", $agent);
}
$filterChain->execute();
}
示例6: __construct
public function __construct()
{
$uri = Mage::app()->getRequest();
if (preg_match("/extensions_(custom|local)/i", $uri->getRequestUri())) {
$this->_isAdmin = true;
}
if (!$this->_isAdmin) {
$error = error_reporting(E_ALL);
$include_path = get_include_path();
set_include_path($include_path . PS . BP . DS . 'lib/PEAR');
require_once 'Net/UserAgent/Mobile.php';
$this->_agent = Net_UserAgent_Mobile::singleton();
}
}
示例7: _checkUA
/**
* UAでセッションの妥当性をチェックする
*
* @return bool
*/
private function _checkUA()
{
// {{{ docomoはUTN時にUA後部が変わるので機種名で検証する
$mobile = Net_UserAgent_Mobile::singleton();
if ($mobile->isDoCoMo()) {
$mobile_b = Net_UserAgent_Mobile::factory($_SESSION[$this->sess_array]['ua']);
if ($mobile_b->getModel() == $mobile->getModel()) {
return true;
}
}
// }}}
// $offset = 12;
if (empty($offset)) {
$offset = strlen($_SERVER['HTTP_USER_AGENT']);
}
if (substr($_SERVER['HTTP_USER_AGENT'], 0, $offset) == substr($_SESSION[$this->sess_array]['ua'], 0, $offset)) {
return true;
} else {
return false;
}
}
示例8: isMobile
/**
* EC-CUBE がサポートする携帯キャリアかどうかを判別する。
*
* ※一部モジュールで使用。ただし、本メソッドは将来的に削除しますので新規ご利用は控えてください。
*
* @return boolean サポートしている場合は true、それ以外の場合は false を返す。
*/
function isMobile()
{
$objAgent =& Net_UserAgent_Mobile::singleton();
if (Net_UserAgent_Mobile::isError($objAgent)) {
return false;
} else {
return $objAgent->isDoCoMo() || $objAgent->isEZweb() || $objAgent->isVodafone();
}
}
示例9: p2_get_emoji
/**
* 端末に応じた絵文字を取得する
*
* @param Net_UserAgent_Mobile_Common $mobile
* @return array
*/
function p2_get_emoji(Net_UserAgent_Mobile_Common $mobile = null)
{
static $cache = null;
if ($mobile === null && $cache !== null) {
return $cache;
}
$emoji = array(0 => '0.', 1 => '1.', 2 => '2.', 3 => '3.', 4 => '4.', 5 => '5.', 6 => '6.', 7 => '7.', 8 => '8.', 9 => '9.', '*' => '*.', '#' => '#.', 'ut1' => '▲', 'ut2' => '△', 'dt1' => '▼', 'dt2' => '▽', 'lt1' => '<', 'lt2' => '«', 'rt1' => '>', 'rt2' => '»');
if (!$mobile) {
$mobile = Net_UserAgent_Mobile::singleton();
$cache = true;
}
// @link http://www.nttdocomo.co.jp/service/imode/make/content/pictograph/
if ($mobile->isDoCoMo()) {
$emoji[0] = pack('C*', 0xf9, 0x90);
$emoji[1] = pack('C*', 0xf9, 0x87);
$emoji[2] = pack('C*', 0xf9, 0x88);
$emoji[3] = pack('C*', 0xf9, 0x89);
$emoji[4] = pack('C*', 0xf9, 0x8a);
$emoji[5] = pack('C*', 0xf9, 0x8b);
$emoji[6] = pack('C*', 0xf9, 0x8c);
$emoji[7] = pack('C*', 0xf9, 0x8d);
$emoji[8] = pack('C*', 0xf9, 0x8e);
$emoji[9] = pack('C*', 0xf9, 0x8f);
$emoji['lt2'] = '<<';
$emoji['rt2'] = '>>';
// @link http://www.au.kddi.com/ezfactory/tec/spec/3.html
} elseif ($mobile->isEZweb()) {
$emoji[0] = '<img localsrc="325">';
$emoji[1] = '<img localsrc="180">';
$emoji[2] = '<img localsrc="181">';
$emoji[3] = '<img localsrc="182">';
$emoji[4] = '<img localsrc="183">';
$emoji[5] = '<img localsrc="184">';
$emoji[6] = '<img localsrc="185">';
$emoji[7] = '<img localsrc="186">';
$emoji[8] = '<img localsrc="187">';
$emoji[9] = '<img localsrc="188">';
//$emoji['#'] = '<img localsrc="818">';
$emoji[9] = '<img localsrc="188">';
$emoji['ut1'] = '<img localsrc="33">';
$emoji['ut2'] = '<img localsrc="35">';
$emoji['dt1'] = '<img localsrc="32">';
$emoji['dt2'] = '<img localsrc="34">';
$emoji['lt1'] = '<img localsrc="5">';
$emoji['lt2'] = '<img localsrc="7">';
$emoji['rt1'] = '<img localsrc="6">';
$emoji['rt2'] = '<img localsrc="8">';
// @link http://creation.mb.softbank.jp/web/web_pic_about.html
} elseif ($mobile->isSoftBank()) {
$_esc = chr(0x1b) . '$';
$_si = chr(0xf);
$emoji[0] = $_esc . 'FE' . $_si;
$emoji[1] = $_esc . 'F<' . $_si;
$emoji[2] = $_esc . 'F=' . $_si;
$emoji[3] = $_esc . 'F>' . $_si;
$emoji[4] = $_esc . 'F?' . $_si;
$emoji[5] = $_esc . 'F@' . $_si;
$emoji[6] = $_esc . 'FA' . $_si;
$emoji[7] = $_esc . 'FB' . $_si;
$emoji[8] = $_esc . 'FC' . $_si;
$emoji[9] = $_esc . 'FD' . $_si;
$emoji['lt1'] = $_esc . 'F[' . $_si;
$emoji['lt2'] = $_esc . 'F]' . $_si;
$emoji['rt1'] = $_esc . 'FZ' . $_si;
$emoji['rt2'] = $_esc . 'F\\' . $_si;
}
if ($cache) {
$cache = $emoji;
}
return $emoji;
}
示例10: printLoginFirst
/**
* 最初のログイン画面を表示する
*/
function printLoginFirst(Login $_login)
{
global $STYLE, $_conf;
global $_login_failed_flag, $_p2session;
global $skin_en;
// {{{ データ保存ディレクトリのパーミッションの注意を喚起する
P2Util::checkDirWritable($_conf['dat_dir']);
$checked_dirs[] = $_conf['dat_dir'];
// チェック済みのディレクトリを格納する配列に
if (!in_array($_conf['idx_dir'], $checked_dirs)) {
P2Util::checkDirWritable($_conf['idx_dir']);
$checked_dirs[] = $_conf['idx_dir'];
}
if (!in_array($_conf['pref_dir'], $checked_dirs)) {
P2Util::checkDirWritable($_conf['pref_dir']);
$checked_dirs[] = $_conf['pref_dir'];
}
// }}}
// 前処理
$_login->checkAuthUserFile();
clearstatcache();
//=========================================================
// 書き出し用変数
//=========================================================
$ptitle = 'rep2';
$myname = basename($_SERVER['SCRIPT_NAME']);
$auth_sub_input_ht = "";
$body_ht = "";
$p_str = array('user' => 'ユーザ', 'password' => 'パスワード');
// 携帯用表示文字列全角→半角変換
if ($_conf['ktai'] && function_exists('mb_convert_kana')) {
foreach ($p_str as $k => $v) {
$p_str[$k] = mb_convert_kana($v, 'rnsk');
}
}
//==============================================
// 補助認証
//==============================================
$mobile = Net_UserAgent_Mobile::singleton();
$keep_login_checked = ' checked';
if (isset($_POST['submit_new']) || isset($_POST['submit_member'])) {
if (!isset($_POST['keep_login']) || $_POST['keep_login'] !== '1') {
$keep_login_checked = '';
}
}
$auth_sub_input_ht = <<<EOP
<input type="hidden" name="device_pixel_ratio" id="device_pixel_ratio" value="1">
<input type="hidden" name="ctl_keep_login" value="1">
<input type="checkbox" id="keep_login" name="keep_login" value="1"{$keep_login_checked}><label for="keep_login">Cookieにログイン状態を保持</label><br>
EOP;
// }}}
// ログインフォームからの指定
if (!empty($GLOBALS['brazil'])) {
$add_mail = '.,@-';
} else {
$add_mail = '';
}
if (preg_match("/^[0-9A-Za-z_{$add_mail}]+\$/", $_login->user_u)) {
$hd['form_login_id'] = p2h($_login->user_u);
} elseif (!empty($_POST['form_login_id']) && preg_match("/^[0-9A-Za-z_{$add_mail}]+\$/", $_POST['form_login_id'])) {
$hd['form_login_id'] = p2h($_POST['form_login_id']);
} else {
$hd['form_login_id'] = '';
}
if (!empty($_POST['form_login_pass']) && preg_match('/^[\\x21-\\x7E]+$/', $_POST['form_login_pass'])) {
$hd['form_login_pass'] = p2h($_POST['form_login_pass']);
} else {
$hd['form_login_pass'] = '';
}
// docomoならpasswordにしない
if ($mobile->isDoCoMo()) {
$type = 'text';
} else {
$type = 'password';
}
// {{{ ログイン用フォームを生成
$hd['REQUEST_URI'] = p2h($_SERVER['REQUEST_URI']);
if ($mobile->isDoCoMo()) {
if (strpos($hd['REQUEST_URI'], '?') === false) {
$hd['REQUEST_URI'] .= '?guid=ON';
} else {
$hd['REQUEST_URI'] .= '&guid=ON';
}
}
if (file_exists($_conf['auth_user_file'])) {
$submit_ht = '<input type="submit" name="submit_member" value="ユーザログイン">';
} else {
$submit_ht = '<input type="submit" name="submit_new" value="新規登録">';
}
if ($_conf['ktai']) {
//$k_roman_input_at = ' istyle="3" format="*m" mode="alphabet"';
$k_roman_input_at = ' istyle="3" format="*x" mode="alphabet"';
$k_input_size_at = '';
} else {
$k_roman_input_at = '';
$k_input_size_at = ' size="32"';
}
//.........这里部分代码省略.........
示例11: _authCheck
/**
* 認証のチェックを行う
*
* @return bool
*/
private function _authCheck()
{
global $_conf;
global $_login_failed_flag;
global $_p2session;
$this->checkAuthUserFile();
// 認証ユーザ設定(ファイル)を読み込みできたら
if (file_exists($_conf['auth_user_file'])) {
include $_conf['auth_user_file'];
// ユーザ名が違ったら、認証失敗で抜ける
if ($this->user_u != $rec_login_user_u) {
P2Util::pushInfoHtml('<p>p2 error: ログインエラー</p>');
// ログイン失敗ログを記録する
if (!empty($_conf['login_log_rec'])) {
$recnum = isset($_conf['login_log_rec_num']) ? intval($_conf['login_log_rec_num']) : 100;
P2Util::recAccessLog($_conf['login_failed_log_file'], $recnum);
}
return false;
}
// パスワード設定があれば、セットする
if (isset($rec_login_pass_x) && strlen($rec_login_pass_x) > 0) {
$this->pass_x = $rec_login_pass_x;
}
}
// 認証設定 or パスワード記録がなかった場合はここまで
if (!$this->pass_x) {
// 新規登録でなければエラー表示
if (empty($_POST['submit_new'])) {
P2Util::pushInfoHtml('<p>p2 error: ログインエラー</p>');
}
return false;
}
// {{{ クッキー認証パススルー
if (isset($_COOKIE['cid'])) {
if ($this->checkUserPwWithCid($_COOKIE['cid'])) {
return true;
// Cookie認証が通らなければ
} else {
// 古いクッキーをクリアしておく
$this->clearCookieAuth();
}
}
// }}}
// {{{ すでにセッションが登録されていたら、セッションで認証
if (isset($_SESSION['login_user']) && isset($_SESSION['login_pass_x'])) {
// セッションが利用されているなら、セッションの妥当性チェック
if (isset($_p2session)) {
if ($msg = $_p2session->checkSessionError()) {
P2Util::pushInfoHtml('<p>p2 error: ' . htmlspecialchars($msg) . '</p>');
//Session::unSession();
// ログイン失敗
return false;
}
}
if ($this->user_u == $_SESSION['login_user']) {
if ($_SESSION['login_pass_x'] != $this->pass_x) {
Session::unSession();
return false;
} else {
return true;
}
}
}
// }}}
$mobile = Net_UserAgent_Mobile::singleton();
// {{{ フォームからログインした時
if (!empty($_POST['submit_member'])) {
// フォームログイン成功なら
if ($_POST['form_login_id'] == $this->user_u and sha1($_POST['form_login_pass']) == $this->pass_x) {
// 古いクッキーをクリアしておく
$this->clearCookieAuth();
// ログインログを記録する
$this->logLoginSuccess();
// リダイレクト
return $_SERVER['REQUEST_URI'];
//return true;
// フォームログイン失敗なら
} else {
P2Util::pushInfoHtml('<p>p2 info: ログインできませんでした。<br>ユーザ名かパスワードが違います。</p>');
$_login_failed_flag = true;
// ログイン失敗ログを記録する
$this->logLoginFailed();
return false;
}
}
// }}}
return false;
}
示例12: checkUA
/**
* UAでセッションの妥当性をチェックする
*
* @access private
* @return boolean
*/
function checkUA()
{
// ibisBrowser 219.117.203.9
// Mozilla/4.0 (compatible; ibisBrowser; ip210.153.84.0; ser0123456789ABCDE)
// http://qb5.2ch.net/test/read.cgi/operate/1141521195/748
if ($_SERVER['REMOTE_ADDR'] == '219.117.203.9') {
return true;
}
// {{{ docomoはUTN時にUA後部が変わるので機種名で検証する
$mobile =& Net_UserAgent_Mobile::singleton();
if ($mobile->isDoCoMo()) {
$mobile_b =& Net_UserAgent_Mobile::factory($_SESSION[$this->sess_array]['ua']);
if ($mobile_b->getModel() == $mobile->getModel()) {
return true;
}
}
// }}}
$ua = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : null;
// $offset = 12;
if (empty($offset)) {
$offset = strlen($ua);
}
if (substr($ua, 0, $offset) == substr($_SESSION[$this->sess_array]['ua'], 0, $offset)) {
return true;
}
return false;
}
示例13: register
/**
* Registers services on the given app.
*
* This method should only be used to configure services and parameters.
* It should not get services.
*
* @param BaseApplication $app An Application instance
*/
public function register(BaseApplication $app)
{
// PEAR
$app['smarty'] = function () {
return new \Smarty();
};
$app['mobile.detect'] = function () {
return new \Mobile_Detect();
};
$app['pear.archive.tar'] = $app->protect(function ($p_tarname, $p_compress = null) {
return new \Archive_Tar($p_tarname, $p_compress);
});
$app['pear.cache.lite'] = $app->protect(function ($options = array()) {
return new \Cache_Lite($options);
});
$app['pear.calendar.month.weekdays'] = $app->protect(function ($y, $m, $firstDay = null) {
return new \Calendar_Month_Weekdays($y, $m, $firstDay);
});
$app['pear.http.request'] = $app->protect(function ($url = '', $params = array()) {
return new \HTTP_Request($url, $params);
});
$app['pear.mail'] = $app->protect(function ($driver, $params = array()) {
return \Mail::factory($driver, $params);
});
$app['pear.net.user_agent.mobile'] = $app->protect(function ($userAgent = null) {
return \Net_UserAgent_Mobile::singleton($userAgent);
});
$app['pear.net.url'] = $app->protect(function ($url = null, $useBrackets = true) {
return new \Net_URL($url, $useBrackets);
});
$app['pear.services.json'] = $app->protect(function ($use = 0) {
return new \Services_JSON($use);
});
$app['pear.text.password'] = $app->protect(function ($length = 10, $type = 'pronounceable', $chars = '') {
return \Text_Password::create($length, $type, $chars);
});
$app['pear.xml.serializer'] = $app->protect(function ($options = null) {
return new \XML_Serializer($options);
});
// framework
$app['eccube.cart_session'] = $app->protect(function ($cartKey = 'cart') {
return new \Eccube\Framework\CartSession($cartKey);
});
$app['eccube.customer'] = function () {
return new \Eccube\Framework\Customer();
};
$app['eccube.customer_list'] = $app->protect(function ($array, $mode = '') {
return new \Eccube\Framework\CustomerList($array, $mode);
});
$app['eccube.cookie'] = $app->protect(function ($day = COOKIE_EXPIRE) {
return new \Eccube\Framework\Cookie($day);
});
$app['eccube.check_error'] = $app->protect(function ($array = '') {
return new \Eccube\Framework\CheckError($array);
});
$app['eccube.date'] = $app->protect(function ($start_year = '', $end_year = '') {
return new \Eccube\Framework\Date($start_year, $end_year);
});
$app['eccube.display'] = $app->protect(function ($hasPrevURL = true) {
return new \Eccube\Framework\Display($hasPrevURL);
});
$app['eccube.form_param'] = function () {
return new \Eccube\Framework\FormParam();
};
$app['eccube.page_navi'] = $app->protect(function ($now_page, $all_row, $page_row, $func_name, $navi_max = NAVI_PMAX, $urlParam = '', $display_number = true) {
return new \Eccube\Framework\PageNavi($now_page, $all_row, $page_row, $func_name, $navi_max, $urlParam, $display_number);
});
$app['eccube.product'] = $app->protect(function () {
return new \Eccube\Framework\Product();
});
$app['eccube.response'] = $app->protect(function () {
return new \Eccube\Framework\Response();
});
$app['eccube.query'] = $app->protect(function ($dsn = '', $force_run = false, $new = false) {
return \Eccube\Framework\Query::getSingletonInstance($dsn, $force_run, $new);
});
$app['eccube.site_session'] = $app->share(function () {
return new \Eccube\Framework\SiteSession();
});
$app['eccube.sendmail'] = $app->protect(function () {
return new \Eccube\Framework\Sendmail();
});
// db
$app['eccube.db.factory'] = $app->protect(function ($db_type = DB_TYPE) {
return \Eccube\Framework\DB\DBFactory::getInstance($db_type);
});
$app['eccube.db.master_data'] = $app->share(function () {
return new \Eccube\Framework\DB\MasterData();
});
// graph
$app['eccube.graph.bar'] = $app->protect(function ($bgw = BG_WIDTH, $bgh = BG_HEIGHT, $left = LINE_LEFT, $top = LINE_TOP, $area_width = LINE_AREA_WIDTH, $area_height = LINE_AREA_HEIGHT) {
return new \Eccube\Framework\Graph\BarGraph($bgw, $bgh, $left, $top, $area_width, $area_height);
//.........这里部分代码省略.........
示例14: initAAS
/**
* スレッド表示オブジェクトにAASで使う変数をアサインする
*/
public static function initAAS($aShowThread)
{
global $_conf;
if ($_conf['iphone']) {
$aShowThread->aas_rotate = '↻';
} elseif ($_conf['ktai']) {
$mobile = Net_UserAgent_Mobile::singleton();
/**
* @link http://www.nttdocomo.co.jp/service/imode/make/content/pictograph/
* @link http://www.au.kddi.com/ezfactory/tec/spec/3.html
* @link http://mb.softbank.jp/mb/service/3G/mail/pictogram/
*/
if ($mobile->isDoCoMo()) {
$aShowThread->aas_rotate = '栗';
// リサイクル, 拡42
} elseif ($mobile->isEZweb()) {
$aShowThread->aas_rotate = '';
// 循環矢印, 807
} elseif ($mobile->isSoftBank()) {
$aShowThread->aas_rotate = "\$Pc";
// 渦巻, 414
}
} else {
//
}
}
示例15: init_APP
/**
* 初期設定系
*/
private function init_APP()
{
//
// スマートフォンの確認
//
// android
if ($this->mobilemyclass->is_android()) {
$this->is_android = TRUE;
} else {
if ($this->mobilemyclass->is_iphone()) {
$this->is_iphone = TRUE;
} else {
if ($this->mobilemyclass->is_ipad()) {
$this->is_ipad = TRUE;
}
}
}
// スマートフォン
if ($this->mobilemyclass->is_smartphone()) {
$this->is_smartphone = TRUE;
$this->is_pc = FALSE;
$this->view_pc = FALSE;
if ($this->use_smartphone_view) {
// クッキーを有効にしてビューの種類を取得
$this->load->helper('cookie');
$view_tmp = get_cookie('sf_view', TRUE);
if ($view_tmp == 'pc') {
$this->view_smartphone = "";
$this->view_pc = TRUE;
//$this->use_smartphone_view = FALSE;
} else {
$this->view_smartphone = TRUE;
}
}
}
if (!$this->config->config['base_url']) {
$this->config->config['base_url'] = $this->config->base_url();
}
if ($this->mobilemyclass->is_mobile()) {
$this->is_mobile = TRUE;
$this->is_pc = FALSE;
$this->view_pc = FALSE;
# NET_USERAGENT_MOBIEL読み込み
//$this->pearloader->load('Net/UserAgent/Mobile');
require_once 'Net/UserAgent/Mobile.php';
$this->agent =& Net_UserAgent_Mobile::singleton();
}
if ($this->is_force_ssl == "OFF" and $_SERVER['SERVER_PORT'] != 80) {
$this->load->helper('force_ssl');
force_no_ssl();
}
//
// SSL通信の処理(SSLの場合は強制的にすべてをSSLにする)
//
if (isset($_SERVER['HTTPS'])) {
$this->load->helper('force_ssl');
force_ssl();
}
# テスト環境かどうか
if ($this->is_test) {
$this->chk_test();
}
if (!$this->mobilemyclass->is_mobile() and !$this->mobilemyclass->is_smartphone()) {
$this->is_pc = TRUE;
}
//PCでSESSIDがGETについている場合、カットする
if (isset($_GET['sessid'])) {
unset($_GET['sessid']);
}
if ($_GET) {
$this->get_param = http_build_query($_GET);
}
if ($this->mobilemyclass->is_mobile()) {
// モバイルの場合の処理
// PCサイト専用の場合はエラーを返す
if ($this->only_pc) {
$this->load->library('emoji');
$this->message("PC専用ページです");
exit;
} elseif ($this->only_smartphone) {
$this->load->library('emoji');
$this->message("スマートフォン専用ページです");
exit;
}
} elseif ($this->mobilemyclass->is_smartphone()) {
//モバイルサイト専用の場合はエラーを返す
if ($this->only_mobile) {
$this->message("モバイル専用ページです");
exit;
}
//PCサイト専用の場合はエラーを返す
if ($this->only_pc) {
#print "PC Only Page";
$this->load->library('emoji');
$this->message("PC専用ページです");
exit;
}
//.........这里部分代码省略.........