本文整理汇总了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);
}
示例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;
}
示例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');
}
}
示例4: _initialize
public function _initialize()
{
if (ismobile()) {
C('DEFAULT_THEME', 'mobile');
}
//全局首页,用户个人中心导航分类展示
}
示例5: run
public function run(&$return)
{
if (ismobile()) {
//设置默认默认主题为 Mobile
C('DEFAULT_V_LAYER', 'Mobile');
}
$return = true;
}
示例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);
}
示例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);
}
示例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');
}
示例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);
}
示例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);
}
示例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;
}
示例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');
示例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']);
}
示例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));
}
示例15: paymentSucc
public function paymentSucc()
{
$this->assign('navFlage', 'step4');
if (ismobile()) {
$this->display('mobile-paymentSucc');
} else {
$this->display('paymentSucc');
}
}