Esempio n. 1
0
 public static function getMobileOs()
 {
     $deviceOs = "";
     if (isset($_SERVER['AMF_DEVICE_OS'])) {
         // APACHE MOBILE FILTER IS INSTALLED
         $deviceOs = $_SERVER['AMF_DEVICE_OS'];
         if (stripos($deviceOs, "iphone") !== false) {
             $deviceOs = "IOS";
         } else {
             if (stripos($deviceOs, "android") !== false) {
                 $deviceOs = "ANDROIDOS";
             }
         }
     } else {
         $detect = new Mobile_Detect();
         if ($detect->isiOS()) {
             $deviceOs = "IOS";
         } else {
             if ($detect->isAndroidOS()) {
                 $deviceOs = "ANDROIDOS";
             }
         }
     }
     return $deviceOs;
 }
 function isAndroidOS()
 {
     // instantiate Mobile_Detect Object
     $detect = new \Mobile_Detect();
     // determine if the device is Android
     $isAndroidOS = $detect->isAndroidOS() ? true : false;
     // return true or false
     return $isAndroidOS;
 }
Esempio n. 3
0
 public function detect()
 {
     $detect = new Mobile_Detect();
     if ($detect->isiOS()) {
         $this->device = 'ios';
     }
     if ($detect->isAndroidOS()) {
         $this->device = 'android';
     }
     return $this->device;
 }
