本文整理汇总了PHP中mobile_device_detect函数的典型用法代码示例。如果您正苦于以下问题:PHP mobile_device_detect函数的具体用法?PHP mobile_device_detect怎么用?PHP mobile_device_detect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mobile_device_detect函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mobile_device_detect
function mobile_device_detect()
{
require_once 'mobile_device_detect.php';
//bypass special browser:
$special = array('jigs', 'w3c ', 'w3c-', 'w3c_');
if (in_array(strtolower(substr($_SERVER['HTTP_USER_AGENT'], 0, 4)), $special)) {
return false;
}
return mobile_device_detect('iphone', 'android', 'opera', 'blackberry', 'palm', 'windows');
}
示例2: ws_check_mobi
function ws_check_mobi($which_script)
{
global $pathString;
$return = false;
switch ($which_script) {
case 'detectmobilebrowsers':
$pathString .= '<!-- module ws_check_mobi.php (' . __LINE__ . '): loading mobile_device_detect.php -->' . PHP_EOL;
require_once '/mobile_device_detect.php';
// credits : http://detectmobilebrowsers.mobi/
$return = mobile_device_detect(true, false, true, true, true, true, true, '', '');
break;
case 'mobiledetect':
$pathString .= '<!-- module ws_check_mobi.php (' . __LINE__ . '): loading Mobile_Detect.php -->' . PHP_EOL;
require_once 'Mobile_Detect.php';
// credits : http://mobiledetect.net/
$detect = new Mobile_Detect();
if ($detect->isMobile() && !$detect->isTablet()) {
$return = true;
}
default:
break;
}
return $return;
}
示例3: isHandheld
function isHandheld()
{
include_once ROOT . '/includes/mobile_device_detect.php';
return mobile_device_detect(true, true, true, true, true, true, false, false);
}
示例4: mobile_device_detect
<?php
include 'wap/mobile_device_detect.php';
mobile_device_detect(false, true, true, 'http://shop.dream-gardens.com.cn/mobile/', false);
require_once dirname(__FILE__) . "/include/common.inc.php";
require_once DEDEINC . "/arc.partview.class.php";
$GLOBALS['_arclistEnv'] = 'index';
$row = $dsql->GetOne("Select * From `dede_homepageset`");
$row['templet'] = MfTemplet($row['templet']);
$pv = new PartView();
$pv->SetTemplet($cfg_basedir . $cfg_templets_dir . "/" . $row['templet']);
$pv->Display();
示例5: close_session
if (in_array($_SERVER['REMOTE_ADDR'], $banlist) || in_array($userid, $banlist)) {
if (!empty($_SERVER['REMOTE_ADDR'])) {
close_session();
exit;
}
}
// Exit if IE8 or lower
if (isset($_SERVER['HTTP_USER_AGENT'])) {
if (preg_match('/(?i)msie [1-8]\\./', $_SERVER['HTTP_USER_AGENT'])) {
close_session();
exit;
}
}
// Exit if mobile browser
$mobile_device = 0;
if (mobile_device_detect()) {
$mobile_device = 1;
}
// Exit for group permissions
if ($group_enable_mode == 1) {
if (check_array_for_match($group_id, $group_disable_arrowchat_sep)) {
} else {
close_session();
exit;
}
} else {
if (check_array_for_match($group_id, $group_disable_arrowchat_sep)) {
close_session();
exit;
}
}
示例6: is_mobile
function is_mobile()
{
if (isset($_GET['mobile'])) {
if ($_GET['mobile'] == 'false') {
return false;
} else {
return true;
}
}
if (defined('IS_MOBILE')) {
return true;
}
if (isset($_GET['mobile'])) {
return true;
}
require_once 'lib/mobile_device_detect.php';
return mobile_device_detect(true, false, true, true, true, true, true, false, false);
}
示例7: include_once
* Crows is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Crows. If not, see <http://www.gnu.org/licenses/>.
* */
include_once('config2.php');
include_once('common.php');
//mobile detection
include('mobile_device_detect.php');
if(array_key_exists('nomobile', $_GET) && !($_GET['nomobile'])) { mobile_device_detect(true,true,true,true,true,true,'mobile/index.php',false); }
send_cache_headers($index_ttl);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="EN" lang="EN">
<head>
<title><?php
echo $page_title;
?>
</title>
<meta name="description" content="<?php
echo $page_description;
?>
示例8: header
<?php
//Check for config file and curl
if (file_exists('firstrun.php')) {
header('Location: servercheck.php');
exit;
}
//Authentication check
require_once 'config.php';
if ($authsecured && (!isset($_SESSION['loggedin']) || !$_SESSION['loggedin'])) {
echo "<script>window.location = 'login.php';</script>";
exit;
}
// Redirect if on a mobile browser
require_once "m/mobile_device_detect.php";
if (mobile_device_detect(true, true, true, true, true, true, true, false, false)) {
echo "<script>window.location = 'm/';</script>";
exit;
}
$submenu = false;
require_once "config.php";
if (!empty($subnavlink) || !empty($subnavlink_blank) || !empty($subnavselect)) {
$submenu = true;
}
// Checking to see if the user came from the server check page. If so, redirect to settings
$settings = false;
if (!empty($_SERVER['HTTP_REFERER'])) {
if (strpos($_SERVER['HTTP_REFERER'], 'servercheck')) {
$settings = true;
}
}
示例9: UInterface
function UInterface()
{
global $configArray;
global $timer;
$local = $configArray['Site']['local'];
$this->vufindTheme = $configArray['Site']['theme'];
$isMobile = mobile_device_detect();
// Use mobile theme for mobile devices (if enabled in config.ini)
if (isset($configArray['Site']['mobile_theme'])) {
// If the user is overriding the UI setting, store that:
if (isset($_GET['ui'])) {
$_COOKIE['ui'] = $_GET['ui'];
setcookie('ui', $_GET['ui'], null, '/');
// If we don't already have a UI setting, detect if we're on a mobile
// and store the result in a cookie so we don't waste time doing the
// detection routine on every page:
} else {
if (!isset($_COOKIE['ui'])) {
$_COOKIE['ui'] = $isMobile ? 'mobile' : 'standard';
setcookie('ui', $_COOKIE['ui'], null, '/');
}
}
// If we're mobile, override the standard theme with the mobile one:
if ($_COOKIE['ui'] == 'mobile') {
//Add library specific themes after the mobile theme so we can get images
$this->vufindTheme = $configArray['Site']['mobile_theme'] . "," . $this->vufindTheme;
$this->isMobile = true;
}
}
$this->assign('isMobile', $this->isMobile ? 'true' : 'false');
$this->assign('device', get_device_name());
// Check to see if multiple themes were requested; if so, build an array,
// otherwise, store a single string.
$themeArray = explode(',', $this->vufindTheme);
//Make sure we always fall back to the default theme so a template does not have to be overridden.
$themeArray[] = 'default';
if (count($themeArray) > 1) {
$this->template_dir = array();
foreach ($themeArray as $currentTheme) {
$currentTheme = trim($currentTheme);
$this->template_dir[] = "{$local}/interface/themes/{$currentTheme}";
}
} else {
$this->template_dir = "{$local}/interface/themes/{$this->vufindTheme}";
}
$this->themes = $themeArray;
if (isset($timer)) {
$timer->logTime('Set theme');
}
// Create an MD5 hash of the theme name -- this will ensure that it's a
// writeable directory name (since some config.ini settings may include
// problem characters like commas or whitespace).
$md5 = md5($this->vufindTheme);
$this->compile_dir = "{$local}/interface/compile/{$md5}";
if (!is_dir($this->compile_dir)) {
if (!mkdir($this->compile_dir)) {
echo "Could not create compile directory {$this->compile_dir}";
die;
}
}
$this->cache_dir = "{$local}/interface/cache/{$md5}";
if (!is_dir($this->cache_dir)) {
if (!mkdir($this->cache_dir)) {
echo "Could not create cache directory {$this->cache_dir}";
die;
}
}
$this->plugins_dir = array('plugins', "{$local}/interface/plugins");
$this->caching = false;
$this->debug = true;
$this->compile_check = true;
unset($local);
$this->register_function('translate', 'translate');
$this->register_function('char', 'char');
$this->assign('site', $configArray['Site']);
$this->assign('path', $configArray['Site']['path']);
$defaultConfig = $configArray['Site']['path'];
$url = $_SERVER['SERVER_NAME'];
if (isset($_SERVER['HTTPS'])) {
$url = "https://" . $url;
} else {
$url = "http://" . $url;
}
if (strlen($configArray['Site']['path']) > 0) {
$url .= '/' . $configArray['Site']['path'];
}
$this->url = $url;
$this->assign('template_dir', $this->template_dir);
$this->assign('url', $url);
$this->assign('coverUrl', $configArray['Site']['coverUrl']);
$this->assign('consolidateCss', isset($configArray['Site']['consolidateCss']) ? $configArray['Site']['consolidateCss'] : false);
$this->assign('consolidateJs', isset($configArray['Site']['consolidateJs']) ? $configArray['Site']['consolidateJs'] : false);
$this->assign('fullPath', str_replace('&', '&', $_SERVER['REQUEST_URI']));
$this->assign('requestHasParams', strpos($_SERVER['REQUEST_URI'], '?') > 0);
$this->assign('supportEmail', $configArray['Site']['email']);
$this->assign('libraryName', $configArray['Site']['title']);
$this->assign('theme', $this->vufindTheme);
$this->assign('primaryTheme', reset($themeArray));
$this->assign('device', get_device_name());
$timer->logTime('Basic configuration');
//.........这里部分代码省略.........
示例10: mobile_device_detect
<?php
include_once "../../mainfile.php";
include_once "function.php";
if ($xoopsModuleConfig['use_pda'] == '1' and strpos($_SESSION['theme_kind'], 'bootstrap') === false) {
if (file_exists(XOOPS_ROOT_PATH . "/modules/tadtools/mobile_device_detect.php")) {
include_once XOOPS_ROOT_PATH . "/modules/tadtools/mobile_device_detect.php";
mobile_device_detect(true, false, true, true, true, true, true, 'pda.php', false);
}
}
//判斷是否對該模組有管理權限
$isAdmin = false;
if ($xoopsUser) {
$module_id = $xoopsModule->mid();
$isAdmin = $xoopsUser->isAdmin($module_id);
}
$interface_menu[_TAD_TO_MOD] = "index.php";
$csn = empty($_REQUEST['csn']) ? "" : intval($_REQUEST['csn']);
$interface_menu[_MD_TADGAL_COOLIRIS] = "cooliris.php?csn={$csn}";
$upload_powers = tadgallery::chk_cate_power("upload");
if (!empty($upload_powers) and $xoopsUser or $isAdmin) {
$interface_menu[_MD_TADGAL_UPLOAD_PAGE] = "uploads.php";
}
if ($csn and $isAdmin) {
$interface_menu[_MD_TADGAL_MODIFY_CATE] = "admin/cate.php?csn={$csn}";
}
示例11: mobile_device_detect
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php
echo $title;
?>
</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<link rel="shortcut icon" href="http://images.tfmeetpro.com/icon-16x16.png"/>
<?php
require_once 'includes/mobile_device_detect.php';
$mobile = mobile_device_detect(true, false, true, true, true, true, true, false, false);
if ($mobile) {
echo ' <link rel="stylesheet" type="text/css" href="/css/mobile.css" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">';
} else {
echo '<link rel="stylesheet" type="text/css" href="/css/style.css" />';
}
示例12: mobile_device_detect
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<script src="functions/jquery-1.3.2.min.js"></script>
<script src="functions/functions.js"></script>
<script src="functions/share.js"></script>
<script src="functions/jquery.jgfeed.js"></script>
<?php
require_once 'mobile_device_detect.php';
require_once "phpFlickr.php";
mobile_device_detect(true, true, true, false, true, true, true, 'http://www.xbox360museum.com/sandbox/index_mobile.php', false);
$f = new phpFlickr("", "");
$photoset_id = "";
$secret = "";
?>
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
</head>
<body>
<div id="main-frame">
<div id="fixed-header">
<div id="header-container" class="container">
<div id="lhs-header-container" class="firstContent">
<a href="http://www.lomodroid.com/"><img src="lomodroid_logo.gif"/></a>
<div class="link-container">
<a href="http://www.flickr.com/groups/lomodroid/">JOIN</a>
示例13: initGlobals
/**
* Initialize global interface variables (part of standard VuFind startup
* process). This method is designed for initializations that can't happen
* in the constructor because they rely on session initialization and other
* processing that happens subsequently in the front controller.
*
* @return void
* @access public
*/
public function initGlobals()
{
global $module, $action, $user, $configArray;
// Pass along module and action to the templates.
$this->assign('module', $module);
$this->assign('action', $action);
// Don't pass a PEAR error to interface
$this->assign('user', PEAR::isError($user) ? null : $user);
if ($user) {
// Get My Lists
$listList = $user->getLists();
$this->assign('listList', $listList);
}
// Load the last limit from the request or session for initializing default
// in search box:
if (isset($_REQUEST['limit'])) {
$this->assign('lastLimit', $_REQUEST['limit']);
} else {
if (isset($_SESSION['lastUserLimit'])) {
$this->assign('lastLimit', $_SESSION['lastUserLimit']);
}
}
// Load the last sort from the request or session for initializing default
// in search box. Note that this is not entirely ideal, since sort settings
// will carry over from one module to another (i.e. WorldCat vs. Summon);
// however, this is okay since the validation code will prevent errors and
// simply revert to default sort when switching between modules.
if (isset($_REQUEST['sort'])) {
$this->assign('lastSort', $_REQUEST['sort']);
} else {
if (isset($_SESSION['lastUserSort'])) {
$this->assign('lastSort', $_SESSION['lastUserSort']);
}
}
// This is detected already, but we want a "back to mobile"
// button in the standard view on mobile devices so we check it again
if (isset($configArray["Site"]["mobile_theme"]) && mobile_device_detect()) {
$pageURL = $_SERVER['REQUEST_URI'];
if (isset($_GET["ui"])) {
$pageURL = str_replace("ui=" . urlencode($_GET["ui"]), "ui=mobile", $pageURL);
} else {
if (strstr($pageURL, "?") != false) {
$pageURL = str_replace("?", "?ui=mobile&", $pageURL);
} else {
if (strstr($pageURL, "#") != false) {
$pageURL = str_replace("#", "?ui=mobile#", $pageURL);
} else {
$pageURL .= "?ui=mobile";
}
}
}
$this->assign("mobileViewLink", $pageURL);
}
// Init Mozilla Persona here now that we may have a valid user
if (isset($configArray['Authentication']['mozillaPersona']) && $configArray['Authentication']['mozillaPersona']) {
$this->assign('mozillaPersona', true);
if (isset($_SESSION['authMethod']) && $_SESSION['authMethod'] == 'MozillaPersona') {
if (PEAR::isError($user)) {
$this->assign('mozillaPersonaCurrentUser', null);
} else {
$username = $user->username;
if (isset($configArray['Site']['institution']) && strncmp($configArray['Site']['institution'] . ':', $username, strlen($configArray['Site']['institution']) + 1) == 0) {
$username = substr($username, strlen($configArray['Site']['institution']) + 1);
}
$this->assign('mozillaPersonaCurrentUser', $username);
}
}
if (!isset($configArray['Authentication']['mozillaPersonaAutoLogout']) || $configArray['Authentication']['mozillaPersonaAutoLogout']) {
$this->assign('mozillaPersonaAutoLogout', true);
}
}
// Catalog Account List
if ($user && !PEAR::isError($user)) {
$this->assign('currentCatalogAccount', $user->cat_username);
$this->assign('catalogAccounts', $user->getCatalogAccounts());
}
// Override default value for retain filters -option (searches.ini::retain_filters_by_default)
// if it can be found in the request URL or has previously been saved as a session variable.
$retainFilters = null;
if (isset($_REQUEST['retainFilters'])) {
$retainFilters = $_REQUEST['retainFilters'] === '1';
} elseif (isset($_SESSION['retainFilters'])) {
$retainFilters = $_SESSION['retainFilters'] === 1;
}
if (!is_null($retainFilters)) {
$_SESSION['retainFilters'] = (int) $retainFilters;
$this->assign('retainFiltersByDefault', $retainFilters);
}
// Assign national theme header image
$images = 4;
// Number of available header images
//.........这里部分代码省略.........
示例14: mobile_device_detect
<!DOCTYPE html>
<html>
<head>
<!-- Logo -->
<LINK REL="SHORTCUT ICON" HREF="/assets/images/animated_favicon1.gif" />
<meta charset="UTF-8" />
<!-- Kolla user agent -->
<?php
require_once 'assets/php/mobile_device_detect.php';
mobile_device_detect(true, true, true, true, true, true, true, 'http://192.168.0.199:8081/mobile_index.php', false);
?>
<!-- Javascript -->
<script type="text/javascript" src="/assets/js/javascripts.js"></script>
<link rel="stylesheet" href="assets/css/themeSaBarcaDeFormentera.css">
<title>Inköpslistan</title>
</head>
<body>
<h1> Sidan kunde inte hittas (404)</h1>
<footer>
</footer>
</body>
</html>
示例15: mobile_device_detect
<?php
require_once('detect-mobile.php');
$mobile = mobile_device_detect("http://m.bdw3.com", "http://m.bdw3.com", "http://m.bdw3.com", "http://m.bdw3.com", "http://m.bdw3.com", "http://m.bdw3.com", "http://m.bdw3.com", "http://m.bdw3.com");
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Class 3 || Boulder Digital Works</title>
<link rel="shortcut icon" href="favicon.ico">
<link rel="icon" type="image/ico" href="favicon.ico">
<link href="style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-24871825-1']);
_gaq.push(['_setDomainName', '.bdw3.com']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body>
<noscript>Sorry, your browser does not support JavaScript!</noscript>