當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ismobile函數代碼示例

本文整理匯總了PHP中ismobile函數的典型用法代碼示例。如果您正苦於以下問題:PHP ismobile函數的具體用法?PHP ismobile怎麽用?PHP ismobile使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了ismobile函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _initialize

 public function _initialize()
 {
     load('extend');
     if (ismobile()) {
         C('DEFAULT_THEME', 'mobile');
     }
     //全局首頁,用戶個人中心導航分類展示
     $cats = M('Category')->where('isverify=1 and isshow=1')->order('sort desc')->select();
     $this->assign('cats', $cats);
     $m = M('member_user_rank');
     $ranklist = $m->order('rank_id asc')->getField('rank_id,name');
     $this->assign('ranklist', $ranklist);
     //個人信息
     $User = M('Member_user');
     $id = $_SESSION[C('USER_AUTH_KEY_ID')];
     $result = array();
     if (!empty($id)) {
         $result = $User->find($id);
         $result['expires_time'] = strtotime('+' . $result['expires_time'] . 'month', $result['regtime']);
         //新注冊用戶試用2天付費用戶
         if (strtotime('+2 days', $result['regtime']) > time() && $result['user_rank'] < 2) {
             $result['user_rank'] = 2;
             $result['expires_time'] = strtotime('+2 days', $result['regtime']);
         }
     }
     $this->persons = $result;
     $this->assign('persons', $result);
 }
開發者ID:energy162,項目名稱:henguwang,代碼行數:28,代碼來源:CommonAction.class.php

示例2: register

 public function register($username, $password, $field, $type = 'email')
 {
     $returns = array('uid' => '-1', 'username' => '', 'email' => '', 'mobile' => '', 'userip' => '');
     if (!isset($username) || empty($username) || strlen($username) < 2 || !isset($password) || empty($password) || strlen($password) < 6) {
         return $returns;
     }
     if ($type == 'email' && !isemail($field)) {
         return $returns;
     }
     if ($type == 'mobile' && !ismobile($field)) {
         return $returns;
     }
     $this->group = M('member_group')->where("type='member' AND creditslower>=0")->order('creditslower', 'ASC')->find(1);
     cookie('member_group', serialize($this->group));
     $type = $type == 'mobile' ? $type : 'email';
     $email = $type == 'email' ? $field : '';
     $mobile = $type == 'mobile' ? $field : '';
     $account = array('username' => $username, 'password' => sha1(md5($password)), 'email' => $email, 'mobile' => $mobile, 'gid' => $this->group['gid'], 'status' => 0, 'newpm' => 0, 'emailstatus' => 0, 'avatarstatus' => 0, 'regdate' => TIMESTAMP);
     $this->uid = M('member')->insert($account, true);
     $this->username = $username;
     $this->email = $email;
     $this->mobile = $mobile;
     $returns = array('uid' => $this->uid, 'username' => $this->username, 'email' => $this->email, 'mobile' => $this->mobile, 'userip' => $_SERVER['REMOTE_ADDR']);
     $account['uid'] = $this->uid;
     $this->account = $account;
     cookie('member_account', serialize($account));
     $this->status = $this->getStatus();
     cookie('member_status', serialize($this->status));
     $this->count = $this->getCount();
     cookie('member_count', serialize($this->count));
     $this->profile = $this->getProfile();
     cookie('member_profile', serialize($this->profile));
     return $returns;
 }
開發者ID:xy113,項目名稱:XiangBaLaoServer,代碼行數:34,代碼來源:class.Member.php