Esempio n. 4
0
function detectmobile()
{
    $detect = new Mobile_Detect();
    $mobile = $detect->isMobile();
    $tablet = $detect->isTablet();
    if ($detect->isAndroidOS()) {
        //elgg_extend_view( 'forms/login'   , 'mobile_app/login' );
        //elgg_extend_view( 'forms/register', 'mobile_app/login' );
    }
    if ($mobile == true && $tablet == false) {
        return true;
    } else {
        return false;
    }
}
Esempio n. 5
0
 /**
  * Distributor Function
  */
 public function distribute()
 {
     $detect = new Mobile_Detect();
     if ($detect->isiOS()) {
         $finalURL = strlen($this->iOSURL) > 0 ? $this->iOSURL : (strlen($this->optionalURL) > 0 ? $this->optionalURL : $this->androidURL);
         $this->redirect($finalURL);
     } else {
         if ($detect->isAndroidOS()) {
             $finalURL = '';
             // To open de Market Place for Android devices, we must transform the original URL into a URL Scheme
             if (strlen($this->androidURL) > 0) {
                 $urlQuery = parse_url($this->androidURL, PHP_URL_QUERY);
                 $finalURL = "market://details?" . $urlQuery;
             } else {
                 $finalURL = strlen($this->optionalURL) > 0 ? $this->optionalURL : $this->iOSURL;
             }
             $this->redirect($finalURL);
         } else {
             $finalURL = strlen($this->optionalURL) > 0 ? $this->optionalURL : (strlen($this->androidURL) > 0 ? $this->androidURL : $this->iOSURL);
             $this->redirect($finalURL);
         }
     }
 }
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);
}
Esempio n. 7
0
 public function getrenderv1()
 {
     $cr = 0;
     $path_model = NULL;
     $status_array = array();
     $color_array = array('r' => NULL, 'l' => NULL);
     $this->load->helper(array('printerstate', 'slicer'));
     // 		$status_array = PrinterState_checkStatusAsArray();
     // 		// check if we are in sliced status, assign colors if so
     // 		if ($status_array[PRINTERSTATE_TITLE_STATUS] == CORESTATUS_VALUE_SLICED
     // 				&& array_key_exists(PRINTERSTATE_TITLE_EXTEND_PRM, $status_array)) {
     // 			// check all extruders
     // 			foreach (array('r' => PRINTERSTATE_TITLE_EXT_LENG_R, 'l' => PRINTERSTATE_TITLE_EXT_LENG_L)
     // 					as $abb_cartridge => $status_length) {
     // 				// check if we use selected extruder
     // 				if (array_key_exists($status_length, $status_array[PRINTERSTATE_TITLE_EXTEND_PRM])) {
     // 					$json_cartridge = array();
     // 					$ret_val = PrinterState_getCartridgeAsArray($json_cartridge, $abb_cartridge);
     // 					// check if cartridge info is all right
     // 					if (in_array($ret_val, array(
     // 							ERROR_OK, ERROR_MISS_LEFT_FILA, ERROR_MISS_RIGT_FILA,
     // 							ERROR_LOW_LEFT_FILA, ERROR_LOW_RIGT_FILA,
     // 					))) {
     // 						$color_array[$abb_cartridge] = $json_cartridge[PRINTERSTATE_TITLE_COLOR];
     // 					}
     // 				}
     // 			}
     // 		}
     // check existed file for time-saving
     foreach (array(SLICER_FILE_PREVIEW_M, SLICER_FILE_PREVIEW_S) as $filename) {
         $path_model = $this->config->item('temp') . $filename;
         if (file_exists($path_model)) {
             $cr = ERROR_OK;
             break;
         }
     }
     if ($cr != ERROR_OK) {
         $cr = Slicer_exportRenderModel($path_model, $color_array['r'], $color_array['l']);
     }
     if ($cr == ERROR_OK) {
         if (file_exists($path_model)) {
             // check mobile device and assign max filesize limit
             @(include_once BASEPATH . '/../assets/mobile_detect.php');
             // check system only if class is well loaded, ignore limit if loading error
             if (class_exists('Mobile_Detect')) {
                 $detect_os = new Mobile_Detect();
                 $size_limit = NULL;
                 if ($detect_os->isiOS()) {
                     $size_limit = 9437184;
                     // 9M
                 } else {
                     if ($detect_os->isAndroidOS()) {
                         $size_limit = 83886080;
                         // 80M
                     }
                 }
                 if ($size_limit && $size_limit < filesize($path_model)) {
                     $cr = ERROR_WRONG_PRM;
                 }
             }
             if ($cr == ERROR_OK) {
                 $fileinfo = pathinfo($path_model);
                 $fileext = NULL;
                 if (is_array($fileinfo) && isset($fileinfo['extension']) && in_array(strtolower($fileinfo['extension']), array('stl', 'amf'))) {
                     $fileext = strtolower($fileinfo['extension']);
                 } else {
                     $fileext = 'bin';
                 }
                 $this->_sendFileContent($path_model, 'rendering.' . $fileext);
                 return;
             }
         } else {
             $this->load->helper('printerlog');
             PrinterLog_logError('export render model function returns ok, but file not found', __FILE__, __LINE__);
             $cr = ERROR_INTERNAL;
         }
     }
     $this->_return_cr($cr);
     return;
 }
