本文整理汇总了PHP中Mobile_Detect::isWindowsPhoneOS方法的典型用法代码示例。如果您正苦于以下问题:PHP Mobile_Detect::isWindowsPhoneOS方法的具体用法?PHP Mobile_Detect::isWindowsPhoneOS怎么用?PHP Mobile_Detect::isWindowsPhoneOS使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mobile_Detect
的用法示例。
在下文中一共展示了Mobile_Detect::isWindowsPhoneOS方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2: array
/**
* Loads cookie and sets up theme filters.
*/
static function setup_theme() {
global $wpdb;
$tablemobility = $wpdb->prefix.'ult25_mobile';
$browser = new Mobile_Detect;
if($browser->isMobile()){
if(isset($_REQUEST['theme'])): // click desktop
self::set_theme_onclick();
endif;
self::load_cookie();
if ( ! empty( self::$theme ) ) :
add_filter( 'pre_option_template', array( self::$theme, 'get_template' ) );
add_filter( 'pre_option_stylesheet', array( self::$theme, 'get_stylesheet' ) );
add_filter( 'pre_option_stylesheet_root', array( self::$theme, 'get_theme_root' ) );
$parent = self::$theme->parent();
if( empty( $parent ) )
add_filter( 'pre_option_template_root', array( self::$theme, 'get_theme_root' ) );
else
add_filter( 'pre_option_template_root', array( $parent, 'get_theme_root' ) );
add_filter( 'pre_option_current_theme', '__return_false' );
else:
/*
* isAndroidOS() bool(false)
* isBlackBerryOS() bool(false)
* isPalmOS() bool(false)
* isSymbianOS() bool(false)
* isWindowsMobileOS() bool(false)
* isWindowsPhoneOS() bool(false)
* isiOS() bool(false)
*/
$browsing = false;
if($browser->isiPad()){
$browsing = 'iPad';
} elseif ($browser->isiPhone()){
$browsing= 'iPhone';
} elseif ($browser->isAndroidOS()){
if($browser->isTablet()){
$browsing = 'AndroidTablet';
} else {
$browsing = 'Android';
}
} elseif ($browser->isWindowsMobileOS() || $browser->isWindowsPhoneOS()){
if($browser->isTablet()){
$browsing = 'WindowsTablet';
} else {
$browsing = 'Windows';
}
} elseif ($browser->isBlackBerryOS()){
$browsing = 'BlackBerry';
}
if($browsing){
$mobilethemeq = "SELECT * FROM `".$tablemobility."` WHERE `device`='$browsing'";
$mfetch=$wpdb->get_row($mobilethemeq);
if($mfetch){
$theme = wp_get_theme( $mfetch->theme );
if (
$theme->exists()
&& $theme->get( 'Name' ) != get_option( 'current_theme' )
&& self::is_allowed( $theme )
) {
self::$theme = $theme;
add_filter( 'pre_option_template', array( self::$theme, 'get_template' ) );
add_filter( 'pre_option_stylesheet', array( self::$theme, 'get_stylesheet' ) );
add_filter( 'pre_option_stylesheet_root', array( self::$theme, 'get_theme_root' ) );
$parent = self::$theme->parent();
if( empty( $parent ) )
add_filter( 'pre_option_template_root', array( self::$theme, 'get_theme_root' ) );
else
add_filter( 'pre_option_template_root', array( $parent, 'get_theme_root' ) );
add_filter( 'pre_option_current_theme', '__return_false' );
add_action('ultimatum_meta', 'ultimatum_add_noscale_meta');
add_action('ultimatum_meta', 'ultimatum_web_app_meta');
if($mfetch->mpush==1){
//add_action('ultimatum_meta', 'ultimatum_web_app_bubble');
//add_action('ultimatum_before_body_close','ultimatum_web_app_link_hider');
}
}
}
}
endif;
}
if ( self::can_switch_themes() ) {
self::load_cookie();
if ( ! empty( self::$theme ) ) {
add_filter( 'pre_option_template', array( self::$theme, 'get_template' ) );
add_filter( 'pre_option_stylesheet', array( self::$theme, 'get_stylesheet' ) );
add_filter( 'pre_option_stylesheet_root', array( self::$theme, 'get_theme_root' ) );
$parent = self::$theme->parent();
//.........这里部分代码省略.........
示例3: get_device_name
//.........这里部分代码省略.........
}
if ($detect->isbqTablet()) {
$name = 'bq';
break;
}
if ($detect->isHuaweiTablet()) {
$name = 'Huawei';
break;
}
if ($detect->isNecTablet()) {
$name = 'Nec';
break;
}
if ($detect->isPantechTablet()) {
$name = 'Pantech';
break;
}
if ($detect->isBronchoTablet()) {
$name = 'Broncho';
break;
}
if ($detect->isVersusTablet()) {
$name = 'Versus';
break;
}
if ($detect->isZyncTablet()) {
$name = 'Zync';
break;
}
if ($detect->isPositivoTablet()) {
$name = 'Positivo';
break;
}
if ($detect->isNabiTablet()) {
$name = 'Nabi';
break;
}
if ($detect->isPlaystationTablet()) {
$name = 'Playstation';
break;
}
if ($detect->isGenericTablet()) {
$name = 'Generic';
break;
}
if ($detect->isAndroidOS()) {
$name = 'Android';
break;
}
if ($detect->isBlackBerryOS()) {
$name = 'BlackBerry';
break;
}
if ($detect->isPalmOS()) {
$name = 'Plam';
break;
}
if ($detect->isSymbianOS()) {
$name = 'Symbian';
break;
}
if ($detect->isWindowsMobileOS()) {
$name = 'WindowsMobile';
break;
}
if ($detect->isWindowsPhoneOS()) {
$name = 'WindowsPhone';
break;
}
if ($detect->isiOS()) {
$name = 'iOS';
break;
}
if ($detect->isMeeGoOS()) {
$name = 'MeeGo';
break;
}
if ($detect->isMaemoOS()) {
$name = 'Maemo';
break;
}
if ($detect->isJavaOS()) {
$name = 'JavaOS';
break;
}
if ($detect->iswebOS()) {
$name = 'WebOS';
break;
}
if ($detect->isbadaOS()) {
$name = 'badaOS';
break;
}
if ($detect->isBREWOS()) {
$name = 'BREWOS';
break;
}
} while (false);
return $name . ' ' . $deviceType;
}