本文整理汇总了PHP中Mobile_Detect::isiPad方法的典型用法代码示例。如果您正苦于以下问题:PHP Mobile_Detect::isiPad方法的具体用法?PHP Mobile_Detect::isiPad怎么用?PHP Mobile_Detect::isiPad使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mobile_Detect
的用法示例。
在下文中一共展示了Mobile_Detect::isiPad方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: jQuery
?>
<script src="<?php
echo $this->baseurl . '/templates/' . $this->template . '/js/jquery.centerIn.js';
?>
"></script>
<script>
jQuery(function($) {
$('.modal.loginPopup').alwaysCenterIn(window);
});
</script>
<?php
}
?>
<?php
if ($detect->isiPad()) {
?>
<script src="<?php
echo $this->baseurl . '/templates/' . $this->template . '/js/ios-orientationchange-fix.js';
?>
"></script>
<?php
}
?>
<?php
if ($detect->isMobile() || $detect->isTablet()) {
?>
<script src="<?php
echo $this->baseurl . '/templates/' . $this->template . '/js/desktop-mobile.js';
?>
示例2: beforeFilter
public function beforeFilter()
{
parent::beforeFilter();
if (Configure::read('unloadDebugKit') == true) {
$this->Components->unload('DebugKit.Toolbar');
}
// language initialization
$language_list = Configure::read('Config.languageList');
$this->language = $language_list[Configure::read('Config.language')]['code'];
if (isset($this->params['language'])) {
foreach ($language_list as $locale => $language) {
if ($language['active'] && $language['code'] == $this->params['language']) {
$this->language = $this->params['language'];
Configure::write('Config.language', $locale);
break;
}
}
}
// set language
$this->set('language', $this->language);
$this->set('language_list', $language_list);
$this->Session->write('Config.language', $this->language);
// Detect device
$Mobile_Detect = new Mobile_Detect();
$this->device_info = 'Desktop';
$this->device_browser = '';
$this->device_info_type = '';
if ($Mobile_Detect->isTablet()) {
$this->device_info = 'Tablet';
if ($Mobile_Detect->isiPad()) {
$this->device_info_type = 'Ipad';
} else {
if ($Mobile_Detect->isAndroidOS()) {
$this->device_info_type = 'Android';
} else {
$this->device_info_type = 'others';
}
}
} else {
if ($Mobile_Detect->isMobile()) {
$this->device_info = 'Mobile';
if ($Mobile_Detect->isiPhone()) {
$this->device_info_type = 'Iphone';
} else {
if ($Mobile_Detect->isAndroidOS()) {
$this->device_info_type = 'Android';
} else {
$this->device_info_type = 'others';
}
}
}
}
if ($Mobile_Detect->isChrome() && $Mobile_Detect->isSafari()) {
$this->device_browser = 'AndroidDefault';
} else {
if ($Mobile_Detect->isChrome()) {
$this->device_browser = 'Chrome';
} else {
if ($Mobile_Detect->isSafari()) {
$this->device_browser = 'Safari';
} else {
if ($Mobile_Detect->isIE()) {
$this->device_browser = 'IE';
} else {
if ($Mobile_Detect->isFirefox()) {
$this->device_browser = 'Firefox';
} else {
if ($Mobile_Detect->isOpera()) {
$this->device_browser = 'Opera';
} else {
$this->device_browser = 'others';
}
}
}
}
}
}
$this->set('device_info', $this->device_info);
$this->set('device_info_type', $this->device_info_type);
$this->set('device_browser', $this->device_browser);
//GA account
$ga_account = Configure::read('ga_account');
$this->set('ga_account', !empty($ga_account[$this->language]) ? $ga_account[$this->language] : '');
//FB_appID
$FB_appID = Configure::read('FB_appID');
$this->set('FB_appID', $FB_appID);
}
示例3: array
/**
* Loads cookie and sets up theme filters.
*/
static function setup_theme() {
global $wpdb;
$tablemobility = $wpdb->prefix.'ult25_mobile';
$browser = new Mobile_Detect;
if($browser->isMobile()){
if(isset($_REQUEST['theme'])): // click desktop
self::set_theme_onclick();
endif;
self::load_cookie();
if ( ! empty( self::$theme ) ) :
add_filter( 'pre_option_template', array( self::$theme, 'get_template' ) );
add_filter( 'pre_option_stylesheet', array( self::$theme, 'get_stylesheet' ) );
add_filter( 'pre_option_stylesheet_root', array( self::$theme, 'get_theme_root' ) );
$parent = self::$theme->parent();
if( empty( $parent ) )
add_filter( 'pre_option_template_root', array( self::$theme, 'get_theme_root' ) );
else
add_filter( 'pre_option_template_root', array( $parent, 'get_theme_root' ) );
add_filter( 'pre_option_current_theme', '__return_false' );
else:
/*
* isAndroidOS() bool(false)
* isBlackBerryOS() bool(false)
* isPalmOS() bool(false)
* isSymbianOS() bool(false)
* isWindowsMobileOS() bool(false)
* isWindowsPhoneOS() bool(false)
* isiOS() bool(false)
*/
$browsing = false;
if($browser->isiPad()){
$browsing = 'iPad';
} elseif ($browser->isiPhone()){
$browsing= 'iPhone';
} elseif ($browser->isAndroidOS()){
if($browser->isTablet()){
$browsing = 'AndroidTablet';
} else {
$browsing = 'Android';
}
} elseif ($browser->isWindowsMobileOS() || $browser->isWindowsPhoneOS()){
if($browser->isTablet()){
$browsing = 'WindowsTablet';
} else {
$browsing = 'Windows';
}
} elseif ($browser->isBlackBerryOS()){
$browsing = 'BlackBerry';
}
if($browsing){
$mobilethemeq = "SELECT * FROM `".$tablemobility."` WHERE `device`='$browsing'";
$mfetch=$wpdb->get_row($mobilethemeq);
if($mfetch){
$theme = wp_get_theme( $mfetch->theme );
if (
$theme->exists()
&& $theme->get( 'Name' ) != get_option( 'current_theme' )
&& self::is_allowed( $theme )
) {
self::$theme = $theme;
add_filter( 'pre_option_template', array( self::$theme, 'get_template' ) );
add_filter( 'pre_option_stylesheet', array( self::$theme, 'get_stylesheet' ) );
add_filter( 'pre_option_stylesheet_root', array( self::$theme, 'get_theme_root' ) );
$parent = self::$theme->parent();
if( empty( $parent ) )
add_filter( 'pre_option_template_root', array( self::$theme, 'get_theme_root' ) );
else
add_filter( 'pre_option_template_root', array( $parent, 'get_theme_root' ) );
add_filter( 'pre_option_current_theme', '__return_false' );
add_action('ultimatum_meta', 'ultimatum_add_noscale_meta');
add_action('ultimatum_meta', 'ultimatum_web_app_meta');
if($mfetch->mpush==1){
//add_action('ultimatum_meta', 'ultimatum_web_app_bubble');
//add_action('ultimatum_before_body_close','ultimatum_web_app_link_hider');
}
}
}
}
endif;
}
if ( self::can_switch_themes() ) {
self::load_cookie();
if ( ! empty( self::$theme ) ) {
add_filter( 'pre_option_template', array( self::$theme, 'get_template' ) );
add_filter( 'pre_option_stylesheet', array( self::$theme, 'get_stylesheet' ) );
add_filter( 'pre_option_stylesheet_root', array( self::$theme, 'get_theme_root' ) );
$parent = self::$theme->parent();
//.........这里部分代码省略.........
示例4: profile
function profile()
{
$this->load->library('Mobile_Detect');
$detect = new Mobile_Detect();
if (($detect->isMobile() || $detect->isNexusTablet()) && !$detect->isiPad()) {
if ($this->uri->segment(4) == 'sendFriend') {
header('Location: http://m.singaporefriendfinder.com/home/myaccount/' . $this->uri->segment(3) . '/' . $this->uri->segment(4) . '/' . $this->uri->segment(5) . '/' . $this->uri->segment(6) . '');
} else {
header('Location: http://m.singaporefriendfinder.com/');
exit;
}
}
#allow to view profile only if the member is active
$member_id = $this->uri->segment(3);
$member_data = $this->member_model->get_member_by_id($member_id, 'member_active,member_auth_id');
//print_r($member_data);
$data['member_block_data'] = $this->member_model->get_member_by_id($this->uri->segment(3), 'member_blocked_list');
//print_r($data['member_block_data']);
if (empty($member_data) || $member_data['member_active'] == '0') {
$data['js'] = array("search");
//"jquery.raty"
$data['includefile'] = "unauthorized_profile";
} else {
if ($this->uri->segment(4) == 'sendFriend') {
$friendArray = array();
$friendArray['viewMember'] = $this->uri->segment(3);
$friendArray['sendID'] = $this->uri->segment(6);
$friendArray['uniqueCode'] = $this->uri->segment(5);
//echo '<pre>';print_r($friendArray);die;
$retData = $this->member_model->getFriendData($friendArray['uniqueCode'], $friendArray['sendID']);
if (is_array($retData)) {
$getFData = $retData;
$friendArray = array_merge($friendArray, $getFData);
$this->session->set_userdata('sendFriendData', $friendArray);
}
}
$this->session->set_userdata('redirect_url', base_url(uri_string()));
if ($this->uri->segment(4) == "newface") {
$this->user->loginRequired(true, '/member/register/');
} else {
$this->user->loginRequired(true, '/member/login/');
}
$this->member_model->permissionRequired('per_user_profile');
$this->load->model('member_album_model');
$this->load->model('member_wall_model');
if ($_POST['btnWallPost'] == 'WallPost') {
$data = array('wall_member_id' => $this->uri->segment(3), 'wall_write_member_id' => $this->user->id, 'wall_text' => $_POST['wall_text']);
$result = $this->member_wall_model->insertWall($data);
redirect('member/profile/' . $this->uri->segment(3) . '/wall', 'location');
return;
} elseif ($_POST['btnWallCommentPost'] == 'WallCommentPost') {
$data = array('comment_wall_id' => $_POST['comment_wall_id'], 'comment_write_member_id' => $this->user->id, 'comment_text' => $_POST['comment_text']);
$result = $this->member_wall_model->insertWallComment($data);
redirect('member/profile/' . $this->uri->segment(3) . '/wall', 'location');
return;
} elseif ($this->uri->segment(4) == 'walldelete') {
$result = $this->member_wall_model->deleteWall($this->uri->segment(5));
redirect('member/profile/' . $this->uri->segment(3) . '/wall', 'location');
return;
} elseif ($this->uri->segment(4) == 'wallcommentdelete') {
$result = $this->member_wall_model->deleteWallComment($this->uri->segment(5));
redirect('member/profile/' . $this->uri->segment(3) . '/wall', 'location');
return;
} elseif ($this->uri->segment(4) == 'wallcommentlike') {
$result = $this->member_wall_model->likeWallComment($this->uri->segment(5), $this->user->id);
redirect('member/profile/' . $this->uri->segment(3) . '/wall', 'location');
return;
}
$data['memberInfo'] = $this->member_model->getMemInfobyId($this->uri->segment(3), 1);
//echo '<pre>';print_r($data['memberInfo']);die;
$data['profilepic'] = $this->member_model->get_profile_photo_by_id($this->uri->segment(3));
if ($this->uri->segment(3) != $this->user->id) {
$this->load->model('member_viewed_model');
$data['matchInfo'] = $this->member_viewed_model->member_view($data['memberInfo']['user_auth_id']);
//echo '<pre>';print_r($data['matchInfo']); die;
}
/* --------------------- added by pradip for quick search -------------- */
if ($this->session->userdata('quick_search_data')) {
$data['matchInfo'] = $this->member_model->getQuicksearchMatchInfo($this->uri->segment(3), $this->user->id);
//echo '<pre>';print_r($data['matchInfo']);die;
} elseif ($this->session->userdata('adv_search_data')) {
$data['matchInfo'] = $this->member_model->getAdvSearchMatchInfo($this->uri->segment(3), $this->user->id);
} else {
$data = $this->session->userdata('siteSearchData');
//echo '<pre>';print_r($data);
if ($data['reverselist'] == '1') {
$data['matchInfo'] = $this->member_model->getReverseMatchInfo($this->uri->segment(3), $this->user->id);
} else {
$data['matchInfo'] = $this->member_model->getMatchInfo($this->uri->segment(3), $this->user->id);
//echo '<pre>';print_r($data['matchInfo']);
}
}
/* ---------------------------------------------- */
//$data['matchInfo'] = $this->member_model->getMatchInfo($this->uri->segment(3), $this->user->id);
$data['memberInfo'] = $this->member_model->getMemInfobyId($this->uri->segment(3), 1);
//echo '<pre>';print_r($data['matchInfo']);
$data['RecentPhotoInfo'] = $this->member_album_model->getRecentPhotoInfobyMem($this->uri->segment(3));
$data['WallInfo'] = $this->member_wall_model->getWallInfobyMem($this->uri->segment(3), 2);
//echo '<pre>';print_r($data['WallInfo']);
if ($this->member_model->permissionRequired('per_photo_video_section', false)) {
//.........这里部分代码省略.........
示例5: get_device_name
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';
//.........这里部分代码省略.........