当前位置: 首页>>代码示例>>PHP>>正文


PHP mc_get_meta函数代码示例

本文整理汇总了PHP中mc_get_meta函数的典型用法代码示例。如果您正苦于以下问题:PHP mc_get_meta函数的具体用法?PHP mc_get_meta怎么用?PHP mc_get_meta使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了mc_get_meta函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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'));
     }
 }
开发者ID:dalinhuang,项目名称:shouzhangmall,代码行数:25,代码来源:IndexController.class.php

示例2: 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('用户名与密码不符!');
         }
     }
 }
开发者ID:xiaowei521,项目名称:vamshop,代码行数:33,代码来源:LoginController.class.php

示例3: 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}");
     }
 }
开发者ID:xiaowei521,项目名称:vamshop,代码行数:57,代码来源:IndexController.class.php

示例4: elseif

        ?>
<span class="btn btn-danger btn-xs">管理员</span><?php 
    } elseif (mc_comment_group($val['id']) && mc_get_meta($val['user_id'], 'group_admin', true, 'user') == mc_comment_group($val['id'])) {
        ?>
<span class="btn btn-info btn-xs">群组管理员</span><?php 
    }
    ?>
				<!-- --<small class="pull-right"><?php 
    echo date('Y-m-d H:i:s', $val['date']);
    ?>
</small> -->
				<?php 
    if (mc_is_admin()) {
        ?>
<a class="btn btn-danger btn-xs pull-right" href="<?php 
        echo U('home/perform/comment_delete?id=' . $val['id']);
        ?>
">删除</a><?php 
    } elseif (mc_comment_group($val['id']) && mc_get_meta($val['user_id'], 'group_admin', true, 'user') == mc_comment_group($val['id'])) {
    }
    ?>
			</h4>
			<?php 
    echo mc_magic_out($val['action_value']);
    ?>
		</div>
	</div>
	<?php 
}
?>
</div>
开发者ID:dalinhuang,项目名称:shouzhangmall,代码行数:31,代码来源:comment.php

示例5: U

            ?>
</a></li>
						<?php 
        }
        ?>
						<?php 
    }
    ?>
						<li><i class="glyphicon glyphicon-th-list"></i></li>
						<li>
							<a href="<?php 
    echo U('article/index/term?id=' . mc_get_meta($val['id'], 'term'));
    ?>
">
								<?php 
    echo mc_get_page_field(mc_get_meta($val['id'], 'term'), 'title');
    ?>
							</a>
						</li>
					</ul>
					<div id="entry">
						<?php 
    echo mc_magic_out($val['content']);
    ?>
					</div>
					<hr>
					<?php 
    echo W("Comment/index", array($val['id']));
    ?>
				</div>
			</div>
开发者ID:xiaowei521,项目名称:vamshop,代码行数:31,代码来源:single.php

示例6: M

 M('action')->where("user_id='{$user_id}' AND action_key='address_pending'")->save($action);
 $action['action_key'] = 'trade_wait_finished';
 M('action')->where("user_id='{$user_id}' AND action_key='trade_pending'")->save($action);
 $action['action_key'] = 'coins_wait_finished';
 M('action')->where("user_id='{$user_id}' AND action_key='coins_pending'")->save($action);
 //库存、销量
 foreach ($cart as $val) {
     $parameter = M('action')->where("page_id='" . $val['page_id'] . "' AND user_id='{$user_id}'")->order('id asc')->getField('action_value', true);
     if ($parameter) {
         foreach ($parameter as $par) {
             list($par_name, $par_value) = explode('|', $par);
             $kucun = mc_get_meta($val['page_id'], $par_name, 'kucun') - 1;
             mc_update_meta($val['page_id'], $par_name, $kucun, 'kucun');
         }
     }
     $xiaoliang = mc_get_meta($val['page_id'], 'xiaoliang') + 1;
     mc_update_meta($val['page_id'], 'xiaoliang', $xiaoliang);
 }
 //积分
 $coins = M('action')->where("user_id='{$user_id}' AND action_key='coins_wait_finished'")->order('id desc')->select();
 mc_update_coins($user_id, -$coins);
 mc_add_action($user_id, 'coins', -$coins);
 //奖励积分
 $jifen_per = mc_option('jifen');
 if ($jifen_per > 0 && $jifen_per <= 100) {
     $jifen = $total_fee * $jifen_per / 100;
     mc_update_coins($user_id, $jifen);
     mc_add_action($user_id, 'coins', $jifen);
 }
 //------------------------------
 //处理业务完毕
