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; }
public function testBasicMethods() { $this->assertNotEmpty($this->detect->getScriptVersion()); $this->detect->setHttpHeaders(array('SERVER_SOFTWARE' => 'Apache/2.2.15 (Linux) Whatever/4.0 PHP/5.2.13', 'REQUEST_METHOD' => 'POST', 'HTTP_HOST' => 'home.ghita.org', 'HTTP_X_REAL_IP' => '1.2.3.4', 'HTTP_X_FORWARDED_FOR' => '1.2.3.5', 'HTTP_CONNECTION' => 'close', 'HTTP_USER_AGENT' => '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', 'HTTP_ACCEPT' => 'text/vnd.wap.wml, application/json, text/javascript, */*; q=0.01', 'HTTP_ACCEPT_LANGUAGE' => 'en-us,en;q=0.5', 'HTTP_ACCEPT_ENCODING' => 'gzip, deflate', 'HTTP_X_REQUESTED_WITH' => 'XMLHttpRequest', 'HTTP_REFERER' => 'http://mobiledetect.net', 'HTTP_PRAGMA' => 'no-cache', 'HTTP_CACHE_CONTROL' => 'no-cache', 'REMOTE_ADDR' => '11.22.33.44', 'REQUEST_TIME' => '01-10-2012 07:57')); //12 because only 12 start with HTTP_ $this->assertCount(12, $this->detect->getHttpHeaders()); $this->assertTrue($this->detect->checkHttpHeadersForMobile()); $this->detect->setUserAgent('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'); $this->assertNotEmpty($this->detect->getUserAgent()); $this->assertTrue($this->detect->isMobile()); $this->assertFalse($this->detect->isTablet()); $this->assertTrue($this->detect->isIphone()); $this->assertTrue($this->detect->isiphone()); $this->assertTrue($this->detect->isiOS()); $this->assertTrue($this->detect->isios()); $this->assertTrue($this->detect->is('iphone')); $this->assertTrue($this->detect->is('ios')); }
function isiOS() { // instantiate Mobile_Detect Object $detect = new \Mobile_Detect(); // determine if the device is iOS $isiOS = $detect->isiOS() ? true : false; // return true or false return $isiOS; }
public function detect() { $detect = new Mobile_Detect(); if ($detect->isiOS()) { $this->device = 'ios'; } if ($detect->isAndroidOS()) { $this->device = 'android'; } return $this->device; }
/** * 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); } } }
* 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); }
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; }
exit; } if (!$mobile && !$supportedBrowser) { header($url, true, 301); exit; } echo $doctype; echo "<html><head><title>Discovery service</title>"; echo $charset; echo "<link rel=\"stylesheet\" href=\"jquery-ui.min.css\" />"; echo "<script type=\"text/javascript\" src=\"jquery-2.2.4.min.js\"></script>"; echo "<script type=\"text/javascript\" src=\"jquery-ui.min.js\"></script>"; echo $edge; if ($mobile) { echo "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=no\">"; if ($detect->isiOS()) { $osType = "ios"; } else { if ($detect->isAndroidOS()) { $osType = "android"; } else { $osType = "unknown"; } } } if ($useFilter && isset($jFilter['allowFeeds'])) { $f = '{'; foreach ($jFilter['allowFeeds'] as $feed) { $f .= "\"{$feed}\":\"/feed/{$feed}.js\","; } $feeds = rtrim($f, ",") . "}";
/** * 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); }
} $mobiledetect = new Mobile_Detect(); $CFG->site_root = realpath(dirname(__FILE__)); $headerStr = "<div class='header-wrapper' style=''>\n <div style='position:absolute; left:10px; top:10px'><a href='javascript:window.location.assign(\"{$CFG->wwwroot}{$CFG->basedir}index.php?logout\");' >Log Out</a></div>"; if ($CFG->wwwroot == "https://srm-itd01/") { $headerStr .= "DEV: {$CFG->sysname} " . ($CFG->istrainingsite ? ' (TRAINING)' : '') . " </span><br/>"; } else { $headerStr .= "PROD: {$CFG->sysname} " . ($CFG->istrainingsite ? ' (TRAINING)' : '') . "</span><br/>"; } $headerStr .= " <span id='user_feedback' style='width: 80%'>"; $headerStr .= $loggedinuserdata->name . "</span></div>"; $examActionStr = ""; // determine if user has the ability to conduct an assessment if ($authlib->user_has_capability($loggedinuserdata->userID, $authlib::roles_conduct_assessment)) { // are they using an iPad? then they should download the app. if ($mobiledetect->isiOS()) { $examActionStr .= "<br/><button onclick='startApp()' class='actionbut'>Start UNE eOSCE app</button><p/>"; $examActionStr .= "Don't have the app?<br/><a href='https://geo.itunes.apple.com/au/app/une-eosce/id930335514?mt=8&uo=6' target='itunes_store' style='display:inline-block;overflow:hidden;background:url(http://linkmaker.itunes.apple.com/images/badges/en-us/badge_appstore-lrg.png) no-repeat;width:165px;height:40px;@media only screen{background-image:url(http://linkmaker.itunes.apple.com/images/badges/en-us/badge_appstore-lrg.svg);}'></a>"; } else { $enumlib = new EnumLib(); $availableExams = simplexml_load_string($enumlib->getExamsForAssessor($loggedinuserdata->userID)); if ($availableExams->instance->count() > 0) { $examActionStr .= "<h3>{$stringlib->get_string('assessor_available_examinations')}</h3>"; foreach ($availableExams->instance as $instance) { $examActionStr .= "<button onclick='window.location=\"app/?id={$instance->id}\"' class='actionbut'>{$instance->name}</button><p/>"; } } } } // show an overview of running assessments if permitted if ($authlib->user_has_capability($loggedinuserdata->userID, $authlib::roles_view_assessments)) {
function tcb_profile_load_scripts_front() { wp_register_style('tcb_style_front-css', plugins_url('/assets/css/style_front.css', __FILE__)); wp_enqueue_style('tcb_style_front-css'); // Enqueue it! $detect = new Mobile_Detect(); if ($detect->isiOS()) { wp_register_style('tcb_style_front-ios-css', plugins_url('/assets/css/style_ios_front.css', __FILE__)); wp_enqueue_style('tcb_style_front-ios-css'); // Enqueue it! } wp_register_script('tcb_frontjs', plugins_url('/assets/js/scripts_front.js', __FILE__), array('jquery')); wp_enqueue_script('tcb_frontjs'); wp_localize_script('tcb_frontjs', 'MyAjax', array('ajaxurl' => admin_url('admin-ajax.php'), 'loginurl' => get_permalink(get_id_by_slug("members-login")))); }
global $more; $more = 0; the_content('<div style="padding-top: 15px;"><button class="btn btn-info" style="float: right;" type="button">Read More</button></div>'); ?> </div> <?php } ?> </div> </div> </div> </div> <?php if ($detect->isMobile() || $detect->isTablet() || $detect->isiPhone() || $detect->isiOS()) { if (!get_previous_posts_link() || !get_next_posts_link()) { ?> <div id="row-widget-header" class="navigation"> <div id="sub-container"> <div class="row" id="widgetrow" style="padding-left: 10px; padding-right: 10px; padding-bottom: 10px;"> <?php add_filter('next_posts_link_attributes', 'posts_link_next_class'); function posts_link_next_class() { return 'class="btn btn-default custom btn-outline-inverse pull-right"'; } add_filter('previous_posts_link_attributes', 'posts_link_prev_class'); function posts_link_prev_class()
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; }
<?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"/>
<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>
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; }
<?php require 'Mobile_Detect.php'; ?> <!doctype html> <html lang="ja"> <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 { ?>
break; case 1: case 2: default: $rewrite_url = array('view' => 'index.php?method=view&pid=%d', 'view_nohistory' => 'index.php?pid=%d&addr=nohistory', 'screenshot' => 'index.php?method=screenshot&pid=%d', 'history' => 'index.php?method=history&pid=%d', 'contact' => 'index.php?method=contact&pid=%d', 'section' => 'index.php?method=section&pid=%d', 'report' => 'index.php?method=report&pid=%d', 'report_support' => 'index.php?method=report&pid=%1$d&support=%2$d', 'more' => 'index.php?method=more&pid=%d', 'more_offset' => 'index.php?method=more&pid=%1$d&offset=%2$d', 'misc' => 'misc.php'); break; } function echo_rewrite_url($type, $variable1, $variable2 = '') { global $rewrite_url; echo SITE_URL; printf($rewrite_url[$type], $variable1, $variable2); } class_loader('Mobile_Detect'); $detect = new Mobile_Detect(); if (!$detect->isiOS()) { if (DCRM_PCINDEX == 2) { header("Location: " . SITE_URL . $rewrite_url['misc']); exit; } else { $isCydia = false; } } else { if (DCRM_MOBILE == 2) { if (!strpos($detect->getUserAgent(), 'Cydia')) { $isCydia = false; } else { $isCydia = true; } } else { exit('Access Denied');
* This project is licensed under the terms of MIT License * ***********************************************************/ --> <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>