本文整理汇总了PHP中ismobile函数的典型用法代码示例。如果您正苦于以下问题:PHP ismobile函数的具体用法?PHP ismobile怎么用?PHP ismobile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ismobile函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: updatetable
$protect_info['answer1'] = $protect_info['answer1_1'];
$protect_info['answer2'] = $protect_info['answer2_1'];
$protect_info['answer3'] = $protect_info['answer3_1'];
updatetable('protect_info', $protect_info, array('uid' => $_SGLOBAL['supe_uid']));
showmessage('成功设置密保问题!', 'cp.php?ac=protect&op=question');
} else {
showmessage('密保答案错误!', 'cp.php?ac=protect&op=question');
}
}
} elseif ($_GET['op'] == 'mobile') {
$send_interval = 60 * 2;
if (!empty($_GET['get_code'])) {
if ($protect_info['mobile_send_time'] + $send_interval > $_SGLOBAL['timestamp']) {
showmessage("发送太快!", 'cp.php?ac=protect&op=mobile');
} else {
if (!ismobile($_GET['mobile'])) {
showmessage('手机号码不正确!', 'cp.php?ac=protect&op=mobile');
} else {
$protect_info['mobile_send_time'] = $_SGLOBAL['timestamp'];
$verifycode = rand(100000, 999999);
$protect_info['mobile_code'] = $verifycode;
$protect_info['mobile_1'] = $_GET['mobile'];
$content = "您在i北航(i.buaa.edu.cn)的手机密保验证码为" . $verifycode . "请及时输入验证码完成手机密保设置!";
if (sendsms($_GET['mobile'], '验证码', $content)) {
if ($first_time) {
$protect_info['uid'] = $_SGLOBAL['supe_uid'];
inserttable('protect_info', $protect_info);
} else {
updatetable('protect_info', $protect_info, array('uid' => $_SGLOBAL['supe_uid']));
}
showmessage("成功发送!", "cp.php?ac=protect&op=mobile");
开发者ID:shiyake,项目名称:php-ihome,代码行数:31,代码来源:cp_protect.php
示例17: checkinfo
function checkinfo($realname, $email, $mobile)
{
global $_SGLOBAL;
$message = '';
if (empty($realname)) {
$message = '对不起,姓名不能为空!';
return $message;
}
if (empty($email) && empty($mobile)) {
$message = '对不起,Email和手机不能全为空!';
return $message;
}
if (!empty($email) && !isemail($email)) {
$message = '对不起,Email的格式不对!';
return $message;
}
/*检查该用户是否已经激活开通*/
$query = $_SGLOBAL['db']->query("SELECT userid FROM " . tname('baseprofile') . " WHERE realname='{$realname}' and birthday='{$birthday}' and isactive=1 limit 1");
if ($active = $_SGLOBAL['db']->result($query)) {
$message = '邀请不成功,该用户已开通个人空间';
return $message;
}
if (!empty($mobile)) {
$mobile = ismobile($mobile);
if (!$mobile) {
$message = '对不起,输入手机号有误,请重新输入';
return $message;
}
/*判断该手机号是否已经开通过个人主页,是否一天之内邀请同一个人的次数超过3次*/
$query = $_SGLOBAL['db']->query("SELECT id FROM " . tname('mobilereg') . " WHERE mobile = '{$mobile}' and status=1 limit 1");
if ($value = $_SGLOBAL['db']->result($query)) {
$message = '该手机号已经激活开通个人主页。';
return $message;
} else {
$query = $_SGLOBAL['db']->query("SELECT id FROM " . tname('mobilereg') . " WHERE mobile = '" . $mobile . "' and status=0 ORDER BY dateline DESC LIMIT 1");
if ($value = $_SGLOBAL['db']->fetch_array($query)) {
if ($_SGLOBAL['timestamp'] - $value['dateline'] <= 60) {
$message = '对不起,您的操作过快,请等待30秒再接收验证码';
return $message;
}
$yesterday = $_SGLOBAL['timestamp'] - 86400;
$query = $_SGLOBAL['db']->query("SELECT mobile FROM " . tname('mobilereg') . " WHERE mobile = '" . $mobile . "' AND dateline > '" . $yesterday . "' ");
$count = $_SGLOBAL['db']->num_rows($query);
if ($count >= 3) {
$message = '您已经邀请手机号:' . $mobile . '发出的' . $count . '条邀请短信。';
return $message;
}
} else {
$query = $_SGLOBAL['db']->query("SELECT uid FROM " . tname('spacefield') . " WHERE mobile = '{$mobile}' limit 1");
if ($value = $_SGLOBAL['db']->result($query)) {
$message = '该手机号已经激活开通个人主页。';
return $message;
}
}
}
}
return $message;
}
开发者ID:shiyake,项目名称:php-ihome,代码行数:58,代码来源:cp_invitefriend.php
示例18: viewthread_avatar_output
function viewthread_avatar_output()
{
global $_G, $postlist;
if (!$this->allow) {
return;
}
if ($_G['cache']['plugin']['smstong']['displaythreadmobile']) {
foreach ($postlist as $id => $post) {
if ($post['authorid']) {
$target .= $post['authorid'] . ',';
}
}
$target = substr($target, 0, -1);
if (!empty($target)) {
$query = DB::query("SELECT * FROM " . DB::table("common_member_profile") . " WHERE uid in ({$target})");
while ($data = DB::fetch($query)) {
$user[$data['uid']] = $data;
}
include_once DISCUZ_ROOT . './data/plugindata/smstong.lang.php';
require_once DISCUZ_ROOT . './source/plugin/smstong/smstong.func.php';
foreach ($user as $uid => $ex) {
if (ismobile($user[$uid]['mobile'])) {
$mobile[$uid] = " <img src='source/plugin/smstong/mobile.gif' title='" . lang('plugin/smstong', 'smstong_mobilebind_bindimage') . "' />";
}
}
foreach ($postlist as $id => $post) {
$return[] = $mobile[$post['uid']];
}
return $return;
}
return;
}
return;
}
开发者ID:Jaedeok-seol,项目名称:discuz_template,代码行数:34,代码来源:smstong.class.php
示例19: QRCode
})
</script>
<?php
}
?>
<script>
window.isArchive = <?php
if ($this->is('index') || $this->is('archive')) {
echo 'true';
} else {
echo 'false';
}
?>
;
<?php
if (!ismobile()) {
?>
$(function(){
var qrcode = new QRCode(document.getElementById("qrcode-img"), {
width : 96,//设置宽高
height : 96
});
qrcode.makeCode("<?php
echo $this->request->getRequestUrl();
?>
");
});
<?php
}
?>
</script>
开发者ID:liuxuqing,项目名称:jianshu,代码行数:31,代码来源:footer.php
示例20: tname
$jslist[] = $value;
}
$query = $_SGLOBAL['db']->query("SELECT name,tel,address FROM " . tname('jifen_cjlog') . " WHERE uid=" . $_SGLOBAL[supe_uid] . " group by name,tel,address");
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
$jslist[] = $value;
}
if ($_POST) {
if (!$_POST['realname'] || !$_POST['tel']) {
showmessage("信息填写有误");
}
if ($_POST['tel']) {
if (!ismobile($_POST['tel'])) {
showmessage("手机号有误!");
}
}
$arr = array("uid" => $_SGLOBAL[supe_uid], "username" => $_SGLOBAL[supe_username], "lpid" => $lpid, "giftname" => $thevalue[name], "time" => time(), "address" => strip_tags($_POST['address']), "tel" => ismobile(strip_tags($_POST['tel'])), "name" => strip_tags($_POST['realname']));
$id = inserttable('jifen_dhlog', $arr, 1);
//插入数据
$_SGLOBAL['db']->query('UPDATE ' . tname('jifen_lp') . ' SET total=total-1,nums=nums+1 WHERE id=' . $lpid);
//更新礼品信息
$_SGLOBAL['db']->query('UPDATE ' . tname('space') . ' SET credit=credit-' . $thevalue['price'] . ' WHERE uid=' . $_SGLOBAL[supe_uid]);
//更新积分信息
//发全站feed
$uid = $_SGLOBAL['supe_uid'];
realname_set($_SGLOBAL['supe_uid'], $_SGLOBAL['supe_username']);
realname_get();
include_once S_ROOT . './source/function_cp.php';
$avatar = ckavatar($uid) ? avatar($uid, 'middle', true) : UC_API . '/images/noavatar_middle.gif';
$summay = getstr($thevalue['des'], 150, 1, 1, 0, 0, -1);
if ($thevalue['pic']) {
$thevalue['pic'] = "jifen/uploads/image/" . $thevalue['id'] . ".jpg";
开发者ID:shiyake,项目名称:php-ihome,代码行数:31,代码来源:jifen_dh.php
注:本文中的ismobile函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论