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'); }
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; }
function isHandheld() { include_once ROOT . '/includes/mobile_device_detect.php'; return mobile_device_detect(true, true, true, true, true, true, false, false); }
<?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();
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; } }
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); }
* 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; ?>
<?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; } }
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'); if (isset($configArray['OpenURL']) && isset($configArray['OpenURL']['url'])) { // Trim off any parameters (for legacy compatibility -- default config // used to include extraneous parameters): list($base) = explode('?', $configArray['OpenURL']['url']); } else { $base = false; } $this->assign('openUrlBase', empty($base) ? false : $base); // Other OpenURL settings: $this->assign('openUrlWindow', empty($configArray['OpenURL']['window_settings']) ? false : $configArray['OpenURL']['window_settings']); $this->assign('openUrlGraphic', empty($configArray['OpenURL']['graphic']) ? false : $configArray['OpenURL']['graphic']); $this->assign('openUrlGraphicWidth', empty($configArray['OpenURL']['graphic_width']) ? false : $configArray['OpenURL']['graphic_width']); $this->assign('openUrlGraphicHeight', empty($configArray['OpenURL']['graphic_height']) ? false : $configArray['OpenURL']['graphic_height']); $this->assign('currentTab', 'Search'); $this->assign('authMethod', $configArray['Authentication']['method']); if ($configArray['Authentication']['method'] == 'Shibboleth') { if (!isset($configArray['Shibboleth']['login']) || !isset($configArray['Shibboleth']['target'])) { throw new Exception('Missing parameter in the config.ini. Check if ' . 'the parameters login and target are set.'); } $sessionInitiator = $configArray['Shibboleth']['login'] . '?target=' . $configArray['Shibboleth']['target']; if (isset($configArray['Shibboleth']['provider_id'])) { $sessionInitiator = $sessionInitiator . '&providerId=' . $configArray['Shibboleth']['provider_id']; } $this->assign('sessionInitiator', $sessionInitiator); } }
<?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}"; }
<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" />'; }
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>
/** * 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 $bgNumber = isset($_SESSION['bgNumber']) ? $_SESSION['bgNumber'] : rand(1, $images); $_SESSION['bgNumber'] = $bgNumber; $this->assign('bgNumber', $bgNumber); // Moved to here from constructor if (isset($configArray['Authentication']['shibboleth']) && $configArray['Authentication']['shibboleth']) { if (!isset($configArray['Shibboleth']['login'])) { throw new Exception('Missing parameter in the config.ini. Check if ' . 'the login parameter is set.'); } if (isset($configArray['Shibboleth']['target'])) { $shibTarget = $configArray['Shibboleth']['target']; } else { if ($module == 'MyResearch' && $action == 'Home') { $myRes = isset($configArray['Site']['defaultLoggedInModule']) ? $configArray['Site']['defaultLoggedInModule'] : 'MyResearch'; $myRes .= '/Home'; } else { if ($module == 'MyResearch' && $action == 'SaveSearch') { $myRes = $module . '/' . $action . '?save=' . $_GET['save']; } else { $myRes = $module . '/' . $action; } } // Override default location with followup location if set if (isset($_REQUEST['followupModule'])) { $myRes = $_REQUEST['followupModule']; if (isset($_REQUEST['followupAction'])) { $myRes .= '/' . urlencode($_REQUEST['followupAction']); // Hack to allow quickadd to favorites after Shibboleth login if (isset($configArray['Site']['quickAddToFavorites']) && $configArray['Site']['quickAddToFavorites'] && isset($_REQUEST['followupId']) && $_REQUEST['followupAction'] == 'Save') { if ($_REQUEST['followupModule'] != 'PCI') { $myRes = urlencode($_REQUEST['followupModule']) . '/' . urlencode($_REQUEST['followupId']) . '/' . urlencode($_REQUEST['followupAction']) . '?submit'; } else { $myRes = urlencode($_REQUEST['followupModule']) . '/' . urlencode($_REQUEST['followupAction']) . '?submit' . '&id=' . urlencode($_REQUEST['followupId']); } } } else { $myRes .= '/Home'; } } $shibTarget = $configArray['Site']['url'] . '/' . $myRes; } $sessionInitiator = $configArray['Shibboleth']['login']; $sessionInitiator .= strpos($sessionInitiator, '?') === false ? '?' : '&'; $sessionInitiator .= 'target=' . urlencode($shibTarget); if (isset($configArray['Shibboleth']['provider_id'])) { $sessionInitiator = $sessionInitiator . '&providerId=' . urlencode($configArray['Shibboleth']['provider_id']); } $this->assign('sessionInitiator', $sessionInitiator); } }
<!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>
<?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>
/** * Simple function to detect if the user has a mobile device */ public function isMobileDevice() { require_once Xerxes_Framework_FrontController::parentDirectory() . '/lib/mobile/mobile_device_detect.php'; $is_mobile = @mobile_device_detect(true, false); // supress errors because this library is goofy return $is_mobile[0]; }
function UInterface() { global $configArray; global $timer; $local = $configArray['Site']['local']; $this->vufindTheme = $configArray['Site']['theme']; $this->isMobile = mobile_device_detect(); $this->assign('isMobile', $this->isMobile ? 'true' : 'false'); $this->assign('device', get_device_name()); //Figure out google translate id if (isset($configArray['Translation']['google_translate_key']) && strlen($configArray['Translation']['google_translate_key']) > 0) { $this->assign('google_translate_key', $configArray['Translation']['google_translate_key']); $this->assign('google_included_languages', $configArray['Translation']['includedLanguages']); } $thisYear = new Date(); $this->assign('lastYear', $thisYear->getYear() - 1); if (isset($_REQUEST['print'])) { $this->assign('print', true); } // 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_block('display_if_inconsistent', 'display_if_inconsistent'); $this->register_block('display_if_set', 'display_if_set'); $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('fullPath', str_replace('&', '&', $_SERVER['REQUEST_URI'])); $this->assign('requestHasParams', strpos($_SERVER['REQUEST_URI'], '?') > 0); if (isset($configArray['Site']['email'])) { $this->assign('supportEmail', $configArray['Site']['email']); } if (isset($configArray['Site']['libraryName'])) { $this->assign('consortiumName', $configArray['Site']['libraryName']); } $this->assign('libraryName', $configArray['Site']['title']); $this->assign('ils', $configArray['Catalog']['ils']); if (isset($configArray['Catalog']['url'])) { $this->assign('classicCatalogUrl', $configArray['Catalog']['url']); } else { if (isset($configArray['Catalog']['hipUrl'])) { $this->assign('classicCatalogUrl', $configArray['Catalog']['hipUrl']); } } $this->assign('showConvertListsFromClassic', $configArray['Catalog']['showConvertListsFromClassic']); $this->assign('theme', $this->vufindTheme); $this->assign('primaryTheme', reset($themeArray)); $this->assign('device', get_device_name()); $timer->logTime('Basic configuration'); $this->assign('currentTab', 'Search'); $this->assign('authMethod', $configArray['Authentication']['method']); if ($configArray['System']['debug']) { $this->assign('debug', true); } if ($configArray['System']['debugJs']) { $this->assign('debugJs', true); } if (isset($configArray['System']['debugCss']) && $configArray['System']['debugCss']) { $this->assign('debugCss', true); } // Detect Internet Explorer 8 to include respond.js for responsive css support if (isset($_SERVER['HTTP_USER_AGENT'])) { $ie8 = stristr($_SERVER['HTTP_USER_AGENT'], 'msie 8') || stristr($_SERVER['HTTP_USER_AGENT'], 'trident/5'); //trident/5 should catch ie9 compability modes $this->assign('ie8', $ie8); } $session = new Session(); $session->session_id = session_id(); if ($session->find(true)) { $this->assign('session', session_id() . ', remember me ' . $session->remember_me); } else { $this->assign('session', session_id() . ' - not saved'); } }
<?php error_reporting(E_ALL); @ini_set("display_errors", 1); @ini_set("ignore_user_abort", 1); //detect ajax request $IS_AJAX = isset($_SERVER['HTTP_X_REQUESTED_WITH']) && !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'; // Detects mobile devices include_once '_lib/mobile_device_detect/mobile_device_detect.php'; $MOBILE_DEVICE = mobile_device_detect($DEVICE_USER_AGENT); // Set multibyte encoding to UTF-8 for better canonization of strings if (function_exists('mb_internal_encoding') && function_exists('mb_regex_encoding')) { @mb_internal_encoding("UTF-8"); @mb_regex_encoding("UTF-8"); } // basic paths... if (empty($INDEX_INCLUDED)) { $INDEX_INCLUDED = false; } if (empty($SITE_ROOT)) { $SITE_ROOT = $INDEX_INCLUDED ? './' : '../'; } if (empty($ENGINE_ROOT)) { $ENGINE_ROOT = $SITE_ROOT . 'engine/'; } $SITE_ABS_ROOT = str_replace('\\', '/', dirname($_SERVER['PHP_SELF'])); if (strlen($SITE_ROOT) > 2) { // if SITE_ROOT is "../" or "../../" etc., but not "./" $s = $SITE_ROOT; while ($s) { $s = substr($s, 0, strlen($s) - 3);
public function renderize($filename) { /* Attivazione plugin `first`. */ require_once 'class.Plugin.php'; $bbcode = 0; if ($this->config[0]->plugin == 1) { $plugins = Plugin::listPlugins(); $varList = $this->getValues(); foreach ($plugins as $element) { if (Plugin::getMetadata($element, 'enabled', '') == 'true' && Plugin::getMetadata($element, 'working', '') == 'after' && file_exists($this->config[0]->root_index . '/plugin/plugins/' . Plugin::getMetadata($element, 'path', ''))) { try { $plugin = Plugin::loadPlugin($element); $output = $plugin->main($varList); if (is_array($output)) { foreach ($output as $name => $value) { if ($name !== '' && $value !== '') { $this->addValue($name, $value); } } } if ($element == 'BBCode') { $bbcode = 1; } } catch (Exception $e) { if ($ocarina->config[0]->log == 1) { $ocarina->log($element, $e->getMessage()); } echo '<!-- ' . $e->getMessage() . ' -->'; } } } unset($plugins); } $this->addValue('bbcode', $bbcode); /* Renderizza il tutto con la skin appropriata. */ require_once $this->config[0]->root_index . '/etc/mobile_device_detect.php'; if ($this->skin == 'admin') { if ($filename == 'index.tpl') { $lastversion = json_decode(file_get_contents('http://www.giovannicapuano.net/ocarina/lastversion.php?w=ocarina2')); $this->addValue('lastversion', $lastversion->{'foo-bar'}); } $this->addValue('skin', 'admin'); $this->smarty->display('admin/' . $filename); } elseif (mobile_device_detect() && $this->skinExists('mobile')) { $this->addValue('skin', 'mobile'); $this->smarty->display('mobile' . '/' . $filename); } elseif ($this->skinExists($this->skin)) { $this->addValue('skin', $this->skin); $this->smarty->display($this->skin . '/' . $filename); } else { $this->addValue('skin', $this->config[0]->skin); $this->smarty->display($this->config[0]->skin . '/' . $filename); } }
function isMobileDevice() { require 'mobile_device_detect.php'; //iPhones,Android,Opera Mini,Blackberry,Palm OS, Windows Mobile, Return TRUE, NA return mobile_device_detect(true, true, true, true, true, true, false, false); }
/** * Simple function to detect if the user has a mobile device */ public function isMobileDevice() { require_once __DIR__ . '/mobile/mobile_device_detect.php'; $is_mobile = @mobile_device_detect(true, false); // supress errors because this library is goofy return $is_mobile[0]; }
<?php set_time_limit(15); if (!isset($_SESSION)) { session_start(); } include_once 'mobile_device_detect.php'; mobile_device_detect(true, true, true, true, true, true, 'https://t.orzdream.com/', false); include_once 'config.php'; include_once 'utility.php'; include_once 'twitteroauth.php'; include_once 'oauth_lib.php'; function refreshProfile() { $t = getTwitter(); $user = $t->veverify(); $time = $_SERVER['REQUEST_TIME'] + 3600 * 24 * 365; setcookie('friends_count', $user->friends_count, $time, '/'); setcookie('statuses_count', $user->statuses_count, $time, '/'); setcookie('followers_count', $user->followers_count, $time, '/'); setcookie('imgurl', getAvatar($user->profile_image_url), $time, '/'); setcookie('name', $user->screen_name, $time, '/'); setcookie('listed_count', $user->listed_count, $time, '/'); } function getDefCookie($name, $default = "") { if (getCookie($name)) { return getCookie($name); } else { return $default; }
function isHandheld() { include 'mobile_device_detect.php'; return mobile_device_detect(true, true, true, true, true, true, false, false); }
function mobile_device_detect_() { $ui = T3Parameter::_getParam('ui'); //detect mobile t3import('core.libs.mobile_device_detect'); //bypass special browser: $special = array('jigs', 'w3c ', 'w3c-', 'w3c_'); if (in_array(strtolower(substr($_SERVER['HTTP_USER_AGENT'], 0, 4)), $special)) { $mobile_device = false; } else { $mobile_device = mobile_device_detect('iphone', 'android', 'opera', 'blackberry', 'palm', 'windows'); } return $ui == 'desktop' ? false : ($ui == 'mobile' && !$mobile_device ? 'iphone' : $mobile_device); }
} // Set Popupmode via GET (base, popup) if ($_GET['frmwrkmode']) { $frmwrkmode = $_GET['frmwrkmode']; } // Set Popupmode via GET (base, popup) if (isset($frmwrkmode)) { $framework->set_modus($frmwrkmode); } // Ende Notlösung ### Set HTTP-Headers header('Content-Type: text/html; charset=utf-8'); #header('Content-Type: application/xhtml+xml; charset=utf-8'); #header("Cache-Control: no-cache, must-revalidate"); include_once "ext_scripts/mobile_device_detect.php"; $framework->IsMobileBrowser = mobile_device_detect(); // For XHTML compatibility @ini_set('arg_separator.output', '&'); ### load $_POST and $_GET variables // Fallback for PHP < 4.1 (still needed?) if (!is_array($_POST)) { $_POST = $HTTP_POST_VARS; } if (!is_array($_GET)) { $_GET = $HTTP_GET_VARS; } if (!is_array($_COOKIE)) { $_COOKIE = $HTTP_COOKIE_VARS; } // Base Functions (anything that doesnt belong elsewere) require_once "inc/classes/class_func.php";
<?php date_default_timezone_set('Europe/Berlin'); // set include path ini_set("include_path", ".:../library/"); require_once 'mobiledevicedetect/mobile_device_detect.php'; mobile_device_detect(true, true, true, true, true, true, true, 'http://m.publicapp.tk', false); // required classes require_once 'spoon/spoon.php'; require_once 'publicApp/publicApp.php'; $tpl = new SpoonTemplate(); $tpl->setForceCompile(true); $tpl->setCompileDirectory('./compiled_templates'); /* * Start the login magic * @joenmaes */ // facebook php require_once 'facebook/facebook.php'; // Create our Application instance $facebook = new Facebook(array('appId' => '177481728946474', 'secret' => '6d5db3a0e538eb5aa7bebe6ae0bb2efe', 'cookie' => true)); $session = $facebook->getSession(); $me = null; // Session based API call. if ($session) { try { $uid = $facebook->getUser(); $me = $facebook->api('/me'); } catch (FacebookApiException $e) { error_log($e); }
<?php if (!isset($lofi_version)) { $lofi_version = false; } $basepath = realpath(dirname(__FILE__)); chdir($basepath); include_once "./config/db_connect.php"; include_once "./config/config.php"; include_once "./includes/functions.php"; $path1 = dirname($_SERVER['SCRIPT_NAME']); $path2 = str_replace("\\", "/", dirname(__FILE__)); $base = getPathIntersection($path2, $path1); $basehref = "http://{$_SERVER['HTTP_HOST']}/{$base}/"; include_once "./includes/mobile_device_detect.php"; if (!$lofi_version && mobile_device_detect() && realpath(__FILE__) === realpath($_SERVER['SCRIPT_FILENAME'])) { header("Location: {$basehref}/lofi/"); } if (!isset($_REQUEST['range'])) { $_REQUEST['range'] = 'day'; } echo '<?xml version="1.0"?>'; ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title><?php echo $BOOKMARK; ?>
$aut_array = explode("|",$autorizaciones); $size_ruta_aut = sizeof($ruta_aut_array); $size_aut = sizeof($aut_array); //error_log("tama�o ruta aut = ".$size_ruta_aut); //error_log("tama�o autorizaciones = ".$size_aut); if($aut_array[0] == "") $size_aut = 0; if(($size_aut+1)<$size_ruta_aut) return $ruta_aut_array[$size_aut+1]; else return ""; } // Detecta si es un dispositivo movil (IPhone, Android, Blackberry) $mobile_type = null; $mobile = mobile_device_detect(true,true,true,true,true,true,false,false,&$mobile_type); //$mobile = false; // Autoriza la COMPROBACION DE INVITACION if(isset($_POST['autorizar_comp_inv']) && isset($_POST['idT']) && $_POST['idT']!="" && isset($_POST['iu']) && $_POST['iu']!=""){ $fin_de_ruta_autorizacion = false; $es_controlling_o_finanzas = 0; $cambio_cc = 0; $cambio_cpto = 0; $cambio_tot_aprob = 0; //Recibimos campo Observaciones y el ID del Tramite $HObser=$_POST['historial_observaciones']; $sObser = $_POST['observ_up']; $idTramite = $_POST['idT']; $delegado = $_POST['delegado']; $delegadoNombre = $_POST['delegadoNombre'];
$mobile = $_GET['switch']; // should be either 1 for true or empty for false setcookie('switch', $_GET['switch']); // set a cookie if (isset($_SERVER['HTTP_REFERER'])) { // if the referer is set send the user there header('Location:' . $_SERVER['HTTP_REFERER']); exit; } } else { if (isset($_COOKIE['switch'])) { // if the cookie is set use it $mobile = $_COOKIE['switch']; } else { // else use the function to detect if it's a mobile or not $mobile = mobile_device_detect(); } } } if ($s5_mobile_device_enable_disable == "disabled") { $mobile = false; } if ($mobile == true) { require "vertex/mobile_device_menu.php"; } ?> <meta http-equiv="Content-Type" content="text/html;" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <?php
header("Location: /login"); } else { // Om man är inloggad ?> <!DOCTYPE html> <html> <head> <!-- Logo --> <LINK REL="SHORTCUT ICON" HREF="/assets/images/icons/web_hi_res_512.png" /> <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, '/mobile_index', false); ?> <!-- CSS för Desktop --> <link rel="stylesheet" type="text/css" href="/assets/css/themeMinimalism.css" title="new" /> <link rel="stylesheet" type="text/css" href="/assets/css/themeClassic.css" title="classic" /> <link rel="stylesheet" type="text/css" href="/assets/css/themeSaBarcaDeFormentera.css" title="formentera" /> <!-- Importera Roboto --> <link type="text/css" rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:100"> <!-- jQuery --> <script src="https://code.jquery.com/jquery-2.0.3.min.js"></script> <script type="text/javascript" src="/assets/js/jquery.moveButtons.js" ></script> <!-- Javascript --> <script type="text/javascript" src="assets/js/shoppinglistSocket.js"></script> <script type="text/javascript" src="assets/js/utils.js"></script>