当前位置: 首页>>代码示例>>PHP>>正文


PHP Mobile_Detect::version方法代码示例

本文整理汇总了PHP中Mobile_Detect::version方法的典型用法代码示例。如果您正苦于以下问题:PHP Mobile_Detect::version方法的具体用法?PHP Mobile_Detect::version怎么用?PHP Mobile_Detect::version使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mobile_Detect的用法示例。


在下文中一共展示了Mobile_Detect::version方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getMobileInformation

function getMobileInformation()
{
    $detect = new Mobile_Detect();
    $isMobile = "false";
    $isTablet = "false";
    $mobileOS = '';
    $mobileVersion = '';
    $versionIsSufficient = false;
    if ($detect->isMobile()) {
        $isMobile = "true";
        if ($detect->isTablet()) {
            $isTablet = "true";
        }
        if ($detect->isiOs()) {
            $mobileOS = 'iOS';
            $mobileVersion = $detect->version('iOS');
            $versionArray = explode('_', $mobileVersion);
            if ($versionArray[0] >= 6) {
                $versionIsSufficient = true;
            }
        } elseif ($detect->isAndroidOS()) {
            $mobileOS = 'Android';
            $mobileVersion = $detect->version('Android');
            $versionArray = explode('.', $mobileVersion);
            if ($versionArray[0] >= 4 && $versionArray[1] >= 1) {
                $versionIsSufficient = true;
            }
        } elseif ($detect->isWindowsPhoneOS()) {
            $mobileOS = 'WindowsPhoneOS';
            $mobileVersion = $detect->version('WindowsPhoneOS');
        } else {
            $mobileOS = 'Other mobile OS';
            $mobileVersion = 'NONE';
        }
    }
    return array('isMobile' => $isMobile, 'isTablet' => $isTablet, 'mobileOS' => $mobileOS, 'mobileVersion' => $mobileVersion, 'mobileIsSufficient' => $versionIsSufficient);
}
开发者ID:sgh1986915,项目名称:laravel-eyerideonline,代码行数:37,代码来源:functions.php

示例2: version

><?php 
    var_dump($check);
    ?>
</td>
            </tr>
        <?php 
}
?>
        </tbody>
        <tbody>
            <tr>
                <th colspan="2">Experimental version() method</th>
            </tr>
            <?php 
