Esempio n. 1
0
<meta name="google-site-verification"
	content="9AtqvB-LWohGnboiTyhtZUXAEcOql9B-8lDjo_wcUew" />
<link rel="stylesheet" href="foundation/css/foundation.min.css" />
<link rel="stylesheet" href="openlayers/ol.css" />
<link rel="stylesheet" href="css/styleIndex.css" />
<script src="foundation/js/vendor/modernizr.js"></script>
</head>
<body>
	<div class="row">
		<div id="controlpanel" class="large-3 large-push-9 columns">
			<div class="row center">
				<img src="images/kiri200.png" alt="KIRI logo"/>
			</div>
			<?php 
$detect = new Mobile_Detect();
if ($detect->isAndroidOS() && !$detect->isWindowsMobileOS()) {
    ?>
			<div class="row">
				<div class="large-12 columns">
					<div data-alert class="alert-box secondary round">
					<?php 
    echo $index_getapp['android'];
    ?>
					<a href="#" class="close">&times;</a>
					</div>
				</div>
			</div>
			<?php 
}
?>
			<div class="row">
Esempio n. 2
0
	/**
	 * 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();

				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' );
			}
		}
	}
Esempio n. 3
0
 public function checkWindowsMobileOS()
 {
     require_once Mage::getBaseDir('lib') . DS . 'em/Mobile_Detect.php';
     $detect = new Mobile_Detect();
     $checkWP = $detect->isWindowsMobileOS();
     if ($checkWP) {
         return true;
     } else {
         return false;
     }
 }
Esempio n. 4
0
function get_device_name($userAgent)
{
    $detect = new Mobile_Detect();
    $detect->setUserAgent($userAgent);
    $deviceType = $detect->isMobile() ? $detect->isTablet() ? 'tablet' : 'cell' : 'computer';
    if ($deviceType == 'computer') {
        return $deviceType;
    }
    $name = 'unknow';
    do {
        if ($detect->isiPhone()) {
            $name = 'iPhone';
            break;
        }
        if ($detect->isBlackBerry()) {
            $name = 'BlackBerry';
            break;
        }
        if ($detect->isHTC()) {
            $name = 'HTC';
            break;
        }
        if ($detect->isNexus()) {
            $name = 'Nexus';
            break;
        }
        if ($detect->isDell()) {
            $name = 'Dell';
            break;
        }
        if ($detect->isMotorola()) {
            $name = 'Motorola';
            break;
        }
        if ($detect->isSamsung()) {
            $name = 'Samsung';
            break;
        }
        if ($detect->isLG()) {
            $name = 'LG';
            break;
        }
        if ($detect->isSony()) {
            $name = 'Sony';
            break;
        }
        if ($detect->isAsus()) {
            $name = 'Asus';
            break;
        }
        if ($detect->isPalm()) {
            $name = 'Palm';
            break;
        }
        if ($detect->isVertu()) {
            $name = 'Vertu';
            break;
        }
        if ($detect->isPantech()) {
            $name = 'Pantech';
            break;
        }
        if ($detect->isFly()) {
            $name = 'Fly';
            break;
        }
        if ($detect->isSimValley()) {
            $name = 'SimValley';
            break;
        }
        if ($detect->isGenericPhone()) {
            $name = 'Generic';
            break;
        }
        if ($detect->isiPad()) {
            $name = 'iPad';
            break;
        }
        if ($detect->isNexusTablet()) {
            $name = 'Nexus';
            break;
        }
        if ($detect->isSamsungTablet()) {
            $name = 'Samsung';
            break;
        }
        if ($detect->isKindle()) {
            $name = 'Kindle';
            break;
        }
        if ($detect->isSurfaceTablet()) {
            $name = 'Surface';
            break;
        }
        if ($detect->isAsusTablet()) {
            $name = 'Asus';
            break;
        }
        if ($detect->isBlackBerryTablet()) {
            $name = 'BlackBerry';
            break;
        }
        if ($detect->isHTCtablet()) {
            $name = 'HTC';
            break;
        }
        if ($detect->isMotorolaTablet()) {
            $name = 'Motorola';
            break;
        }
        if ($detect->isNookTablet()) {
            $name = 'Nook';
            break;
        }
        if ($detect->isAcerTablet()) {
            $name = 'Acer';
            break;
        }
        if ($detect->isToshibaTablet()) {
            $name = 'Toshiba';
            break;
        }
        if ($detect->isLGTablet()) {
            $name = 'LG';
            break;
        }
        if ($detect->isYarvikTablet()) {
            $name = 'Yarvik';
            break;
        }
        if ($detect->isMedionTablet()) {
            $name = 'Medion';
            break;
        }
        if ($detect->isArnovaTablet()) {
            $name = 'Arnova';
            break;
        }
        if ($detect->isArchosTablet()) {
            $name = 'Archos';
            break;
        }
        if ($detect->isAinolTablet()) {
            $name = 'Ainol';
            break;
        }
        if ($detect->isSonyTablet()) {
            $name = 'Sony';
            break;
        }
        if ($detect->isCubeTablet()) {
            $name = 'Cube';
            break;
        }
        if ($detect->isCobyTablet()) {
            $name = 'Coby';
            break;
        }
        if ($detect->isSMiTTablet()) {
            $name = 'SMiT';
            break;
        }
        if ($detect->isRockChipTablet()) {
            $name = 'RockChip';
            break;
        }
        if ($detect->isTelstraTablet()) {
            $name = 'Telstra';
            break;
        }
        if ($detect->isFlyTablet()) {
            $name = 'Fly';
            break;
        }
        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;
}