开发者ID:xiaowei521,项目名称:vamshop,代码行数:31,代码来源:payNotifyUrl.php

示例7: ip_false

 public function ip_false($id)
 {
     if (is_numeric($id)) {
         if (mc_is_admin()) {
             if (mc_get_meta($id, 'user_level', true, 'user') != 10) {
                 $ip_array = M('action')->where("page_id='{$id}' AND action_key='ip'")->getField('action_value', true);
                 if ($ip_array) {
                     foreach ($ip_array as $ip) {
                         mc_add_option('ip_false', $ip, 'user');
                     }
                 }
                 mc_delete_page($id);
                 $this->success('操作成功', U('Home/index/index'));
             } else {
                 $this->error('请不要伤害管理员');
             }
         } else {
             $this->error('哥们,请不要放弃治疗!', U('Home/index/index'));
         }
     } else {
         $this->error('参数错误!');
     }
 }
开发者ID:xiaowei521,项目名称:vamshop,代码行数:23,代码来源:PerformController.class.php

示例8: mc_magic_out

					<div class="form-group">
						<textarea name="content" class="form-control" rows="3"><?php 
echo mc_magic_out(mc_get_page_field($_GET['id'], 'content'));
?>
</textarea>
					</div>
				</div>
				<div class="form-group">
					<input name="keywords" type="text" class="form-control" placeholder="关键词(Keywords),多个关键词以英文半角逗号隔开(选填)" value="<?php 
echo mc_get_meta($_GET['id'], 'keywords');
?>
">
				</div>
				<div class="form-group">
					<textarea name="description" class="form-control" rows="3" placeholder="摘要(Description),会被搜索引擎抓取为网页描述(选填)"><?php 
echo mc_get_meta($_GET['id'], 'description');
?>
</textarea>
				</div>
				<button type="submit" class="btn btn-warning btn-block">
					<i class="glyphicon glyphicon-ok"></i> 提交
				</button>
			</div>
		</div>
	</div>
	<input name="id" type="hidden" value="<?php 
echo $_GET['id'];
?>
">
	</form>
	<script charset="utf-8" src="<?php 
开发者ID:xiaowei521,项目名称:vamshop,代码行数:31,代码来源:edit_pro.php

示例9: mc_theme_url

				</div>
				<script src="<?php 
echo mc_theme_url();
?>
/js/address.js"></script>
				<div class="form-group">
					<textarea class="form-control" name="buyer_address" rows="3" placeholder="区县、街道、门牌号"><?php 
echo mc_get_meta(mc_user_id(), 'buyer_address', true, 'user');
?>
</textarea>
				</div>
				<div class="form-group">
					<div class="row">
						<div class="col-sm-4">
							<input type="text" class="form-control" name="buyer_phone" placeholder="联系电话,非常重要" value="<?php 
echo mc_get_meta(mc_user_id(), 'buyer_phone', true, 'user');
?>
">
						</div>
					</div>
				</div>
				<?php 