foreach ($detect->getProperties() as $name => $match) {
    $check = $detect->version($name);
    if ($check !== false) {
        ?>
            <tr>
                <td>version(<?php 
        echo $name;
        ?>
)</td>
                <td><?php 
        var_dump($check);
        ?>
</td>
            </tr>
            <?php 
    }
    ?>
开发者ID:ssrsfs,项目名称:blg,代码行数:31,代码来源:demo.php

示例3: testVersionExtraction

 /**
  * @dataProvider versionDataProvider
  * @covers Mobile_Detect::version
  */
 public function testVersionExtraction($userAgent, $property, $stringVersion, $floatVersion)
 {
     $md = new Mobile_Detect(array('HTTP_USER_AGENT' => $userAgent));
     $prop = $md->version($property);
     $this->assertSame($stringVersion, $prop);
     $prop = $md->version($property, 'float');
     $this->assertSame($floatVersion, $prop);
     //assert that garbage data is always === false
     $prop = $md->version('garbage input is always garbage');
     $this->assertFalse($prop);
 }
开发者ID:kennygrage,项目名称:dynastyDish,代码行数:15,代码来源:BasicsTest.php

示例4: doCheckBuyAndDownload

 function doCheckBuyAndDownload($config)
 {
     $objFormParam = new SC_FormParam();
     $this->lfInitParam($objFormParam);
     $objFormParam->setParam($_REQUEST);
     $objCustomer = new SC_Customer_Ex();
     $objQuery = SC_Query::getSingletonInstance();
     $detect = new Mobile_Detect();
     $version = $detect->version("iOS", Mobile_Detect::VERSION_TYPE_FLOAT);
     $contentid = $this->arrProduct["product_code_min"];
     $curl = $this->curl_init(KISEKAE_TOUCH_IPHONE_API01);
     $post = $this->getPost($config, array("contentid" => $contentid, "device" => $objFormParam->getValue("device_name", "iPhone6"), "version" => floor($version), "apiversion" => null, "operator" => "au", "lang" => "ja"));
     $this->getDs($post, $config);
     curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post));
     GC_Utils_Ex::gfPrintLog(print_r($post, TRUE), DEBUG_LOG_REALFILE);
     $result = curl_exec($curl);
     $status = SC_XML::xpath($result, "//status/@value");
     $vid = SC_XML::xpath($result, "//validation/@id");
     switch ($status) {
         default:
             SC_Utils_Ex::sfDispSiteError(PAGE_ERROR);
         case "000":
             GC_Utils_Ex::gfDebugLog($result);
             $_COOKIE["product_ktc_vid"] = $vid;
             break;
     }
     // API2
     $openid = $objCustomer->getValue("au_open_id");
     $curl = $this->curl_init(KISEKAE_TOUCH_IPHONE_API02);
     $post = $this->getPost($config, array("contentid" => $contentid, "userid" => $openid, "vid" => $vid));
     $this->getDs($post, $config);
     curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post));
     GC_Utils_Ex::gfPrintLog(print_r($post, TRUE), DEBUG_LOG_REALFILE);
     $result = curl_exec($curl);
     $status = SC_XML::xpath($result, "//status/@value");
     switch ($status) {
         default:
             SC_Utils_Ex::sfDispSiteError(PAGE_ERROR);
             break;
         case "000":
         case "010":
             // TEST
             // /ios/products/detail.php?mode=check_buy_and_download&product_id=13&classcategory_id1=0&classcategory_id2=0&quantity=1&admin=&favorite_product_id=&product_class_id=&device_name=iPhone6Plus&device_height=736&device_width=414&device_rate=3&device_lang=ja&ignore_redownload=1
             if ($_GET["ignore_redownload"] == "1") {
                 $status = "000";
             }
             break;
     }
     if ($status == "000") {
         // FIXME 課金処理
         // API03
         $curl = $this->curl_init(KISEKAE_TOUCH_IPHONE_API03);
         if ($objCustomer->getValue("buy_to_nopoint") == "1") {
             $price = $this->arrProduct["price02_min"];
             $settlementtype = "998";
             $redownloaddate = date("Ymd");
         } else {
             $price = $this->arrProduct["price02_min"];
             $settlementtype = "001";
             $redownloaddate = date("Ymd", strtotime($this->downloadable_days2));
         }
         $post = $this->getPost($config, array("contentid" => $contentid, "price" => $price, "redownloaddate" => $redownloaddate, "userid" => $openid, "vid" => $vid, "settlementtype" => $settlementtype));
         $this->getDs($post, $config);
         curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post));
         GC_Utils_Ex::gfPrintLog(print_r($post, TRUE), DEBUG_LOG_REALFILE);
         $result = curl_exec($curl);
         $authentication_id = SC_XML::xpath($result, "//authentication/@id");
         $objFormParam = new SC_FormParam();
         $this->setOrderParam($objFormParam, $vid, $authentication_id);
         $objFormParam->convParam();
         $message = '';
         $arrValBef = array();
         $objPurchase = new SC_Helper_Purchase_Ex();
         $objPurchase->saveShippingTemp(array());
         $order_id = $this->doRegister("", $objPurchase, $objFormParam, $message, $arrValBef);
         $customer_id = $objCustomer->getValue("customer_id");
         $this->addPointHistory($order_id, $customer_id, $objFormParam, $objQuery);
     } else {
         $authentication_id = SC_XML::xpath($result, "//authentication/@id");
     }
     $netUrl = new Net_URL(KISEKAE_TOUCH_IPHONE_CST02);
     $netUrl->addQueryString("aid", $authentication_id);
     $netUrl->addQueryString("cpid", $config["cpid"]);
     $netUrl->addQueryString("siteid", $config["siteid"]);
     $netUrl->addQueryString("contentid", $contentid);
     $netUrl->addQueryString("ts", date("YmdHis"));
     $post2 = $netUrl->querystring;
     $this->getDs($post2, $config);
     $netUrl->addRawQueryString(http_build_query($post2));
     GC_Utils_Ex::gfPrintLog(print_r($post2, TRUE), DEBUG_LOG_REALFILE);
     header("Location: " . $netUrl->getURL());
 }