Esempio n. 8
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. 9
0
 /**
  * Post Media Div - Media Div For Posts That Auto-bootstraps
  * OPTS: $opts['link'] = array("href"=>"","target"=>""); - Link Override For Image Post
  */
 public function postMediaDiv($Dailyop, $opts = array())
 {
     App::import("Vendor", "Mobile_Detect", array("file" => "Mobile_Detect.php"));
     $MobileDetect = new Mobile_Detect();
     $template = $Dailyop['Dailyop']['post_template'];
     if (isset($opts['MediaFile'])) {
         $MediaFile = $opts['MediaFile'];
         unset($opts['MediaFile']);
     } else {
         $MediaFile = $Dailyop['DailyopMediaItem'][0]['MediaFile'];
     }
     $platform = "computer";
     //do some platform detection
     if ($MobileDetect->isAndroidOS()) {
         $platform = "android";
     } else {
         if ($MobileDetect->isiOS()) {
             $platform = "ios";
         }
     }
     //merge in default attributes with sent in attr's
     $opts = array_merge(array("data-media-file-id" => $MediaFile['id'], "data-dailyop-id" => $Dailyop['Dailyop']['id'], "data-dailyop-section-id" => $Dailyop['Dailyop']['dailyop_section_id'], "data-media-type" => $MediaFile['media_type'], "data-slide-show" => $Dailyop['Dailyop']['slide_show'], "data-platform" => $platform, "data-dailyop-display-weight" => 1, "class" => "post-media-div", "id" => "media-file-div-" . $MediaFile['id']), $opts);
     //if(isset($Dailyop['Dailyop']['ondemand_title_id']) && !empty($Dailyop['Dailyop']['ondemand_title_id']))
     //	$opts['data-ondemand-title-id'] = $Dailyop['Dailyop']['ondemand_title_id'];
     //check for lazy load
     $lazy = false;
     if (isset($opts['lazy'])) {
         $lazy = $opts['lazy'];
     }
     $w = 700;
     //do width adjustments based on the template
     switch (strtolower($template)) {
         case 'large':
             $w = 1114;
             break;
     }
     unset($opts['lazy']);
     $poster = $this->Media->mediaThumbSrc(array("MediaFile" => $MediaFile, "w" => $w, "type" => $template));
     $img = $this->Media->mediaThumb(array("MediaFile" => $MediaFile, "w" => $w, "type" => $template, "lazy" => $lazy), array("class" => $MobileDetect->isMobile() ? "html5" : "swf"));
     $opts['data-poster-file'] = $poster;
     switch (strtolower($MediaFile['media_type'])) {
         case 'img':
             $hover = "<div class='img-hover'></div>";
             $img = $hover . $img;
             if (!empty($Dailyop['Dailyop']['url']) || isset($opts['link'])) {
                 if (isset($opts['link'])) {
                     $href = $opts['link']['href'];
                     $target = $opts['link']['target'];
                 } else {
                     $href = $Dailyop['Dailyop']['url'];
                     $target = $Dailyop['Dailyop']['window_target'];
                 }
                 $img = "<a href='{$href}' target='{$target}' >{$img}</a>";
             }
             break;
         case "bcove":
             $hover = "<div class='play-button'></div><div class='video-hover'></div>";
             $img = $hover . $img;
             break;
     }
     return $this->Html->tag("div", $img, $opts);
 }
Esempio n. 10
0
 public function beforeFilter()
 {
     parent::beforeFilter();
     if (Configure::read('unloadDebugKit') == true) {
         $this->Components->unload('DebugKit.Toolbar');
     }
     // language initialization
     $language_list = Configure::read('Config.languageList');
     $this->language = $language_list[Configure::read('Config.language')]['code'];
     if (isset($this->params['language'])) {
         foreach ($language_list as $locale => $language) {
             if ($language['active'] && $language['code'] == $this->params['language']) {
                 $this->language = $this->params['language'];
                 Configure::write('Config.language', $locale);
                 break;
             }
         }
     }
     // set language
     $this->set('language', $this->language);
     $this->set('language_list', $language_list);
     $this->Session->write('Config.language', $this->language);
     // Detect device
     $Mobile_Detect = new Mobile_Detect();
     $this->device_info = 'Desktop';
     $this->device_browser = '';
     $this->device_info_type = '';
     if ($Mobile_Detect->isTablet()) {
         $this->device_info = 'Tablet';
         if ($Mobile_Detect->isiPad()) {
             $this->device_info_type = 'Ipad';
         } else {
             if ($Mobile_Detect->isAndroidOS()) {
                 $this->device_info_type = 'Android';
             } else {
                 $this->device_info_type = 'others';
             }
         }
     } else {
         if ($Mobile_Detect->isMobile()) {
             $this->device_info = 'Mobile';
             if ($Mobile_Detect->isiPhone()) {
                 $this->device_info_type = 'Iphone';
             } else {
                 if ($Mobile_Detect->isAndroidOS()) {
                     $this->device_info_type = 'Android';
                 } else {
                     $this->device_info_type = 'others';
                 }
             }
         }
     }
     if ($Mobile_Detect->isChrome() && $Mobile_Detect->isSafari()) {
         $this->device_browser = 'AndroidDefault';
     } else {
         if ($Mobile_Detect->isChrome()) {
             $this->device_browser = 'Chrome';
         } else {
             if ($Mobile_Detect->isSafari()) {
                 $this->device_browser = 'Safari';
             } else {
                 if ($Mobile_Detect->isIE()) {
                     $this->device_browser = 'IE';
                 } else {
                     if ($Mobile_Detect->isFirefox()) {
                         $this->device_browser = 'Firefox';
                     } else {
                         if ($Mobile_Detect->isOpera()) {
                             $this->device_browser = 'Opera';
                         } else {
                             $this->device_browser = 'others';
                         }
                     }
                 }
             }
         }
     }
     $this->set('device_info', $this->device_info);
     $this->set('device_info_type', $this->device_info_type);
     $this->set('device_browser', $this->device_browser);
     //GA account
     $ga_account = Configure::read('ga_account');
     $this->set('ga_account', !empty($ga_account[$this->language]) ? $ga_account[$this->language] : '');
     //FB_appID
     $FB_appID = Configure::read('FB_appID');
     $this->set('FB_appID', $FB_appID);
 }