if (mc_is_mobile() && mc_option('alipay_wap_seller')) {
    ?>
				<div class="well">
					<div id="checkout-type">
						<h2 class="title">支付方式</h2>
						<ul class="sel-payment clear">
							<li class="cali">
								<input id="cali" name="bank_type" type="radio" value="0" checked="checked">
								<label class="icon-box0" for="cali">
开发者ID:xiaowei521,项目名称:vamshop,代码行数:31,代码来源:checkout.php

示例10: U

							<i class="fa fa-th-list"></i> 最新话题
							<a class="pull-right" href="<?php 
    echo U('post/group/index');
    ?>
"><i class="fa fa-angle-right"></i></a>
						</div>
						<?php 
    $newpost = M('page')->where("type='publish'")->order('id desc')->page(1, 3)->select();
    if ($newpost) {
        ?>
						<ul class="list-group">
							<?php 
        foreach ($newpost as $val) {
            ?>
							<?php 
            $author = mc_get_meta($val['id'], 'author', true);
            ?>
							<li class="list-group-item">
								<div class="media">
									<a class="media-left" href="<?php 
            echo mc_get_url($author);
            ?>
">
										<div class="img-div img-circle">
											<img class="media-object" src="<?php 
            echo mc_user_avatar($author);
            ?>
" alt="<?php 
            echo mc_user_display_name($author);
            ?>
">
开发者ID:xiaowei521,项目名称:vamshop,代码行数:31,代码来源:index.php

示例11: mc_template_part

<?php

mc_template_part('header');
?>
	<?php 
foreach ($page as $val) {
    ?>
	<?php 
    $author = mc_author_id($val['id']);
    $group_id = mc_get_meta($val['id'], 'group');
    ?>
	<div class="container-fluid post-single">
		<div class="row">
			<div class="col-sm-12 col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
				<ul class="nav nav-tabs mb-10 post-nav">
					<li role="presentation">
						<a href="<?php 
    echo U('post/group/index');
    ?>
">
							社区首页
						</a>
					</li>
					<?php 
    $groups = M('page')->where('type="group"')->order('date desc')->select();
    if ($groups) {
        foreach ($groups as $val_g) {
            ?>
					<li role="presentation" class="<?php 
            if ($group_id == $val_g['id']) {
                echo 'active';
开发者ID:xiaowei521,项目名称:vamshop,代码行数:31,代码来源:single.php

示例12: M

				<div class="form-group">
					<label>
						选择分类
					</label>
					<select class="form-control" name="term">
						<?php 
$terms = M('page')->where('type="term_article"')->order('id desc')->select();
?>
						<?php 
foreach ($terms as $val) {
    ?>
						<option value="<?php 
    echo $val['id'];
    ?>
" <?php 
    if (mc_get_meta($_GET['id'], 'term') == $val['id']) {
        echo 'selected';
    }
    ?>
>
							<?php 
    echo $val['title'];
    ?>
						</option>
						<?php 
}
?>
					</select>
				</div>
				<div class="form-group">
					<label>
开发者ID:dalinhuang,项目名称:shouzhangmall,代码行数:31,代码来源:edit_article.php

示例13: mc_get_meta

    ?>
" data-toggle="modal" data-target="#myModal">
									<i class="glyphicon glyphicon-trash"></i> 删除
								</button>
								<button class="btn btn-default btn-xs user-ip-false" user-data="<?php 
    echo $val['id'];
    ?>
" data-toggle="modal" data-target="#myModal2">
									<i class="glyphicon glyphicon-trash"></i> 屏蔽IP并删除
								</button>
							</div>
						</h4>
						<div class="row">
							<div class="col-xs-6 col-sm-4 col-md-3">
								<?php 
    $user_level = mc_get_meta($val['id'], 'user_level', true, 'user');
    ?>
								<form method="post" action="<?php 
    echo mc_page_url();
    ?>
">
									<select class="form-control input-sm" name="user_level">
										<option value="1" <?php 
    if ($user_level == 1) {
        echo 'selected';
    }
    ?>
>
											普通会员
										</option>
										<option value="6" <?php 
开发者ID:xiaowei521,项目名称:vamshop,代码行数:31,代码来源:manage.php

示例14: U

echo U('control/index/index');
?>
">
					首页
				</a>
			</li>
			<li class="hidden-xs">
				<a href="<?php 
echo U('control/index/pro_index');
?>
">
					商品
				</a>
			</li>
			<?php 
$parent = mc_get_meta($id, 'parent', true, 'term');
if ($parent) {
    ?>
			<li class="hidden-xs">
				<a href="<?php 
    echo U('control/index/pro_term?id=' . $parent);
    ?>
">
					<?php 
    echo mc_get_page_field($parent, 'title');
    ?>
				</a>
			</li>
			<?php 
}
?>
开发者ID:xiaowei521,项目名称:vamshop,代码行数:31,代码来源:term.php

示例15: edit

 public function edit($id)
 {
     if (is_numeric($id)) {
         if (mc_user_id() == $id) {
             if ($_POST['title']) {
                 $title = M('page')->where("title='" . mc_magic_in($_POST['title']) . "' AND type ='user'")->getField('id');
                 if (is_numeric($title) && $title != $id) {
                     $this->error('昵称已存在!');
                 } else {
                     mc_update_page(mc_user_id(), mc_magic_in($_POST['title']), 'title');
                 }
                 if ($_POST['content']) {
                     mc_update_page(mc_user_id(), mc_magic_in($_POST['content']), 'content');
                 }
                 if ($_POST['user_avatar']) {
                     if (mc_get_meta(mc_user_id(), 'user_avatar', true, 'user')) {
                         mc_update_meta(mc_user_id(), 'user_avatar', mc_magic_in($_POST['user_avatar']), 'user');
                     } else {
                         mc_add_meta(mc_user_id(), 'user_avatar', mc_magic_in($_POST['user_avatar']), 'user');
                     }
                 }
                 if ($_POST['fmimg']) {
                     mc_delete_meta($id, 'fmimg', 'basic');
                     mc_add_meta($id, 'fmimg', mc_magic_in($_POST['fmimg']));
                 }
                 mc_delete_meta($id, 'buyer_name', 'user');
                 if ($_POST['buyer_name']) {
                     mc_add_meta($id, 'buyer_name', mc_magic_in($_POST['buyer_name']), 'user');
                 }
                 mc_delete_meta($id, 'buyer_province', 'user');
                 if ($_POST['buyer_province']) {
                     mc_add_meta($id, 'buyer_province', mc_magic_in($_POST['buyer_province']), 'user');
                 }
                 mc_delete_meta($id, 'buyer_city', 'user');
                 if ($_POST['buyer_city']) {
                     mc_add_meta($id, 'buyer_city', mc_magic_in($_POST['buyer_city']), 'user');
                 }
                 mc_delete_meta($id, 'buyer_address', 'user');
                 if ($_POST['buyer_address']) {
                     mc_add_meta($id, 'buyer_address', mc_magic_in($_POST['buyer_address']), 'user');
                 }
                 mc_delete_meta($id, 'buyer_phone', 'user');
                 if ($_POST['buyer_phone']) {
                     mc_add_meta($id, 'buyer_phone', mc_magic_in($_POST['buyer_phone']), 'user');
                 }
                 if ($_POST['user_email']) {
                     mc_update_meta(mc_user_id(), 'user_email', mc_magic_in($_POST['user_email']), 'user');
                 } else {
                     $this->error('邮箱必须填写!');
                 }
                 if (I('param.pass')) {
                     if (I('param.pass2') == I('param.pass')) {
                         mc_update_meta(mc_user_id(), 'user_pass', md5(I('param.pass') . mc_option('site_key')), 'user');
                         $this->success('修改密码成功,请使用新密码登陆', '?m=user&c=login');
                     } else {
                         $this->error('两次密码必须填写一致!');
                     }
                 } else {
                     $this->success('更新资料成功', U('User/index/edit?id=' . $id));
                 }
             } else {
                 $this->theme(mc_option('theme'))->display('User/edit');
             }
         } else {
             $this->error('禁止访问!');
         }
     } else {
         $this->error('参数错误!');
     }
 }
开发者ID:dalinhuang,项目名称:shouzhangmall,代码行数:70,代码来源:IndexController.class.php


注:本文中的mc_get_meta函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。