开发者ID:alice-asahina,项目名称:kisekae_touch,代码行数:92,代码来源:LC_Page_iOS_Products_Detail.php

示例5: testUserAgents

 /**
  * @medium
  * @dataProvider userAgentData
  */
 public function testUserAgents($userAgent, $isMobile, $isTablet, $version, $model, $vendor)
 {
     //make sure we're passed valid data
     if (!is_string($userAgent) || !is_bool($isMobile) || !is_bool($isTablet)) {
         $this->markTestIncomplete("The User-Agent {$userAgent} does not have sufficient information for testing.");
         return;
     }
     //setup
     $md = new Mobile_Detect();
     $md->setUserAgent($userAgent);
     //is mobile?
     $this->assertEquals($md->isMobile(), $isMobile);
     //is tablet?
     $this->assertEquals($md->isTablet(), $isTablet, 'FAILED: ' . $userAgent . ' isTablet: ' . $isTablet);
     if (isset($version)) {
         foreach ($version as $condition => $assertion) {
             $this->assertEquals($assertion, $md->version($condition), 'FAILED UA (version("' . $condition . '")): ' . $userAgent);
         }
     }
     //version property tests
     if (isset($version)) {
         foreach ($version as $property => $stringVersion) {
             $v = $md->version($property);
             $this->assertSame($stringVersion, $v);
         }
     }
     //@todo: model test, not sure how exactly yet
     //@todo: vendor test. The below is theoretical, but fails 50% of the tests...
     /*if (isset($vendor)) {
           $method = "is$vendor";
           $this->assertTrue($md->{$method}(), "Expected Mobile_Detect::{$method}() to be true.");
       }*/
 }
开发者ID:ashutoshdev,项目名称:pickmeals-web,代码行数:37,代码来源:UserAgentTest.php

示例6: getOsVersion

 public function getOsVersion()
 {
     $detect = new Mobile_Detect();
     if ($this->getDeviceOs() == "IOS") {
         return $detect->version('iPhone');
     }
     if ($this->getDeviceOs() == "ANDROID") {
         return $detect->version('Android');
     }
     return 0;
 }
开发者ID:giangnh264,项目名称:mobileplus,代码行数:11,代码来源:DeviceManager.php

示例7: array

<?php

require_once '../Mobile_Detect.php';
/*
$detect = new Mobile_Detect;
$detect->setUserAgent('Mozilla/5.0 (iPhone; CPU iPhone OS 8_0_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) CriOS/38.0.2125.59 Mobile/12A405 Safari/600.1.4');
var_dump($detect->version('Chrome'));
var_dump($detect->version('iPhone'));
*/
/*
$user_agents = array(
    'android' => 'Mozilla/5.0 (Linux; Android 4.2; Nexus 7 Build/JOP40C) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Safari/535.19',
    'iphone6' => 'Mozilla/5.0 (iPhone; CPU iPhone OS 6_0_1 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A523 Safari/8536.25',
    'blackberry' => 'Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/10.0.9.2372 Mobile Safari/537.10+'
);
$mobile_detect = new Mobile_Detect;

foreach($user_agents as $user_agent)
{
    $mobile_detect->setUserAgent($user_agent);
    var_dump($mobile_detect->isAndroidOS());
}
*/
$detect = new Mobile_Detect();
//$detect->setUserAgent('Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko');
//var_dump($detect->version('IE'));
$detect->setUserAgent('Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; Touch; rv:11.0) like Gecko');
var_dump($detect->version('IE'));
开发者ID:juanmnl07,项目名称:treetopstravel_test,代码行数:28,代码来源:test.php

示例8: version

 /**
  * Check the version of the given property in the User-Agent.
  *
  * @inherit
  */
 public function version($propertyName, $type = self::VERSION_TYPE_STRING)
 {
     $check = key(static::$additionalProperties);
     // Check if the additional properties have been added already
     if (!array_key_exists($check, parent::$properties)) {
         // TODO: why is mergeRules not working here?
         parent::$properties = array_merge(parent::$properties, static::$additionalProperties);
     }
     return parent::version($propertyName, $type);
 }