示例3: chklogin

 /**
  * 登錄驗證
  */
 private function chklogin()
 {
     $account = htmlspecialchars(trim($_GET['account_' . FORMHASH]));
     $password = trim($_GET['password_' . FORMHASH]);
     $captchacode = strtolower(trim($_GET['captchacode']));
     $this->checkCaptchacode($captchacode);
     if (strlen($account) < 2) {
         $this->showError('username_verify_failed');
     }
     if (strlen($password) < 6) {
         $this->showError('password_verify_failed');
     }
     $member = new Member();
     if (isemail($account)) {
         $returns = $member->Login($account, $password, 'email');
     } elseif (ismobile($account)) {
         $returns = $member->Login($account, $password, 'mobile');
     } else {
         $returns = $member->Login($account, $password);
     }
     if ($member->uid > 0) {
         $continue = $_GET['continue'];
         $this->showSuccess('login_succeed', $continue, array(), '', true);
     } else {
         $this->showError('login_verify_failed');
     }
 }
開發者ID:xy113,項目名稱:XiangBaLaoServer,代碼行數:30,代碼來源:class.LoginController.php

示例4: _initialize

 public function _initialize()
 {
     if (ismobile()) {
         C('DEFAULT_THEME', 'mobile');
     }
     //全局首頁,用戶個人中心導航分類展示
 }
開發者ID:easley999,項目名稱:tzj,代碼行數:7,代碼來源:CommonAction.class.php

示例5: run

 public function run(&$return)
 {
     if (ismobile()) {
         //設置默認默認主題為 Mobile
         C('DEFAULT_V_LAYER', 'Mobile');
     }
     $return = true;
 }
開發者ID:shrek4j,項目名稱:class-arranger,代碼行數:8,代碼來源:ClientCheckBehavior.class.php

示例6: _initialize

 public function _initialize()
 {
     if (ismobile()) {
         C('DEFAULT_THEME', 'mobile');
     }
     //全局首頁,用戶個人中心導航分類展示
     $cats = M('Category')->where('isverify=1 and isshow=1')->limit('5')->select();
     $this->assign('cats', $cats);
 }
開發者ID:Mrxiaoyuer,項目名稱:thinkPHP,代碼行數:9,代碼來源:CommonAction.class.php

示例7: _initialize

 public function _initialize()
 {
     if (ismobile()) {
         C('DEFAULT_THEME', 'mobile');
     }
     //全局首頁,用戶個人中心導航分類展示
     $cats = M('Category')->where('isverify=1')->order('sort asc')->select();
     $cats = list2layer($cats, 0);
     // dump($cats);
     $this->assign('cats', $cats);
 }
開發者ID:lazyrong,項目名稱:easycms,代碼行數:11,代碼來源:CommonAction.class.php

示例8: save

 public function save()
 {
     $accountnew = $_GET['accountnew'];
     $profilenew = $_GET['profilenew'];
     if (isemail($accountnew['email']) || ismobile($accountnew['mobile'])) {
         $this->t('member')->where(array('uid' => $this->uid))->update($accountnew);
     }
     $profilenew['locked'] = 1;
     $profilenew['modified'] = time();
     $this->t('member_profile')->where(array('uid' => $this->uid))->update($profilenew);
     $this->showSuccess('modi_succeed');
 }
開發者ID:xy113,項目名稱:XiangBaLaoServer,代碼行數:12,代碼來源:class.ProfileController.php

示例9: _initialize

 public function _initialize()
 {
     if (ismobile()) {
         C('DEFAULT_THEME', 'mobile');
     }
     if (empty($_SESSION[C('USER_AUTH_KEY_F')])) {
         $this->error('請先登入', U('Index/Index/index'));
         return;
     }
     $cats = M('Category')->where('isverify=1 and isshow=1')->limit('5')->select();
     $this->assign('cats', $cats);
     //側欄的數據分配
     $sidebar3 = M('Article')->where('ispush=1 and islock=0')->order('rand()')->limit('5')->select();
     //隨機5篇
     $this->assign('sidebar3', $sidebar3);
 }
開發者ID:xazzz,項目名稱:EasyCMS,代碼行數:16,代碼來源:CommonAction.class.php

