当前位置: 首页>>代码示例>>PHP>>正文


PHP Mobile_Detect::isNexusTablet方法代码示例

本文整理汇总了PHP中Mobile_Detect::isNexusTablet方法的典型用法代码示例。如果您正苦于以下问题:PHP Mobile_Detect::isNexusTablet方法的具体用法?PHP Mobile_Detect::isNexusTablet怎么用?PHP Mobile_Detect::isNexusTablet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mobile_Detect的用法示例。


在下文中一共展示了Mobile_Detect::isNexusTablet方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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)) {
//.........这里部分代码省略.........
开发者ID:nilayparekh4693,项目名称:jr,代码行数:101,代码来源:index.php

示例2: 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';
//.........这里部分代码省略.........
开发者ID:sdgdsffdsfff,项目名称:html-sensor,代码行数:101,代码来源:device_name.php


注:本文中的Mobile_Detect::isNexusTablet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。