Esempio n. 11
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;
}
Esempio n. 12
0
<?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";
                }
Esempio n. 13
0
File: demo.php Progetto: u0mo5/app
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 * -----------------------------------------------------------------------
 * The demo is running all the Mobile_Detect's internal methods.
 * Here you can spot detections errors instantly.
 * -----------------------------------------------------------------------
 *
 * @author      Serban Ghita <*****@*****.**>
 * @license     MIT License https://github.com/serbanghita/Mobile-Detect/blob/master/LICENSE.txt
 *
 */
require_once './Mobile_Detect.php';
$detect = new Mobile_Detect();
$deviceType = $detect->isMobile() ? $detect->isTablet() ? 'tablet' : 'phone' : 'computer';
$scriptVersion = $detect->getScriptVersion();
if ($deviceType == 'computer') {
    $arr = array('os' => "pc");
    echo json_encode($arr);
} elseif ($detect->isAndroidOS()) {
    $arr = array('os' => "Android");
    echo json_encode($arr);
} elseif ($detect->isiOS()) {
    $arr = array('os' => "ios");
    echo json_encode($arr);
}
Esempio n. 14
0
function set_device($user_agent)
{
    global $request_settings;
    $key = 'di_' . $user_agent;
    $cache_result = get_cache($key);
    if ($cache_result) {
        if (isset($cache_result['device_os'])) {
            $request_settings['device_os'] = $cache_result['device_os'];
        }
        $request_settings['main_device'] = $cache_result['main_device'];
        return true;
    }
    error_reporting(0);
    require_once 'modules/devicedetection/Mobile_Detect.php';
    $detect = new Mobile_Detect($user_agent);
    if ($detect->isIphone()) {
        $temp['device_os'] = get_device_osversion(1, $user_agent);
        $temp['main_device'] = 'IPHONE';
    } else {
        if ($detect->isIpad()) {
            $temp['device_os'] = get_device_osversion(1, $user_agent);
            $temp['main_device'] = 'IPAD';
        } else {
            if ($detect->isIpod()) {
                $temp['device_os'] = get_device_osversion(1, $user_agent);
                $temp['main_device'] = 'IPOD';
            } else {
                if ($detect->isAndroidOS()) {
                    $temp['device_os'] = get_device_osversion(2, $user_agent);
                    $temp['main_device'] = 'ANDROID';
                } else {
                    if ($detect->ismobile()) {
                        $temp['main_device'] = 'OTHER';
                    } else {
                        $temp['main_device'] = 'NOMOBILE';
                        if (!MAD_SERVE_NOMOBILE) {
                            print_error(1, 'This ad-server does not serve ads to non-mobile devices.', $request_settings['sdk'], 1);
                            return false;
                        }
                    }
                }
            }
        }
    }
    if (isset($temp['device_os']) && !empty($temp['device_os'])) {
        $request_settings['device_os'] = $temp['device_os'];
    }
    $request_settings['main_device'] = $temp['main_device'];
    set_cache($key, $temp, 1500);
}
Esempio n. 15
0
<head>
<meta charset="UTF-8" />
<title>ソフトウェアダウンロード</title>
</head>
<body>
<?php 
$md = new Mobile_Detect();
if ($md->isiOS()) {
    ?>

<!-- iOSの場合 -->
<a href="https://itunes.apple.com/jp/app/google-maps/
id585027354?mt=8&uo=4" target="itunes_store"style="display:inline-block;overflow:hidden;background:url(https://linkmaker.itunes.apple.com/htmlResources/assets/ja_jp//images/web/linkmaker/badge_appstore-lrg.png) no-repeat;width:135px;height:40px;@media onlyscreen{background-image:url(https://linkmaker.itunes.apple.com/htmlResources/assets/ja_jp//images/web/linkmaker/badge_appstorelrg.
svg);}"></a>
<?php 
} elseif ($md->isAndroidOS()) {
    ?>
<!-- Androidの場合 -->
<a href="https://play.google.com/store/apps/details?id=com.google.earth">
<img alt="Android app on Google Play"
src="https://developer.android.com/images/brand/ja_app_rgb_wo_45.png" />
</a>
<?php 
} else {
    ?>
<!-- PCなどの場合 -->
<a href="https://itunes.apple.com/jp/app/google-maps/
id585027354?mt=8&uo=4" target="itunes_store"style="display:inline-block;overflow:hidden;background:url(https://linkmaker.itunes.apple.com/htmlResources/assets/ja_jp//images/web/linkmaker/badge_appstore-lrg.png) no-repeat;width:135px;height:40px;@media onlyscreen{background-image:url(https://linkmaker.itunes.apple.com/htmlResources/assets/ja_jp//images/web/linkmaker/badge_appstorelrg.svg);}"></a>
<a href="https://play.google.com/store/apps/details?id=com.google.
earth">
<img alt="Android app on Google Play"
Esempio n. 16
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. 17
0
    public function footer($modal)
    {
        ?>

                </div>
                <footer>
                  <p><span class="pull-left"><strong>Bahía Números</strong> <i class="fa fa-copyright"></i> Copyright 2015<br>Desarrollo por <strong>Emanuel Martinez</strong></span>
                     <span class="pull-right"><a href="http://www.facebook.com/bahia.numeros" style="color: blue;"><i class="fa fa-facebook-official fa-lg"></i></a></span></p>
                </footer><br><br><br>
            </div>

            <!-- MODAL -->
            <div class="modal fade" id="ModalAndroid" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
                <div class="modal-dialog" role="document">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                            <h4 class="modal-title" id="myModalLabel">Bahía Números en Android</h4>
                        </div>
                        <div class="modal-body">
                            <img src="img/InicioAndroid.png" alt="#BN en Android" class="img-responsive">
                        </div>
                        <div class="modal-footer">
                            <button type="button" onclick="location.href='http://bit.ly/1EcZcyX'" class="btn btn-success btn-block"><i class="fa fa-android"></i> Google Play</button>
                        </div>
                    </div>
                </div>
            </div>

            <!-- JS -->
            <script src="js/jquery.js"></script>
            <script src="js/bootstrap.min.js"></script>
            <script type="text/javascript">
                function loading(){
                    $('#loading').hide();
                    $('#oculto').fadeIn(1000);
                }
            </script>

            <?php 
        require_once 'includes/mobile-detect.php';
        $detect = new Mobile_Detect();
        if ($detect->isAndroidOS() && $modal == true) {
            ?>
            <script type="text/javascript">
            function MostrarModal() {
                $('#ModalAndroid').modal('show');
            }
            setTimeout('MostrarModal()', 4000);
            </script>
            <?php 
        }
        ?>

            </body>
        </html>

    <?php 
    }
Esempio n. 18
0
     if (!isset($_GET) || count($_GET) == 0) {
         echo "<div id=\"paramlist\"><h2>Žádné parametry nebyly předány / No parameters given</h2>";
     } else {
         echo "<div id=\"paramlist\"><h2>Seznam parametrů / List of parameters</h2>";
         foreach ($_GET as $key => $value) {
             $gval = $_GET[$gparam];
             echo "[{$key}] = [{$value}]<br>\n";
         }
         echo "</div><div class=\"roztah\"></div>";
     }
 } else {
     $mobile = false;
     $dumb = false;
     if ($detect->isMobile() || $detect->isTablet()) {
         $mobile = true;
         if ($detect->isAndroidOS() && $detect->isSafari()) {
             $dumb = true;
         }
     }
     header("X-UA-Compatible: IE=edge");
     if (isset($_GET["returnIDParam"])) {
         $useIDParam = true;
         $idParam = $_GET["returnIDParam"];
     } else {
         $useIDParam = false;
     }
     $qs = $_SERVER['QUERY_STRING'];
     $url = 'Location: ' . $failbackWayf . "?" . $qs;
     if ($dumb) {
         $url = $url . "&dumb=true";
         header($url, true, 301);
Esempio n. 19
0
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
 </head>
<body>
    <p><?php 
echo $deviceType;
?>
    <table cellspacing="0" cellpadding="0">
        <tbody>
             
            <tr>
                <td>isiOS()</td>
                <td><?php 
var_dump($detect->isiOS());
?>
</td>
            </tr>
            <tr>
                <td>isAndroidOS()</td>
                <td><?php 
var_dump($detect->isAndroidOS());
?>
</td>
            </tr>
        </tbody>
    </table>
</body>
</html>
Esempio n. 20
0
<?php

require_once 'lib/Mobile-Detect-master/Mobile_Detect.php';
$detect = new Mobile_Detect();
$deviceType = $detect->isMobile() ? $detect->isTablet() ? 'phone' : 'phone' : 'computer';
$isiOS = $detect->isiOS();
$isAndroidOS = $detect->isAndroidOS();
?>
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>Vespa 2015 :: </title>
    <meta http-equiv="content-language" content="es"/>
    <meta name="robots" content="follow,index,nocache"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="description" content="SAMSUNG :: Karaoke"/>
    <meta name="author" content="Misiva Corp"/>

    <script language="JavaScript" src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

    <script src="js/bootstrap.min.js"></script>
    <script src="js/ligthbox/ekko-lightbox.min.js"></script>

    <script language="JavaScript" src="js/app.js"></script>

    <link href='https://fonts.googleapis.com/css?family=Roboto:100' rel='stylesheet' type='text/css'>

    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="js/ligthbox/ekko-lightbox.min.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet" type="text/css"/>
Esempio n. 21
0
<html>
<head>
<meta charset="utf-8">
<?php 
        redirectTitle($_REQUEST['short']);
        ?>
<script>
<!--
<?php 
        // Get deeplinked URL
        $detect = new Mobile_Detect();
        // iOS
        if ($detect->isMobile() && $detect->isiOS()) {
            echo redirectUrl($_REQUEST['short'], "ios");
            // Android
        } elseif ($detect->isMobile() && $detect->isAndroidOS()) {
            echo redirectUrl($_REQUEST['short'], "android");
            // Web fallback
        } else {
            echo redirectUrl($_REQUEST['short']);
        }
        ?>
//-->
</script>
</head>

<body>
</body>
</html><?php 
    }
}