开发者ID:giangnh264,项目名称:mobileplus,代码行数:15,代码来源:Agent.php

示例9: img_smart_image_shortcode

/**
 * Builds the Smart Image shortcode output.
 *
 * Allows a plugin to replace the content that would otherwise be returned. The
 * filter is 'img_smart_image_shortcode' and passes an empty string, the attr
 * parameter and the content parameter values.
 *
 * The supported attributes for the shortcode are 'id', 'align', 'width', and
 * 'caption'.
 *
 * @since 2.6.0
 *
 * @param array  $attr {
 *     Attributes of the caption shortcode.
 *
 *     @type string $id      ID of the div element for the caption.
 *     @type string $align   Class name that aligns the caption. Default 'alignnone'. Accepts 'alignleft',
 *                           'aligncenter', alignright', 'alignnone'.
 *     @type int    $width   The width of the caption, in pixels.
 *     @type string $caption The caption text.
 *     @type string $class   Additional class name(s) added to the caption container.
 * }
 * @param string $content Shortcode content.
 * @return string HTML content to display the caption.
 */
function img_smart_image_shortcode($attr, $content = null)
{
    // New-style shortcode with the caption inside the shortcode with the link and image tags.
    $image_meta = wp_get_attachment_metadata($attr['image_id']);
    //echo json_encode($image_meta);
    $mobile_detect = new Mobile_Detect();
    if ($mobile_detect->version('IE') === "8.0") {
        $image_large = wp_get_attachment_image_src($attr['image_id'], 'full');
        $final_image = '<img src="' . make_href_root_relative($image_large[0]) . '" class="aligncenter" />';
        return $final_image;
    }
    if (get_field('image_animated_png', $attr['image_id'])) {
        $image_large = wp_get_attachment_image_src($attr['image_id'], 'full');
        // See if the uploaded image is retina
        if (strpos($image_meta['file'], '@2x') > 0) {
            $attr['retina'] = true;
        }
        if (strpos($image_meta['file'], '@3x') > 0) {
            $attr['super_retina'] = true;
        }
        // If this image has bleed, but it's turned off
        if (!isset($attr['bleed']) || isset($attr['bleed']) && $attr['bleed'] === "false") {
            // set the image width if it's a retina image
            $css_max_width = isset($attr['retina']) && $attr['retina'] === true ? 'max-width:' . $image_large[1] / 2 . 'px;' : 'max-width:' . $image_large[1] . 'px;';
            $css_max_width = isset($attr['super_retina']) && $attr['super_retina'] === true ? 'max-width:' . $image_large[1] / 3 . 'px;' : $css_max_width;
            // set the image width if it's a standard image
            if (isset($attr['retina']) && $attr['retina'] !== true) {
                $css_max_width = isset($attr['width']) && $attr['width'] !== true ? 'max-width:' . $attr['width'] . 'px;' : $css_max_width;
            }
        } else {
            // otherwise, set bleed on.
            $has_bleed = ' has_bleed';
            $css_max_width = 'max-width:100%;';
        }
        $final_image = '<img src="' . make_href_root_relative($image_large[0]) . '" style="' . $css_max_width . '" class="aligncenter apng-image" />';
        return $final_image;
    }
    if ($image_meta) {
        // Return the svg instead of the smart iamge stuff here.
        if (strpos($image_meta['file'], '.svg') > 0) {
            $image_large = wp_get_attachment_image_src($attr['image_id'], 'full');
            $final_image = '<img src="' . $image_large[0] . '" class="' . $attr['class'] . '" />';
        } else {
            $image_meta = wp_get_attachment_metadata($attr['image_id']);
            // gets the images
            $image_large = wp_get_attachment_image_src($attr['image_id'], 'full');
            $image_md = wp_get_attachment_image_src($attr['image_id'], 'medium-hero-png');
            $image_sm = wp_get_attachment_image_src($attr['image_id'], 'small-hero-png');
            $placeholder = wp_get_attachment_image_src($attr['image_id'], 'apple-square-76');
            // update to
            // Sets up the images array
            $images = array('(min-width:1023px), (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi)' => make_href_root_relative($image_large[0]), '(min-width:1023px)' => make_href_root_relative($image_large[0]), '(min-width:1023px), (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi)' => make_href_root_relative($image_large[0]), '(min-width:1023px)' => make_href_root_relative($image_md[0]), '(max-width:640px), (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi)' => make_href_root_relative($image_md[0]), '(max-width:640px)' => make_href_root_relative($image_sm[0]));
            // encodes the images array for future use in Javascript
            $images = base64_encode(json_encode($images));
            // If this image has zoom enabled, we turn it on here.
            $has_zoom = isset($attr['zoom']) && $attr['zoom'] === 'true' ? true : false;
            $has_zoom = $has_zoom ? ' has_zoom' : '';
            $has_bleed = false;
            $background_color = get_field('image_preload_color', $attr['image_id']);
            $zoom_color = isset($attr['zoom']) && $attr['zoom'] === 'true' ? ' data-zoom_bg="' . $background_color . '"' : '';
            // if the image hasn't been uploaded through the dashboard, we make it so that a string is echo'd to find those bugs.
            echo $image_meta === false ? 'Looks like image ' . $attr['image_id'] . ' hasn\'t been uploaded through the dashboard.' : '';
            // Sets the maximum width of the current image.
            $css_max_width = ' style="max-width:100%"';
            // See if the uploaded image is retina
            if (strpos($image_meta['file'], '@2x') > 0) {
                $attr['retina'] = true;
            }
            if (strpos($image_meta['file'], '@3x') > 0) {
                $attr['super_retina'] = true;
            }
            // If this image has bleed, but it's turned off
            if (!isset($attr['bleed']) || isset($attr['bleed']) && $attr['bleed'] === "false") {
                // set the image width if it's a retina image
                $css_max_width = isset($attr['retina']) && $attr['retina'] === true ? 'max-width:' . $image_large[1] / 2 . 'px;' : 'max-width:' . $image_large[1] . 'px;';
//.........这里部分代码省略.........
开发者ID:aiganebraska,项目名称:The-Show,代码行数:101,代码来源:conf_shortcodes.php

示例10:

 function coll_body_class($classes)
 {
     global $coll_is_mobile;
     $classes[] = 'coll-custom-structure';
     if ($coll_is_mobile) {
         $classes[] = 'coll-mobile';
     }
     $coll_detect = new Mobile_Detect();
     if ($coll_detect->isiOS()) {
         $ver = $coll_detect->version('iOS');
         if ($ver[0] == 8) {
             $classes[] = 'coll-safari8';
         }
     }
     if (strpos($_SERVER['HTTP_USER_AGENT'], 'Safari') && !strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome')) {
         $ver = $coll_detect->version('Safari');
         if ($ver[0] == 8) {
             $classes[] = 'coll-safari8';
         }
     }
     return $classes;
 }
开发者ID:Air-Craft,项目名称:air-craft-www,代码行数:22,代码来源:utils.php

示例11: die

<?php

include 'Mobile_Detect.php';
$detect = new Mobile_Detect();
if ($detect->isiOS()) {
    echo "iOS has been detected<br>";
    if ($detect->isIpad()) {
        echo "It's an iPad, running version: " . $detect->version('iPad');
    }
    if ($detect->isIphone()) {
        echo "It's an iPhone, running version: " . $detect->version('iPhone');
    }
} else {
    die("No iOS detected.");
}
开发者ID:CrazyDev,项目名称:minewriter,代码行数:15,代码来源:iosTest.php

示例12: actionIndex

 public function actionIndex()
 {
     $newsModules = AppbymePoralModule::getModuleList();
     $forumList = ForumUtils::getForumListForHtml();
     $navInfo = AppbymeUIDiyModel::getNavigationInfo(true);
     $tempModules = AppbymeUIDiyModel::getModules(true);
     // 初始化默认配置
     if (empty($navInfo) || empty($navInfo['navItemList']) || empty($tempModules)) {
         $navInfo = AppbymeUIDiyModel::initNavigation();
         $tempModules = AppbymeUIDiyModel::initModules();
     }
     // 必须存在发现导航
     $hasDiscoverNavItem = false;
     foreach ($navInfo['navItemList'] as $navItem) {
         if ($navItem['moduleId'] == AppbymeUIDiyModel::MODULE_ID_DISCOVER) {
             $hasDiscoverNavItem = true;
             break;
         }
     }
     !$hasDiscoverNavItem && array_unshift($navInfo['navItemList'], AppbymeUIDiyModel::initNavItemDiscover());
     // 必须存在发现和快发模块
     $isFindDiscover = $isFindFastpost = false;
     $discoverModule = AppbymeUIDiyModel::initDiscoverModule();
     $fastpostModule = AppbymeUIDiyModel::initFastpostModule();
     $modules = array();
     foreach ($tempModules as $module) {
         switch ($module['id']) {
             case AppbymeUIDiyModel::MODULE_ID_DISCOVER:
                 if (!$isFindDiscover) {
                     $isFindDiscover = true;
                     $discoverModule = $module;
                 }
                 break;
             case AppbymeUIDiyModel::MODULE_ID_FASTPOST:
                 if (!$isFindFastpost) {
                     $isFindFastpost = true;
                     $fastpostModule = $module;
                 }
                 break;
             default:
                 $modules[] = $module;
                 break;
         }
     }
     array_unshift($modules, $discoverModule, $fastpostModule);
     // 检测浏览器信息
     $mobileDetect = new Mobile_Detect();
     $browserInfo = $mobileDetect->version('Chrome');
     $this->renderPartial('index', array('navInfo' => $navInfo, 'modules' => $modules, 'newsModules' => $newsModules, 'forumList' => $forumList, 'browserInfo' => $browserInfo, 'appLevel' => AppUtils::getAppLevel(), 'topicTypeSortInfos' => $this->_getTopicTypeSortInfos()));
 }
开发者ID:caidongyun,项目名称:CS,代码行数:50,代码来源:UIDiyController.php

示例13: init


//.........这里部分代码省略.........
             $this->tpl_customer_id = 0;
             $this->tpl_first_buy_date = null;
             $this->tpl_carrier = 9;
             $this->arrRedownloadProduct = array();
         }
         $objDb = new SC_Helper_DB_Ex();
         if ($objDb->sfColumnExists("cp_dtb_customer_transaction", "id")) {
             $where = " customer_id =  ? AND transaction_status =  ? AND continue_account_id IS NOT NULL AND del_flg = 0";
             $arrWhereVal = array($this->tpl_customer_id, 40);
             if ($objQuery->exists("cp_dtb_customer_transaction", $where, $arrWhereVal)) {
                 // OK
             } else {
                 switch (basename(dirname($_SERVER["SCRIPT_NAME"]))) {
                     case "au":
                         break;
                     default:
                         if ($objCustomer->isLoginSuccess()) {
                             $objCustomer->EndSession();
                             SC_Response_Ex::reload();
                         }
                         break;
                 }
             }
         }
         $objCategory = new SC_Helper_Category_Ex();
         $this->arrCommonCategory = $objCategory->getList(true);
         $this->arrCommonCategoryTree = $objCategory->getTree();
         $detect = new Mobile_Detect();
         $script_file = $_SERVER["SCRIPT_NAME"];
         $script_file = ltrim($script_file, "/");
         $script_file2 = str_replace("ios/", "", $script_file);
         if ($detect->is("iOS")) {
             if (file_exists(HTML_REALDIR . "ios/{$script_file}")) {
                 SC_Response_Ex::sendRedirect(HTTP_URL . "ios/{$script_file}", $_GET);
             }
         } elseif (strcmp($script_file, $script_file2) !== 0) {
             SC_Response_Ex::sendRedirect(HTTP_URL . "{$script_file2}", $_GET);
         }
         $_SESSION["is_android"] = $detect->is("AndroidOS");
         if ($detect->isMobile() == false) {
             // NG
             $this->device_support = false;
         } elseif ($detect->is("iOS")) {
             if ($detect->match("iPhone")) {
                 // OK
                 $this->device_support = true;
             } elseif ($detect->match("iPod")) {
                 // NG
                 $this->device_support = false;
             } elseif ($detect->match("iPad")) {
                 // NG
                 $this->device_support = false;
             } else {
                 // NG
                 $this->device_support = false;
             }
             $version = $detect->version("iOS", $detect::VERSION_TYPE_FLOAT);
             if ($version < 6) {
                 // NG
                 $this->device_support = false;
             }
         } elseif ($detect->match("Android") == false) {
             // NG
             $this->device_support = false;
         } elseif (class_exists("SC_DeviceAndroidSelect_Ex", true)) {
             $useragent = array();
             if (preg_match("|.*; ([^;]+) Build/.*|", $_SERVER["HTTP_USER_AGENT"], $useragent)) {
                 $device = new SC_DeviceAndroidSelect_Ex(array("search_device_user_agent_word" => $useragent[1], "search_status" => 1));
                 $this->device_support = $device->exists();
                 $this->tpl_device = $device->getOne();
             }
         } elseif ($detect->match("Android")) {
             // OK
             $this->device_support = true;
         } else {
             // NG
             $this->device_support = false;
         }
     }
     if ($this->device_support) {
         GC_Utils_Ex::gfPrintLog("対応端末:" . $_SERVER['HTTP_USER_AGENT']);
         return;
     } else {
         GC_Utils_Ex::gfPrintLog("非対応端末:" . $_SERVER['HTTP_USER_AGENT']);
         if (is_a($this, "LC_Page_Index")) {
             SC_Response_Ex::sendRedirect(HTTP_URL . "unsupported/index.php");
         } elseif (is_a($this, "LC_Page_Unsupported")) {
             // 非対応端末表示を行わない
             return;
         } elseif (is_a($this, "LC_Page_Entry_Kiyaku")) {
             // 非対応端末表示を行わない
             return;
         } elseif ($this->not_unsupported) {
             // 非対応端末表示を行わない
             return;
         } else {
             SC_Response_Ex::sendRedirect(HTTP_URL . "unsupported/index.php");
         }
     }
 }
开发者ID:alice-asahina,项目名称:kisekae_touch,代码行数:101,代码来源:LC_Page_Ex.php

示例14:

<?php

include_once 'libraries/Mobile-Detect-2.8.15/Mobile_Detect.php';
$detect = new Mobile_Detect();
if (!$detect->isMobile()) {
    echo "PC: play.stdio.vn";
} else {
    if ($detect->isTablet()) {
        echo "TABLET: ";
        if ($detect->version("Windows Phone")) {
            echo "Windows Phone 8";
        } else {
            if ($detect->isiOS()) {
                echo "iOS";
            } else {
                if ($detect->isAndroidOS()) {
                    echo "Android";
                }
            }
        }
    } else {
        echo "PHONE: ";
        if ($detect->version("Windows Phone")) {
            echo "Windows Phone 8";
        } else {
            if ($detect->isiOS()) {
                echo "iOS";
            } else {
                if ($detect->isAndroidOS()) {
                    echo "Android";
                }
开发者ID:hieunhan1,项目名称:all-website4,代码行数:31,代码来源:code_mau.php

示例15: jQuery

}
?>
    
    <?php 
if ($detect->isMobile() || $detect->isTablet()) {
    ?>
    <script src="<?php 
    echo $this->baseurl . '/templates/' . $this->template . '/js/desktop-mobile.js';
    ?>
"></script>
    <?php 
}
?>
    
    <?php 
if (!$detect->isMobile() && !$detect->isTablet() && ((int) $detect->version('IE') == '' || (int) $detect->version('IE') > 8)) {
    ?>
    <script src="<?php 
    echo $this->baseurl . '/templates/' . $this->template . '/js/jquery.simplr.smoothscroll.stellar.modernizr.min.js';
    ?>
"></script>  
    
    <script>
    jQuery(function($) {
		if (!Modernizr.touch) {
		$.srSmoothscroll({ease: 'easeOutQuart'});
		$(window).load(function(){
		$.stellar({responsive: true,horizontalScrolling: false});
		});
		}
    });
开发者ID:jdrzaic,项目名称:joomla-dummy,代码行数:31,代码来源:index.php


注:本文中的Mobile_Detect::version方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。