示例10: _initialize

 public function _initialize()
 {
     if (ismobile()) {
         C('DEFAULT_THEME', 'mobile');
     }
     if (cookie('username') == '') {
         $this->redirect('index/Login/index');
         return;
     }
     $cats = M('Category')->where('isverify=1 and isshow=1')->limit('5')->select();
     $this->assign('cats', $cats);
     //側欄的數據分配
     $sidebar3 = M('Article')->where('ispush=1 and islock=0')->order('rand()')->limit('5')->select();
     //隨機5篇
     $this->assign('sidebar3', $sidebar3);
 }
開發者ID:easley999,項目名稱:tzj,代碼行數:16,代碼來源:CommonAction.class.php

示例11: _initialize

 public function _initialize()
 {
     //移動設備瀏覽,則切換模板
     if (ismobile()) {
         //設置默認默認主題為 Mobile
         C('DEFAULT_THEME', 'Mobile');
     }
     $user = $this->saveCurrentUserSession();
     if (empty($user)) {
         $actionName = strtolower(ACTION_NAME);
         if (!in_array($actionName, array("login", "checklogin"))) {
             $this->display("LogIn:Index");
             exit;
         }
     }
     $this->user = $user;
 }
開發者ID:CpRobot,項目名稱:Git-MyWeb,代碼行數:17,代碼來源:CommonController.class.php

