function end_html() { echo ' <script src="http://code.jquery.com/jquery.min.js"></script> <script src="js/jquery.cookie.js"></script> <script src="js/default.js"></script>'; if (is_ipad() || is_iphone()) { echo '<script src="js/ios.js"></script>'; } echo ' </body> </html>'; }
public function _initialize() { // 登录验证 $passport = service('Passport'); if (!$passport->isLogged()) { redirect(U('w3g/Public/login')); } global $ts; // 站点名称 $this->_title = $ts['site']['site_name'] . ' 3G版'; $this->assign('site_name', $this->_title); // 分页 $_GET['page'] = $_POST['page'] ? intval($_POST['page']) : intval($_GET['page']); $this->_page = $_GET['page'] > 0 ? $_GET['page'] : 1; $this->assign('page', $this->_page); $this->_item_count = 20; $this->assign('item_count', $this->_item_count); // 来源类型 if (is_iphone()) { $this->_type_wap = 3; } elseif (is_android()) { $this->_type_wap = 2; } else { $this->_type_wap = 1; } $this->_from_type = array('0' => '网站', '1' => '手机版', '2' => 'Android客户端', '3' => 'iPhone客户端'); $this->assign('from_type', $this->_from_type); // 关注状态 $this->_follow_status = array('eachfollow' => '相互关注', 'havefollow' => '已关注', 'unfollow' => '未关注'); $this->assign('follow_status', $this->_follow_status); // 当前URL $this->_self_url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; if (isset($_POST['key'])) { $this->_self_url .= "&key={$_POST['key']}"; $this->_self_url .= isset($_POST['user']) ? '&user=1' : '&weibo=1'; } $this->assign('self_url', $this->_self_url); // 是否为owner $this->assign('is_owner', $this->uid == $this->mid ? '1' : '0'); $data['user_id'] = $this->uid; $data['page'] = $this->_page; // 用户资料 $this->profile = api('User')->data($data)->show(); $this->assign('profile', $this->profile); return; }
function is_mobile_device() { // detect Android Phones, iPhone or iPod if (is_android_mobile() || is_iphone() || is_ipod()) { return true; } else { return false; } }
function custom_body_class($classes) { global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome; // Top level if (is_handheld()) { $classes[] = "handheld"; } if (is_mobile()) { $classes[] = "mobile"; } if (is_ios()) { $classes[] = "ios"; } if (is_tablet()) { $classes[] = "tablet"; } // Specific if (is_iphone()) { $classes[] = "iphone"; } if (is_ipad()) { $classes[] = "ipad"; } if (is_ipod()) { $classes[] = "ipod"; } if (is_android()) { $classes[] = "android"; } if (is_blackberry()) { $classes[] = "blackberry"; } if (is_opera_mobile()) { $classes[] = "opera-mobile"; } if (is_palm()) { $classes[] = "palm"; } if (is_symbian()) { $classes[] = "symbian"; } if (is_windows_mobile()) { $classes[] = "windows-mobile"; } if (is_lg()) { $classes[] = "lg"; } if (is_motorola()) { $classes[] = "motorola"; } if (is_nokia()) { $classes[] = "nokia"; } if (is_samsung()) { $classes[] = "samsung"; } if (is_samsung_galaxy_tab()) { $classes[] = "samsung-galaxy-tab"; } if (is_sony_ericsson()) { $classes[] = "sony-ericsson"; } if (is_nintendo()) { $classes[] = "nintendo"; } // Computer browser if (!is_handheld()) { $classes[] = "desktop"; } if ($is_lynx) { $classes[] = "lynx"; } if ($is_gecko) { $classes[] = "gecko"; } if ($is_opera) { $classes[] = "opera"; } if ($is_NS4) { $classes[] = "ns4"; } if ($is_safari) { $classes[] = "safari"; } if ($is_chrome) { $classes[] = "chrome"; } if ($is_IE) { $classes[] = "ie"; } // IE Version check $ie_check = array(); $ie_classes = array('ie7', 'ie8', 'ie9', 'ie10'); $version = 7; while ($version < 11) { $ie_check[] = strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE ' . $version . '.') !== FALSE; ++$version; } $ie = ''; foreach ($ie_check as $key => $value) { if ($value == 1) { $ie = $ie_classes[$key] . ' oldie'; } } $classes[] = $ie; // Check user logged in? if (!is_user_logged_in()) { $classes[] = 'not-login'; } return $classes; }
function mobble_body_class($classes) { global $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $mobble_detect; // top level if (is_handheld()) { $classes[] = "handheld"; } if (is_mobile()) { $classes[] = "mobile"; } if (is_ios()) { $classes[] = "ios"; } if (is_tablet()) { $classes[] = "tablet"; } // specific if (is_iphone()) { $classes[] = "iphone"; } if (is_ipad()) { $classes[] = "ipad"; } if (is_ipod()) { $classes[] = "ipod"; } if (is_android()) { $classes[] = "android"; } if (is_blackberry()) { $classes[] = "blackberry"; } if (is_opera_mobile()) { $classes[] = "opera-mobile"; } if (is_webos()) { $classes[] = "webos"; } if (is_symbian()) { $classes[] = "symbian"; } if (is_windows_mobile()) { $classes[] = "windows-mobile"; } //if (is_lg()) { $classes[] = "lg"; } if (is_motorola()) { $classes[] = "motorola"; } //if (is_smartphone()) { $classes[] = "smartphone"; } //if (is_nokia()) { $classes[] = "nokia"; } if (is_samsung()) { $classes[] = "samsung"; } if (is_samsung_tablet()) { $classes[] = "samsung-tablet"; } if (is_sony_ericsson()) { $classes[] = "sony-ericsson"; } if (is_nintendo()) { $classes[] = "nintendo"; } // bonus if (!is_handheld()) { $classes[] = "desktop"; } if ($is_lynx) { $classes[] = "lynx"; } if ($is_gecko) { $classes[] = "gecko"; } if ($mobble_detect->is('Gecko')) { $classes[] = "gecko"; } if ($is_opera) { $classes[] = "opera"; } if ($mobble_detect->is('Opera')) { $classes[] = "opera"; } if ($is_NS4) { $classes[] = "ns4"; } if ($is_safari) { $classes[] = "safari"; } if ($mobble_detect->is('Safari')) { $classes[] = "safari"; } if ($is_chrome) { $classes[] = "chrome"; } if ($mobble_detect->is('Chrome')) { $classes[] = "chrome"; } if ($is_IE) { $classes[] = "ie"; } if ($mobble_detect->is('IE')) { $classes[] = "ie"; } return $classes; }
echo is_desktop(); echo '</pre>'; echo '<pre>is_tablet() = '; echo is_tablet(); echo '</pre>'; echo '<pre>is_mobile() = '; echo is_mobile(); echo '</pre>'; echo '<pre>is_ipad() = '; echo is_ipad(); echo '</pre>'; echo '<pre>is_ipod() = '; echo is_ipod(); echo '</pre>'; echo '<pre>is_iphone() = '; echo is_iphone(); echo '</pre>'; ?> </div> <div style="padding:5px; margin:10px 0; border-radius:5px; background:#E6E6E6"> <p>Test for browser support:</p> <?php echo '<pre>browser_supports_javascript() = '; echo browser_supports_javascript(); echo '</pre>'; echo '<pre>browser_supports_cookies() = '; echo browser_supports_cookies(); echo '</pre>'; echo '<pre>browser_supports_css() = '; echo browser_supports_css();
function do_login() { global $fr_version, $fr_platform; $options = vB::get_datastore()->get_value('options'); $cleaned = vB::getCleaner()->cleanArray($_REQUEST, array('username' => vB_Cleaner::TYPE_STR, 'password' => vB_Cleaner::TYPE_STR, 'md5_password' => vB_Cleaner::TYPE_STR, 'fr_username' => vB_Cleaner::TYPE_STR, 'fr_b' => vB_Cleaner::TYPE_BOOL, 'token' => vB_Cleaner::TYPE_STR)); $navbg = null; if (strlen($options['forumrunner_branding_navbar_bg'])) { $navbg = $options['forumrunner_branding_navbar_bg']; if (is_iphone() && strlen($navbg) == 7) { $r = hexdec(substr($navbg, 1, 2)); $g = hexdec(substr($navbg, 3, 2)); $b = hexdec(substr($navbg, 5, 2)); $navbg = "{$r},{$g},{$b}"; } } $out = array('v' => $fr_version, 'p' => $fr_platform); if ($navbg) { $out['navbg'] = $navbg; } if (is_iphone() && $options['forumrunner_admob_publisherid_iphone']) { $out['admob'] = $options['forumrunner_admob_publisherid_iphone']; } else { if (is_android() && $options['forumrunner_admob_publisherid_android']) { $out['admob'] = $options['forumrunner_admob_publisherid_android']; } } if ($options['forumrunner_google_analytics_id']) { $out['gan'] = $options['forumrunner_google_analytics_id']; } if ($options['forumrunner_enable_registration']) { $out['reg'] = true; } if (!$cleaned['username'] || !$cleaned['password'] && !$cleaned['md5_password']) { // This could be an attempt to see if forums require login. Check. $out += array('authenticated' => false, 'requires_authentication' => requires_authentication()); } else { $login = vB_Api::instance('user')->login($cleaned['username'], $cleaned['password'], '', '', 'cplogin'); if (isset($login['errors']) and !empty($login['errors'])) { $login = vB_Api::instance('user')->login($cleaned['username'], $cleaned['password'], '', '', ''); if (isset($login['errors']) and !empty($login['errors'])) { return json_error('Incorrect login.', RV_BAD_PASSWORD); } } if (!$options['bbactive'] && !vB::getUserContext()->hasAdminPermission('cancontrolpanel')) { vB_Api::instance('user')->processLogout(); return json_error(strip_tags($options['bbclosedreason']), RV_BAD_PASSWORD); } if (isset($login['cpsession'])) { vB5_Cookie::set('cpsession', $login['cpsession'], 30); } vB5_Cookie::set('sessionhash', $login['sessionhash'], 30); vB5_Cookie::set('password', $login['password'], 30); vB5_Cookie::set('userid', $login['userid'], 30); if (isset($cleaned['fr_username'])) { fr_update_push_user($cleaned['fr_username'], $cleaned['fr_b']); } $userinfo = vB_Api::instance('user')->fetchUserInfo(); $out += array('authenticated' => true, 'username' => $userinfo['username'], 'cookiepath' => $options['cookiepath']); } return $out; }
<div id="half_page_image"></div> <div class="clear"></div> </section> </article> <nav id="menu"> <a class="controller next next_control left_control">1 ページ進む</a> <a class="controller previous previous_control right_control">1 ページ戻る</a> <div class="move_page_wrapper"> <input type="range" name="slider" id="slider_controller" value="1" min="1" max="1" /> <input type="number" name="current_page" id="current_page" value="0" min="1" max="1" /> / <span id="all_page"></span> </div> <div class="clear"></div> <?php if (is_iphone()) { ?> <a class="controller next_file next_control left_control">次のファイル</a> <a class="controller previous_file previous_control right_control">前のファイル</a> <div class="clear"></div> <a id="paint_index" class="selected">蔵書一覧</a> <a id="paint_settings">設定</a> <a id="paint_help">使い方</a> <?php } else { ?> <a class="controller next_file next_control left_control">次のファイル</a> <a id="switch_half_page" class="controller ">単ページ切替</a> <a id="paint_index" class="selected">蔵書一覧</a> <a id="paint_settings">設定</a> <a id="paint_help">使い方</a>
public function actionLogin() { global $fr_version, $fr_platform; $vals = $this->_input->filter(array('username' => XenForo_Input::STRING, 'password' => XenForo_Input::STRING, 'md5_password' => XenForo_Input::STRING, 'fr_username' => XenForo_Input::STRING, 'fr_b' => XenForo_Input::UINT, 'token' => XenForo_Input::STRING)); $login_model = $this->_getLoginModel(); $user_model = $this->_getUserModel(); $options = XenForo_Application::get('options'); $navbg = ''; $style = $options->forumrunnerColor; if ($style) { // Convert to right style. iPhone needs r,g,b. Android needs #rrggbb. $color = convert_color($style); if (is_iphone() && strlen($color) == 7) { $r = hexdec(substr($color, 1, 2)); $g = hexdec(substr($color, 3, 2)); $b = hexdec(substr($color, 5, 2)); $color = "{$r},{$g},{$b}"; } $navbg = $color; } $authenticated = false; $requires_authentication = false; $out = array(); if (!$vals['username'] || !$vals['password'] && !$vals['md5_password']) { if (!XenForo_Visitor::getInstance()->hasPermission('general', 'view')) { $requires_authentication = true; } $options = XenForo_Application::get('options'); if (!$options->boardActive && !XenForo_Visitor::getInstance()->get('is_admin')) { $requires_authentication = true; } } else { $user_id = $user_model->validateAuthentication($vals['username'], $vals['password'], $error); if (!$user_id) { $login_model->logLoginAttempt($vals['username']); json_error($error->render(), RV_BAD_PASSWORD); } $login_model->clearLoginAttempts($vals['username']); $user_model->setUserRememberCookie($user_id); XenForo_Model_Ip::log($user_id, 'user', $user_id, 'login'); XenForo_Application::get('session')->changeUserId($user_id); XenForo_Visitor::setup($user_id); $out['username'] = prepare_utf8_string(XenForo_Visitor::getInstance()->get('username')); $authenticated = true; } $out += array('authenticated' => $authenticated, 'v' => $fr_version, 'p' => $fr_platform, 'requires_authentication' => $requires_authentication); if ($navbg != '') { $out['navbg'] = $navbg; } if (is_iphone() && $options->forumrunnerAdsAdMobPublisherIDiPhone) { $out['admob'] = $options->forumrunnerAdsAdMobPublisherIDiPhone; } else { if (is_android() && $options->forumrunnerAdsAdMobPublisherIDAndroid) { $out['admob'] = $options->forumrunnerAdsAdMobPublisherIDAndroid; } } if ($options->forumrunnerGoogleAnalyticsID && $options->forumrunnerGoogleAnalyticsID != '') { $out['gan'] = $options->forumrunnerGoogleAnalyticsID; } if ($options->forumrunnerFacebookApplicationID && $options->forumrunnerFacebookApplicationID != '') { $out['fb'] = $options->forumrunnerFacebookApplicationID; } if ($options->forumrunnerRegistration) { $out['reg'] = true; } fr_update_push_user($vals['fr_username'], $vals['fr_b'], $vals['token']); return $out; }
/** * Test for iOS * * @return bool */ function is_ios() { if (is_iphone() || is_ipad() || is_ipod()) { return true; } else { return false; } }
function is_mobilePhone() { if (is_ktai() || is_iphone() || is_android() || is_firefox_os() || is_windows_phone() || is_blackberry()) { return true; } else { return false; } }
function do_login() { global $vbulletin, $fr_version, $fr_platform; $vbulletin->input->clean_array_gpc('r', array('username' => TYPE_STR, 'password' => TYPE_STR, 'md5_password' => TYPE_STR, 'fr_username' => TYPE_STR, 'fr_b' => TYPE_BOOL)); $navbg = null; if (strlen($vbulletin->options['forumrunner_branding_navbar_bg'])) { $navbg = $vbulletin->options['forumrunner_branding_navbar_bg']; if (is_iphone() && strlen($navbg) == 7) { $r = hexdec(substr($navbg, 1, 2)); $g = hexdec(substr($navbg, 3, 2)); $b = hexdec(substr($navbg, 5, 2)); $navbg = "{$r},{$g},{$b}"; } } $vbulletin->GPC['username'] = prepare_remote_utf8_string($vbulletin->GPC['username']); $vbulletin->GPC['password'] = prepare_remote_utf8_string($vbulletin->GPC['password']); $out = array('v' => $fr_version, 'p' => $fr_platform); if ($navbg) { $out['navbg'] = $navbg; } if (is_iphone() && $vbulletin->options['forumrunner_admob_publisherid_iphone']) { $out['admob'] = $vbulletin->options['forumrunner_admob_publisherid_iphone']; } else { if (is_android() && $vbulletin->options['forumrunner_admob_publisherid_android']) { $out['admob'] = $vbulletin->options['forumrunner_admob_publisherid_android']; } } if ($vbulletin->options['forumrunner_google_analytics_id']) { $out['gan'] = $vbulletin->options['forumrunner_google_analytics_id']; } if ($vbulletin->options['forumrunner_facebook_application_id']) { $out['fb'] = $vbulletin->options['forumrunner_facebook_application_id']; } if ($vbulletin->options['forumrunner_cms_onoff']) { $out['cms'] = true; $out['cms_section'] = $vbulletin->options['forumrunner_cms_section']; } if ($vbulletin->options['forumrunner_enable_registration']) { $out['reg'] = true; } if ($vbulletin->options['socnet'] & $vbulletin->bf_misc_socnet['enable_albums']) { $out['albums'] = true; } if (!$vbulletin->GPC['username'] || !$vbulletin->GPC['password'] && !$vbulletin->GPC['md5_password']) { // This could be an attempt to see if forums require login. Check. $requires_authentication = false; if (!($vbulletin->userinfo['permissions']['forumpermissions'] & $vbulletin->bf_ugp_forumpermissions['canview'])) { $requires_authentication = true; } // If the forum is closed, require login! if (!$vbulletin->options['bbactive']) { $requires_authentication = true; } $out += array('authenticated' => false, 'requires_authentication' => $requires_authentication); } else { // can the user login? $strikes = verify_strike_status($vbulletin->GPC['username'], true); // make sure our user info stays as whoever we were (for example, we might be logged in via cookies already) $original_userinfo = $vbulletin->userinfo; if (!verify_authentication($vbulletin->GPC['username'], $vbulletin->GPC['password'], $vbulletin->GPC['md5_password'], $vbulletin->GPC['md5_password'], true, true)) { exec_strike_user($vbulletin->GPC['username']); if ($vbulletin->options['usestrikesystem']) { if ($strikes === false) { $message = 'Incorrect login. You have used up your login allowance. Please wait 15 minutes before trying again.'; } else { $message = 'Incorrect login (' . ($strikes + 1) . ' of 5 tries allowed)'; } } else { $message = 'Incorrect login.'; } json_error($message, RV_BAD_PASSWORD); } exec_unstrike_user($vbulletin->GPC['username']); // create new session process_new_login('', true, ''); cache_permissions($vbulletin->userinfo, true); $vbulletin->session->save(); // If the forum is closed, boot em if (!$vbulletin->options['bbactive'] && !($vbulletin->userinfo['permissions']['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel'])) { process_logout(); json_error(strip_tags($vbulletin->options['bbclosedreason']), RV_BAD_PASSWORD); } fr_update_push_user($vbulletin->GPC['fr_username'], $vbulletin->GPC['fr_b']); $out += array('authenticated' => true, 'username' => prepare_utf8_string($vbulletin->userinfo['username']), 'cookiepath' => $vbulletin->options['cookiepath']); } return $out; }
if(is_page('lineas-de-producto')) { $url = home_url('lineas-de-producto/alquiler-de-lockers'); header('Location:' . $url); } /*if(is_page('venta-de-lockers')) { if(is_mobile() || is_iphone() ) { //$url = home_url('lineas-de-producto/venta-de-lockers'); }else{ $url = home_url('lineas-de-producto/venta-de-lockers/locker-linea-m'); header('Location:' . $url); } }*/ if(is_page('informacion-de-contacto')) { if(is_mobile() || is_iphone() ) { }else{ $url = home_url('contactanos'); header('Location:' . $url); } } //Redigir a la misma pagina si accede manualmente a uno de las siguietes paginas if( is_page('my-account') ){ wp_redirect(home_url()); exit; } ?> <!DOCTYPE html>
<div class="lb-mainImage"> <a href="#" class="lb-prev">‹</a> <img> <a href="#" class="lb-next">›</a> </div> <div class="lb-slider"> <a class="buttons prev" href="#"><</a> <div class="viewport"> <ul class="overview"> </ul> </div> <a class="buttons next" href="#">></a> </div> </div> <?php if ((is_page('home') || is_page(11)) && !is_iphone()) { ?> <div id="fullpage"> <?php } else { ?> <div> <?php } ?> <div id="page" class="site"> <a class="skip-link screen-reader-text" href="#content"><?php esc_html_e('Skip to content', 'reidcompton'); ?> </a>