本文整理匯總了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