示例12: unset

        unset($search_condition[$k]);
    }
}
if (!submitcheck('qunfasmssubmit', 1)) {
    showsubmenusteps($Plang['smstong_nav_members_qunfasms'], array(array($Plang['smstong_nav_members_select'], !$_G['gp_submit'])));
    showtagheader('div', 'qunfasms', TRUE);
    showformheader('plugins&operation=config&do=' . $_G['gp_do'] . '&identifier=smstong&pmod=qunfasms', 'qunfasmssubmit');
    showhiddenfields(array('notifymember' => 1));
    echo '<table class="tb tb1">';
    if ($_G['gp_getmobile']) {
        $query = DB::query("SELECT mobile FROM " . DB::table('common_member_profile') . " WHERE mobile<>''");
        require_once DISCUZ_ROOT . './source/plugin/smstong/smstong.func.php';
        while ($v = DB::fetch($query)) {
            foreach ($v as $key => $value) {
                $value = preg_replace('/\\s+/', ' ', $value);
                if (ismobile($value)) {
                    $mobile .= strlen($value) > 11 && is_numeric($value) ? '[' . $value . '],' : $value . ',';
                }
            }
        }
        $_G['gp_mobile'] = trim($mobile, ",");
    }
    showtablerow('', array('class="th12"', ''), array($Plang['smstong_members_qunfasms_mobile'], '<textarea name="mobile" cols="100" rows="25">' . $_G['gp_mobile'] . '</textarea>'));
    showtagheader('tbody', 'messagebody', TRUE);
    showsendsms();
    showtagfooter('tbody');
    $search_condition = serialize($search_condition);
    showsubmit('qunfasmssubmit', 'submit', 'td', '<input type="hidden" name="conditions" value=\'' . $search_condition . '\' />');
    showtablefooter();
    showformfooter();
    showtagfooter('div');
開發者ID:Jaedeok-seol,項目名稱:discuz_template,代碼行數:31,代碼來源:qunfasms.inc.php

示例13: elseif

} elseif ($action == 'bindmobile') {
    require dirname(__FILE__) . '/includes/lib_sms.php';
    $_SESSION['sms_code'] = getverifycode();
    $smarty->assign('sms_code', $_SESSION['sms_code']);
    $smarty->assign('ztime', $_CFG['ihuyi_sms_smsgap']);
    $smarty->display('user_transaction.dwt');
} elseif ($action == 'act_bindmobile') {
    require_once ROOT_PATH . 'includes/lib_sms.php';
    require_once ROOT_PATH . 'languages/' . $_CFG['lang'] . '/sms.php';
    $mobile = isset($_POST['mobile']) ? trim($_POST['mobile']) : '';
    //手機號
    $verifycode = isset($_POST['verifycode']) ? trim($_POST['verifycode']) : '';
    //驗證碼
    if ($_CFG['ihuyi_sms_mobile_bind'] == '1') {
        /* 提交的手機號是否正確 */
        if (!ismobile($mobile)) {
            show_message($_LANG['invalid_mobile_phone']);
        }
        /* 提交的驗證碼不能為空 */
        if (empty($verifycode)) {
            show_message($_LANG['verifycode_empty']);
        }
        /* 提交的驗證碼是否正確 */
        if (empty($mobile)) {
            show_message($_LANG['invalid_verify_code']);
        }
        /* 提交的手機號是否已經綁定帳號 */
        $sql = "SELECT COUNT(user_id) FROM " . $ecs->table('users') . " WHERE mobile_phone = '{$mobile}'";
        if ($db->getOne($sql) > 0) {
            show_message($_LANG['mobile_phone_binded']);
        }
開發者ID:naliduo,項目名稱:ecshop,代碼行數:31,代碼來源:user.php

示例14: action_check_register

function action_check_register()
{
    $user = $GLOBALS['user'];
    $_CFG = $GLOBALS['_CFG'];
    $_LANG = $GLOBALS['_LANG'];
    $smarty = $GLOBALS['smarty'];
    $db = $GLOBALS['db'];
    $ecs = $GLOBALS['ecs'];
    $user_id = $GLOBALS['user_id'];
    include_once ROOT_PATH . 'includes/cls_json.php';
    require_once ROOT_PATH . 'includes/lib_sms.php';
    $json = new JSON();
    $username = trim($_POST['username']);
    $re = $json->decode($_POST['username']);
    $username = $re->username;
    $result = array('error' => '', 'message' => '');
    if (preg_match("/([a-z0-9]*[-_\\.]?[a-z0-9]+)*@([a-z0-9]*[-_]?[a-z0-9]+)+[\\.][a-z]{2,3}([\\.][a-z]{2})?/i", $username)) {
        $sql = "select count(*) from " . $GLOBALS['ecs']->table('users') . " where email = '{$username}'";
        $num = $GLOBALS['db']->getOne($sql);
        if ($num > 0) {
            $result['error'] = 2;
            $result['message'] = '郵箱已存在,請重新輸入!';
        } else {
            $result['error'] = 0;
            $result['message'] = '可以注冊';
        }
    } else {
        if (ismobile($username)) {
            $sql = "select count(*) from " . $GLOBALS['ecs']->table('users') . " where mobile_phone = '{$username}'";
            $num = $GLOBALS['db']->getOne($sql);
            if ($num > 0) {
                $result['error'] = 2;
                $result['message'] = '手機號已存在,請重新輸入!';
            } else {
                $result['error'] = 0;
                $result['message'] = '可以注冊';
            }
        } else {
            $sql = "update " . $GLOBALS['ecs']->table('goods') . " set goods_name = 'ddd' where goods_id = '32'";
            $GLOBALS['db']->query($sql);
            $sql = "select count(*) from " . $GLOBALS['ecs']->table('users') . " where user_name = '{$username}'";
            $num = $GLOBALS['db']->getOne($sql);
            if ($num > 0) {
                $result['error'] = 3;
                $result['message'] = '用戶名已存在,請重新輸入!';
            } else {
                $result['error'] = 0;
                $result['message'] = '可以注冊';
            }
        }
    }
    die($json->encode($result));
}
開發者ID:moonlight-wang,項目名稱:feilun,代碼行數:53,代碼來源:user9-9.php

示例15: paymentSucc

 public function paymentSucc()
 {
     $this->assign('navFlage', 'step4');
     if (ismobile()) {
         $this->display('mobile-paymentSucc');
     } else {
         $this->display('paymentSucc');
     }
 }
開發者ID:rainly123,項目名稱:zyzm,代碼行數:9,代碼來源:ProductOrderController.class.php


注:本文中的ismobile函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。