本文整理汇总了PHP中mc_user_id函数的典型用法代码示例。如果您正苦于以下问题:PHP mc_user_id函数的具体用法?PHP mc_user_id怎么用?PHP mc_user_id使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mc_user_id函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: submit
public function submit()
{
$ip_false = M('option')->where("meta_key='ip_false' AND type='user'")->getField('meta_value', true);
if ($ip_false && in_array(mc_user_ip(), $ip_false)) {
$this->error('您的IP被永久禁止登陆!');
} else {
$user_name = mc_magic_in(mc_remove_html($_POST['user_name'], 'all'));
if ($user_name == '') {
$this->error('账号必须填写!');
} else {
$user_login = M('meta')->where("meta_key='user_name' AND type ='user'")->getField('meta_value', true);
if (in_array(strip_tags($_POST['user_name']), $user_login)) {
$this->error('账号已存在!');
}
}
$user_email = mc_magic_in(mc_remove_html($_POST['user_email'], 'all'));
if (empty($user_email)) {
$this->error('邮箱必须填写!');
} else {
$user_email = M('meta')->where("meta_key='user_email' AND type ='user'")->getField('meta_value', true);
if (in_array(strip_tags($_POST['user_email']), $user_email)) {
$this->error('邮箱已存在!');
}
}
if (empty($_POST['user_pass'])) {
$this->error('密码必须填写!');
}
if ($_POST['user_pass'] != $_POST['user_pass2']) {
$this->error('两次密码必须一致!');
}
$user['title'] = I('param.user_name');
$user['content'] = '';
$user['type'] = 'user';
$user['date'] = strtotime("now");
$result = M("page")->data($user)->add();
if ($result) {
mc_add_meta($result, 'user_name', $user_name, 'user');
$user_pass = md5(I('param.user_pass') . mc_option('site_key'));
mc_add_meta($result, 'user_pass', $user_pass, 'user');
mc_add_meta($result, 'user_email', $user_email, 'user');
mc_add_meta($result, 'user_level', '1', 'user');
cookie('user_name', I('param.user_name'), 36000000000);
cookie('user_pass', $user_pass, 36000000000);
$ip_array = M('action')->where("page_id='" . mc_user_id() . "' AND action_key='ip'")->getField('action_value', true);
if ($ip_array && in_array(mc_user_ip(), $ip_array)) {
} else {
if (!mc_is_admin()) {
mc_add_action(mc_user_id(), 'ip', mc_user_ip());
}
}
if ($_POST['comefrom']) {
$this->success('注册成功', $_POST['comefrom']);
} else {
$this->success('注册成功', U('user/index/edit?id=' . mc_user_id()));
}
} else {
$this->error('注册失败');
}
}
}
示例2: add_post
public function add_post($id = false, $number = false)
{
if (mc_user_id()) {
if ($_GET['wish'] == 1) {
if (is_numeric($id) && is_numeric($number) && $number > 0) {
if (mc_get_meta($id, 'kucun') <= 0) {
$this->error('商品库存不足!');
} else {
if ($_POST['parameter']) {
$this->assign('parameter', $_POST['parameter']);
$this->assign('cart', $number);
} else {
//本商品不存在多种型号
$this->assign('cart', $number);
}
}
} else {
$this->error('参数错误!');
}
}
$this->theme(mc_option('theme'))->display('Publish/add_post');
} else {
$this->success('请先登陆', U('User/login/index'));
}
}
示例3: submit
public function submit()
{
$ip_false = M('option')->where("meta_key='ip_false' AND type='user'")->getField('meta_value', true);
if ($ip_false && in_array(mc_user_ip(), $ip_false)) {
$this->error('您的IP被永久禁止登陆!');
} else {
$page_id = M('meta')->where("meta_key='user_name' AND meta_value='" . mc_magic_in(I('param.user_name')) . "' AND type='user'")->getField('page_id');
$user_pass_true = mc_get_meta($page_id, 'user_pass', true, 'user');
if ($_POST['user_name'] && $_POST['user_pass'] && md5($_POST['user_pass'] . mc_option('site_key')) == $user_pass_true) {
$user_pass = md5(I('param.user_pass') . mc_option('site_key'));
cookie('user_name', I('param.user_name'), 36000000000);
cookie('user_pass', $user_pass, 36000000000);
$ip_array = M('action')->where("page_id='" . mc_user_id() . "' AND action_key='ip'")->getField('action_value', true);
if ($ip_array && in_array(mc_user_ip(), $ip_array)) {
} else {
if (!mc_is_admin()) {
mc_add_action(mc_user_id(), 'ip', mc_user_ip());
}
}
if ($_POST['comefrom']) {
$this->success('登陆成功', $_POST['comefrom']);
} else {
if (mc_is_mobile()) {
$this->success('登陆成功', U('user/index/pro?id=' . mc_user_id()));
} else {
$this->success('登陆成功', U('user/index/index?id=' . mc_user_id()));
}
}
} else {
$this->error('用户名与密码不符!');
}
}
}
示例4: index
public function index()
{
if (mc_user_id()) {
$this->success('您已经登陆', U('home/index/index'));
} else {
$this->theme(mc_option('theme'))->display('User/lostpass');
}
}
示例5: index
public function index($page = 1)
{
if (mc_site_url()) {
$site_url = "http://" . $_SERVER["HTTP_HOST"] . $_SERVER['PHP_SELF'];
$site_url = preg_replace("/\\/[a-z0-9]+\\.php.*/is", "", $site_url);
if ($site_url != mc_site_url()) {
$url = mc_site_url();
Header("Location:{$url}");
} else {
if (is_numeric($page)) {
if ($_GET['keyword']) {
if ($_GET['stype'] == 'article') {
$condition['type'] = 'article';
} elseif ($_GET['stype'] == 'publish') {
$condition['type'] = 'publish';
} else {
$condition['type'] = 'pro';
}
$where['content'] = array('like', "%{$_GET['keyword']}%");
$where['title'] = array('like', "%{$_GET['keyword']}%");
$where['_logic'] = 'or';
$condition['_complex'] = $where;
$this->page = M('page')->where($condition)->order('id desc')->page($page, mc_option('page_size'))->select();
$count = M('page')->where($condition)->count();
$this->assign('count', $count);
$this->assign('page_now', $page);
if ($_GET['stype'] == 'article') {
$this->theme(mc_option('theme'))->display('Article/search');
} elseif ($_GET['stype'] == 'publish') {
$this->theme(mc_option('theme'))->display('Post/search');
} else {
$this->theme(mc_option('theme'))->display('Pro/search');
}
} else {
if (is_numeric($_GET['ref'])) {
session('mc_reffer', $_GET['ref']);
if (mc_user_id() && mc_user_id() != session('mc_reffer') && session('mc_reffer')) {
$user_id = mc_user_id();
$ref_a = mc_get_meta($user_id, 'ref', true, 'user');
if (!is_numeric($ref_a)) {
mc_add_meta($user_id, 'ref', session('mc_reffer'), 'user');
}
}
}
$this->theme(mc_option('theme'))->display('Home/index');
}
} else {
$this->error('参数错误!');
}
}
} else {
$site_url = "http://" . $_SERVER["HTTP_HOST"] . $_SERVER['PHP_SELF'];
$site_url = preg_replace("/\\/[a-z0-9]+\\.php.*/is", "", $site_url);
$url = $site_url . '/install.php';
Header("Location:{$url}");
}
}
示例6: checkout
public function checkout($id, $price)
{
if (mc_user_id()) {
if (is_numeric($price)) {
$this->theme(mc_option('theme'))->display('Post/checkout');
} else {
$this->error('价格必须为数字!');
}
} else {
$this->success('请先登陆!', U('User/login/index'));
}
}
示例7: index
public function index()
{
if (mc_user_id()) {
if (mc_is_mobile()) {
$this->success('登陆成功', U('user/index/pro?id=' . mc_user_id()));
} else {
$this->success('登陆成功', U('user/index/index?id=' . mc_user_id()));
}
} else {
$this->theme(mc_option('theme'))->display('User/lostpass');
}
}
示例8: index
public function index($id, $page = 1)
{
if (is_numeric($id)) {
if (mc_user_id() == $id) {
$args_id = M('meta')->where("meta_key='ref' AND meta_value='{$id}'")->getField('page_id', true);
$condition['id'] = array('in', $args_id);
$this->page = M('page')->where($condition)->order('id desc')->page($page, mc_option('page_size'))->select();
$count = M('page')->where($condition)->count();
$this->assign('id', $id);
$this->assign('count', $count);
$this->assign('page_now', $page);
$this->theme(mc_option('theme'))->display('User/reffer');
} else {
$this->error('您无权查看其他人的推荐记录!');
}
} else {
$this->error('参数错误!');
}
}
示例9: huifu
public function huifu($page = 1)
{
if (mc_user_id()) {
if (mc_is_admin()) {
if ($_POST['msg'] && $_POST['return']) {
mc_add_option($_POST['msg'], $_POST['return'], 'wx_huifu');
$this->success('添加成功!', U('control/weixin/huifu'));
} elseif ($_POST['del']) {
M('option')->where("id = '" . $_POST['del'] . "'")->delete();
$this->success('删除成功!', U('control/weixin/huifu'));
} else {
$this->theme('admin')->display('Control/huifu');
}
} else {
$this->error('您没有权限访问此页面!');
}
} else {
$this->success('请先登陆', U('User/login/index'));
}
}
示例10: mc_option
//——请根据您的业务逻辑来编写程序(以下代码仅作参考)——
//获取支付宝的通知返回参数,可参考技术文档中页面跳转同步通知参数列表
//商户订单号
$out_trade_no = $_GET['out_trade_no'];
//支付宝交易号
$trade_no = $_GET['trade_no'];
//交易状态
$trade_status = $_GET['trade_status'];
if ($_GET['trade_status'] == 'WAIT_SELLER_SEND_GOODS') {
//判断该笔订单是否在商户网站中已经做过处理
//如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
//如果有做过处理,不执行商户的业务程序
} else {
if ($_GET['trade_status'] == 'TRADE_FINISHED') {
//判断该笔订单是否在商户网站中已经做过处理
//如果没有做过处理,根据订单号(out_trade_no)在商户网站的订单系统中查到该笔订单的详细,并执行商户的业务程序
//如果有做过处理,不执行商户的业务程序
} else {
//echo "trade_status=".$_GET['trade_status'];
}
}
//echo "验证成功<br />";
$this->success('支付成功!', mc_option('site_url') . '?m=user&c=index&a=pro&id=' . mc_user_id());
//——请根据您的业务逻辑来编写程序(以上代码仅作参考)——
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
} else {
//验证失败
//如要调试,请看alipay_notify.php页面的verifyReturn函数
//echo "验证失败";
$this->error('支付失败!', mc_option('site_url'));
}
示例11: cart_number
public function cart_number($id, $number, $for = false)
{
if (mc_user_id()) {
if (is_numeric($id) && is_numeric($number)) {
$cart_number = M('action')->where("id='{$id}'")->getField('action_value');
if (mc_cart_kucun($id) > $cart_number) {
$number_now = M('action')->where("user_id='" . mc_user_id() . "' AND action_key='cart' AND id='{$id}'")->getField('action_value');
if ($for) {
$number = -$number;
}
$action['action_value'] = $number_now + $number;
M('action')->where("user_id='" . mc_user_id() . "' AND action_key='cart' AND id='{$id}'")->save($action);
$this->success('更改数量成功!');
} else {
$action['action_value'] = mc_cart_kucun($id);
M('action')->where("user_id='" . mc_user_id() . "' AND action_key='cart' AND id='{$id}'")->save($action);
$this->success('商品库存不足!');
}
} else {
$this->error('参数错误!');
}
} else {
$this->error('请先登陆!');
}
}
示例12: M
$user_id = M('page')->where("title='" . $user_message['screen_name'] . "' AND type ='user'")->getField('id', true);
if ($user_id) {
$user['title'] = $user_name_test;
} else {
$user['title'] = $user_message['screen_name'];
}
} else {
$user['title'] = $user_name_test;
}
$user['content'] = '';
$user['type'] = 'user';
$user['date'] = strtotime("now");
$result = M("page")->data($user)->add();
if ($result) {
mc_add_meta($result, 'user_name', $user_name_test, 'user');
$user_pass = md5($uid . mc_option('site_key'));
mc_add_meta($result, 'user_pass', $user_pass, 'user');
mc_add_meta($result, 'user_wboid', $uid, 'user');
mc_add_meta($result, 'user_level', '1', 'user');
cookie('user_name', $user_name_test, 36000000000);
cookie('user_pass', $user_pass, 36000000000);
$this->success('登陆成功', mc_option('site_url') . '?m=user&c=index&a=edit&id=' . mc_user_id());
} else {
$this->error('登陆失败');
}
}
} else {
?>
授权失败。
<?php
}
示例13: U
?>
">
<?php
echo $val['meta_key'];
?>
</a>
</li>
<?php
}
?>
<?php
if (mc_user_id()) {
?>
<li>
<a href="<?php
echo U('user/index/index?id=' . mc_user_id());
?>
">
用户中心
<?php
if (mc_user_trend_count()) {
?>
(<span class="count"><?php
echo mc_user_trend_count();
?>
</span>)<?php
}
?>
</a>
</li>
<!--li>
示例14: U
?>
</div>
<hr>
</div>
</div>
</div>
<div class="home-main">
<h4 class="title mb-0">
<i class="icon-comments"></i> 商品评论
</h4>
</div>
<div id="pro-single">
<div class="row">
<div class="col-sm-12 pt-0" id="single">
<?php
if (mc_user_id()) {
?>
<form role="form" method="post" action="<?php
echo U('home/perform/comment');
?>
">
<div class="form-group">
<textarea name="content" class="form-control" rows="3" placeholder="请输入评论内容"></textarea>
</div>
<div class="text-center">
<button type="submit" class="btn btn-block btn-warning">
<i class="glyphicon glyphicon-ok"></i> 提交
</button>
</div>
<input type="hidden" name="id" value="<?php
echo $val['id'];
示例15: mc_get_url
?>
<a href="<?php
echo mc_get_url($page_id);
?>
"><?php
echo mc_get_page_field($page_id, 'title');
?>
</a> 中,回复:
<?php
} elseif ($key == 'wish') {
?>
<?php
$author = mc_get_meta($page_id, 'author', true);
?>
<?php
if ($author == mc_user_id()) {
?>
支持了你的心愿 <a href="<?php
echo mc_get_url($page_id);
?>
"><?php
echo mc_get_page_field($page_id, 'title');
?>
</a>:
<?php
} else {
?>
支持了心愿 <a href="<?php
echo mc_get_url($page_id);
?>
"><?php