• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP setNcCookie函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: logoutOp

 public function logoutOp() {
     $this->recordSellerLog('注销成功');
     // 清除店铺消息数量缓存
     setNcCookie('storemsgnewnum'.$_SESSION['seller_id'],0,-3600);
     session_destroy();
     redirect('index.php?act=seller_login');
 }
开发者ID:noikiy,项目名称:ejia,代码行数:7,代码来源:seller_logout.php


示例2: loginoutOp

 public function loginoutOp()
 {
     session_unset();
     session_destroy();
     setNcCookie('goodsnum', '', -3600);
     showDialog(L('login_logout_success'), '', 'succ', '', 2);
 }
开发者ID:Maplecms,项目名称:shopnc-api,代码行数:7,代码来源:login.php


示例3: logoutOp

 /**
  * 退出
  */
 public function logoutOp()
 {
     session_unset();
     session_destroy();
     setNcCookie('sys_key', '', -1, '', null);
     @header("Location: index.php");
     exit;
 }
开发者ID:noikiy,项目名称:shopnc-2,代码行数:11,代码来源:index.php


示例4: select_cityOp

 public function select_cityOp()
 {
     $city_id = intval($_GET['city_id']);
     if ($city_id != 0 && (!isset($this->groupbuy_vr_cities['name'][$city_id]) || !isset($this->groupbuy_vr_cities['parent'][$city_id]) || $this->groupbuy_vr_cities['parent'][$city_id] != 0)) {
         showMessage('该城市不存在,请选择其他城市');
     }
     setNcCookie('city_id', $city_id);
     redirect(urlShop('show_groupbuy', $_GET['back_op']));
 }
开发者ID:dotku,项目名称:shopnc_cnnewyork,代码行数:9,代码来源:show_groupbuy.php


示例5: makeSeccode

/**
 * 产生验证码
 *
 * @param string $nchash 哈希数
 * @return string
 */
function makeSeccode($nchash)
{
    $seccode = random(6, 1);
    $seccodeunits = '';
    $s = sprintf('%04s', base_convert($seccode, 10, 23));
    $seccodeunits = 'ABCEFGHJKMPRTVXY2346789';
    if ($seccodeunits) {
        $seccode = '';
        for ($i = 0; $i < 4; $i++) {
            $unit = ord($s[$i]);
            $seccode .= $unit >= 0x30 && $unit <= 0x39 ? $seccodeunits[$unit - 0x30] : $seccodeunits[$unit - 0x57];
        }
    }
    setNcCookie('seccode' . $nchash, encrypt(strtoupper($seccode) . "\t" . time() . "\t" . $nchash, MD5_KEY), 31536000);
    return $seccode;
}
开发者ID:noikiy,项目名称:shopnc-2,代码行数:22,代码来源:seccode.php


示例6: checkStoreMsg

 /**
  * 商家消息数量
  */
 private function checkStoreMsg()
 {
     //判断cookie是否存在
     $cookie_name = 'storemsgnewnum' . $_SESSION['seller_id'];
     if (cookie($cookie_name) != null && intval(cookie($cookie_name)) >= 0) {
         $countnum = intval(cookie($cookie_name));
     } else {
         $where = array();
         $where['store_id'] = $_SESSION['store_id'];
         $where['sm_readids'] = array('notlike', '%,' . $_SESSION['seller_id'] . ',%');
         if ($_SESSION['seller_smt_limits'] !== false) {
             $where['smt_code'] = array('in', $_SESSION['seller_smt_limits']);
         }
         $countnum = Model('store_msg')->getStoreMsgCount($where);
         setNcCookie($cookie_name, intval($countnum), 2 * 3600);
         //保存2小时
     }
     Tpl::output('store_msg_num', $countnum);
 }
开发者ID:uwitec,项目名称:xbshop,代码行数:22,代码来源:control.php


示例7: addforwardOp

	/**
	 * 添加转发
	 */
	public function addforwardOp(){
		$obj_validate = new Validate();
		$originalid = intval($_POST["originalid"]);
		$validate_arr[] = array("input"=>$originalid, "require"=>"true",'validator'=>'Compare',"operator"=>' > ','to'=>0,"message"=>Language::get('sns_forward_fail'));
		$validate_arr[] = array("input"=>$_POST["forwardcontent"], "validator"=>'Length',"min"=>0,"max"=>140,"message"=>Language::get('sns_content_beyond'));
		//发帖数超过最大次数出现验证码
		if(intval(cookie('forwardnum'))>=self::MAX_RECORDNUM){
			$validate_arr[] = array("input"=>$_POST["captcha"], "require"=>"true","message"=>Language::get('wrong_null'));
		}
		$obj_validate -> validateparam = $validate_arr;
		$error = $obj_validate->validate();
		if ($error != ''){
			showDialog($error,'','error');
		}
		//发帖数超过最大次数出现验证码
		if(intval(cookie('forwardnum'))>=self::MAX_RECORDNUM){
			if (!checkSeccode($_POST['nchash'],$_POST['captcha'])){
				showDialog(Language::get('wrong_checkcode'),'','error');
			}
		}
		//查询会员信息
		$member_model = Model('member');
		$member_info = $member_model->getMemberInfo(array('member_id'=>$_SESSION['member_id'],'member_state'=>1));
		if (empty($member_info)){
			showDialog(Language::get('sns_member_error'),'','error');
		}
		//查询原帖信息
		$tracelog_model = Model('sns_tracelog');
		$tracelog_info = $tracelog_model->getTracelogRow(array('trace_id'=>"{$originalid}",'trace_state'=>"0"));
		if (empty($tracelog_info)){
			showDialog(Language::get('sns_forward_fail'),'','error');
		}
		$insert_arr = array();
		$insert_arr['trace_originalid'] = $tracelog_info['trace_originalid']>0?$tracelog_info['trace_originalid']:$originalid;//如果被转发的帖子为原帖的话,那么为原帖ID;如果被转发的帖子为转帖的话,那么为该转帖的原帖ID(即最初始帖子ID)
		$insert_arr['trace_originalmemberid'] = $tracelog_info['trace_originalid']>0?$tracelog_info['trace_originalmemberid']:$tracelog_info['trace_memberid'];
		$insert_arr['trace_memberid'] = $_SESSION['member_id'];
		$insert_arr['trace_membername'] = $_SESSION['member_name'];
		$insert_arr['trace_memberavatar'] = $member_info['member_avatar'];
		$insert_arr['trace_title'] = $_POST['forwardcontent']?$_POST['forwardcontent']:Language::get('sns_forward');
		if ($tracelog_info['trace_originalid'] > 0 || $tracelog_info['trace_from'] != 1){
			$insert_arr['trace_content'] = addslashes($tracelog_info['trace_content']);
		}else {
			$content_str ="<div class=\"title\"><a href=\"%siteurl%index.php?act=member_snshome&mid={$tracelog_info['trace_memberid']}\" target=\"_blank\" class=\"uname\">{$tracelog_info['trace_membername']}</a>";
			$content_str .= Language::get('nc_colon')."{$tracelog_info['trace_title']}</div>";
			$content_str .=addslashes($tracelog_info['trace_content']);
			$insert_arr['trace_content'] = $content_str;
		}
		$insert_arr['trace_addtime'] = time();
		$insert_arr['trace_state'] = '0';
		if ($tracelog_info['trace_privacy'] >0){
			$insert_arr['trace_privacy'] = 2;//因为动态可见权限跟转帖功能,本身就是矛盾的,为了防止可见度无法控制,所以如果原帖不为所有人可见,那么转帖的动态权限就为仅自己可见,否则为所有人可见
		}else {
			$insert_arr['trace_privacy'] = 0;
		}
		$insert_arr['trace_commentcount'] = 0;
		$insert_arr['trace_copycount'] = 0;
		$insert_arr['trace_orgcommentcount'] = $tracelog_info['trace_orgcommentcount'];
		$insert_arr['trace_orgcopycount'] = $tracelog_info['trace_orgcopycount'];
		$result = $tracelog_model->tracelogAdd($insert_arr);
		if ($result){
			//更新动态转发次数
			$tracelog_model = Model('sns_tracelog');
			$update_arr = array();
			$update_arr['trace_copycount'] = array('sign'=>'increase','value'=>'1');
			$update_arr['trace_orgcopycount'] = array('sign'=>'increase','value'=>'1');
			$condition = array();
			//原始贴和被转帖都增加转帖次数
			if ($tracelog_info['trace_originalid'] > 0){
				$condition['traceid_in'] = "{$tracelog_info['trace_originalid']}','{$originalid}";
			}else {
				$condition['trace_id'] = "$originalid";
			}
			$tracelog_model->tracelogEdit($update_arr,$condition);
			unset($condition);
			//更新所有转帖的原帖转发次数
			$condition = array();
			//原始贴和被转帖都增加转帖次数
			if ($tracelog_info['trace_originalid'] > 0){
				$condition['trace_originalid'] = "{$tracelog_info['trace_originalid']}";
			}else {
				$condition['trace_originalid'] = "$originalid";
			}
			$tracelog_model->tracelogEdit(array('trace_orgcopycount'=>$tracelog_info['trace_orgcopycount']+1),$condition);
			if ($_GET['irefresh']){
				//建立cookie
				if (cookie('forwardnum') != null && intval(cookie('forwardnum')) >0){
					setNcCookie('forwardnum',intval(cookie('forwardnum'))+1,2*3600);//保存2小时
				}else{
					setNcCookie('forwardnum',1,2*3600);//保存2小时
				}
				if ($_GET['type']=='home'){
					$js = "$('#friendtrace').lazyshow({url:\"index.php?act=member_snshome&op=tracelist&mid={$tracelog_info['trace_memberid']}&curpage=1\",'iIntervalId':true});";
				}else if ($_GET['type']=='snshome'){
					$js = "$('#forward_".$originalid."').hide();$('#friendtrace').lazyshow({url:\"index.php?act=member_snshome&op=tracelist&mid={$tracelog_info['trace_memberid']}&curpage=1\",'iIntervalId':true});";
				}else {
					$js = "$('#friendtrace').lazyshow({url:\"index.php?act=member_snsindex&op=tracelist&curpage=1\",'iIntervalId':true});";
				}
//.........这里部分代码省略.........
开发者ID:noikiy,项目名称:ejia,代码行数:101,代码来源:member_snsindex.php


示例8: delcompareOp

 /**
  * 清除对比栏
  */
 public function delcompareOp()
 {
     if (trim($_GET['gid']) == 'all') {
         $gid_arr = array();
     } else {
         $gids = cookie('comparegoods');
         $gid_arr = $gids ? explode(',', $gids) : array();
         $gid = intval($_GET['gid']);
         if ($gid > 0 && $gid_arr) {
             unset($gid_arr[array_search($gid, $gid_arr)]);
         }
     }
     $gid_str = $gid_arr ? implode(',', $gid_arr) : '';
     //更新cookie数据
     if ($gid_str) {
         setNcCookie('comparegoods', $gid_str);
     } else {
         setNcCookie('comparegoods', '', -3600);
     }
     exit(json_encode(array('done' => true, 'gid_str' => $gid_str)));
 }
开发者ID:flying3615,项目名称:chuniang,代码行数:24,代码来源:compare.php


示例9: save_replyOp

 /**
  * 话题回复保存
  */
 public function save_replyOp()
 {
     // Reply function does close,throw error.
     if (!intval(C('circle_istalk'))) {
         showDialog(L('circle_has_been_closed_reply'));
     }
     // checked cookie of SEC
     if (cookie(circle_intervaltime)) {
         showDialog(L('circle_operation_too_frequent'));
     }
     // 会员信息
     $this->memberInfo();
     // 不是圈子成员不能发帖
     if (!in_array($this->identity, array(1, 2, 3))) {
         showDialog(L('circle_no_join_ban_reply'));
     }
     // 话题信息
     $this->themeInfo();
     if (chksubmit()) {
         /**
          * 验证
          */
         $obj_validate = new Validate();
         $obj_validate->validateparam = array(array("input" => $_POST["replycontent"], "require" => "true", "message" => L('circle_reply_not_null')));
         $error = $obj_validate->validate();
         if ($error != '') {
             showDialog($error);
         } else {
             $model = Model();
             $insert = array();
             $insert['theme_id'] = $this->t_id;
             $insert['circle_id'] = $this->c_id;
             $insert['member_id'] = $_SESSION['member_id'];
             $insert['member_name'] = $_SESSION['member_name'];
             $insert['reply_content'] = circleCenterCensor($_POST['replycontent']);
             $insert['reply_addtime'] = time();
             $insert['is_closed'] = 0;
             // 回复楼层验证
             if ($_POST['answer_id'] != '') {
                 $reply_info = Model()->table('circle_threply')->where(array('theme_id' => $this->t_id, 'reply_id' => intval($_POST['answer_id'])))->find();
                 if (!empty($reply_info)) {
                     $insert['reply_replyid'] = $reply_info['reply_id'];
                     $insert['reply_replyname'] = $reply_info['member_name'];
                 }
             }
             $reply_id = $model->table('circle_threply')->insert($insert);
             if ($reply_id) {
                 if ($_GET['type'] == 'adv') {
                     // 插入话题商品
                     if (!empty($_POST['goods'])) {
                         $goods_insert = array();
                         foreach ($_POST['goods'] as $key => $val) {
                             $p = array();
                             $p['theme_id'] = $this->t_id;
                             $p['reply_id'] = $reply_id;
                             $p['circle_id'] = $this->c_id;
                             $p['goods_id'] = $val['id'];
                             $p['goods_name'] = $val['name'];
                             $p['goods_price'] = $val['price'];
                             $p['goods_image'] = $val['image'];
                             $p['store_id'] = $val['storeid'];
                             $p['thg_type'] = $val['type'];
                             $p['thg_url'] = $val['type'] == 1 ? $val['uri'] : '';
                             $goods_insert[] = $p;
                         }
                         $rs = $model->table('circle_thg')->insertAll($goods_insert);
                     }
                     // 更新话题附件
                     $model->table('circle_affix')->where(array('affix_type' => 2, 'member_id' => $_SESSION['member_id'], 'reply_id' => 0))->update(array('theme_id' => $this->t_id, 'reply_id' => $reply_id, 'circle_id' => $this->c_id));
                 }
                 // 话题被回复数增加 最后发言人发言时间
                 $update = array();
                 $update['theme_id'] = $this->t_id;
                 $update['theme_commentcount'] = array('exp', 'theme_commentcount+1');
                 $update['lastspeak_id'] = $_SESSION['member_id'];
                 $update['lastspeak_name'] = $_SESSION['member_name'];
                 $update['lastspeak_time'] = time();
                 $model->table('circle_theme')->update($update);
                 // 成员回复数增加 最后回复时间
                 $model->table('circle_member')->where(array('member_id' => $_SESSION['member_id'], 'circle_id' => $this->c_id))->update(array('cm_comcount' => array('exp', 'cm_comcount+1'), 'cm_lastspeaktime' => time()));
                 // set cookie of SEC
                 if (intval(C('circle_intervaltime')) > 0) {
                     setNcCookie('circle_intervaltime', true, intval(C('circle_intervaltime')));
                 }
                 if ($this->theme_info['member_id'] != $_SESSION['member_id']) {
                     // Experience for replyer
                     $param = array();
                     $param['member_id'] = $_SESSION['member_id'];
                     $param['member_name'] = $_SESSION['member_name'];
                     $param['circle_id'] = $this->c_id;
                     $param['theme_id'] = $this->t_id;
                     $param['type'] = 'reply';
                     $param['itemid'] = $this->t_id . ',' . $reply_id;
                     Model('circle_exp')->saveExp($param);
                     // Experience for releaser
                     $param = array();
                     $param['member_id'] = $this->theme_info['member_id'];
//.........这里部分代码省略.........
开发者ID:mengtaolin,项目名称:shopping,代码行数:101,代码来源:theme.php


示例10: authOp

 /**
  * 统一身份验证入口
  */
 public function authOp()
 {
     $model_member = Model('member');
     if (chksubmit(false, true)) {
         if (!in_array($_POST['type'], array('modify_pwd', 'modify_mobile', 'modify_email', 'modify_paypwd', 'pd_cash'))) {
             redirect('index.php?act=member_security&op=index');
         }
         $member_common_info = $model_member->getMemberCommonInfo(array('member_id' => $_SESSION['member_id']));
         if (empty($member_common_info) || !is_array($member_common_info)) {
             showMessage('验证失败', '', 'html', 'error');
         }
         if ($member_common_info['auth_code'] != $_POST['auth_code'] || TIMESTAMP - $member_common_info['send_acode_time'] > 1800) {
             showMessage('验证码已被使用或超时,请重新获取验证码', '', 'html', 'error');
         }
         $data = array();
         $data['auth_code'] = '';
         $data['send_acode_time'] = 0;
         $update = $model_member->editMemberCommon($data, array('member_id' => $_SESSION['member_id']));
         if (!$update) {
             showMessage('系统发生错误,如有疑问请与管理员联系', SHOP_SITE_URL, 'html', 'error');
         }
         setNcCookie('seccode' . $_POST['nchash'], '', -3600);
         $_SESSION['auth_' . $_POST['type']] = TIMESTAMP;
         self::profile_menu($_POST['type'], $_POST['type']);
         if ($_POST['type'] == 'pd_cash') {
             Tpl::showpage('member_pd_cash.add');
         } else {
             Tpl::showpage('member_security.' . $_POST['type']);
         }
     } else {
         if (!in_array($_GET['type'], array('modify_pwd', 'modify_mobile', 'modify_email', 'modify_paypwd', 'pd_cash'))) {
             redirect('index.php?act=member_security&op=index');
         }
         //继承父类的member_info
         $member_info = $this->member_info;
         if (!$member_info) {
             $member_info = $model_member->getMemberInfo(array('member_id' => $_SESSION['member_id']), 'member_email,member_email_bind,member_mobile,member_mobile_bind');
         }
         self::profile_menu($_GET['type'], $_GET['type']);
         //第一次绑定邮箱,不用发验证码,直接进下一步
         //第一次绑定手机,不用发验证码,直接进下一步
         if ($_GET['type'] == 'modify_email' && $member_info['member_email_bind'] == '0' || $_GET['type'] == 'modify_mobile' && $member_info['member_mobile_bind'] == '0') {
             $_SESSION['auth_' . $_GET['type']] = TIMESTAMP;
             Tpl::showpage('member_security.' . $_GET['type']);
             exit;
         }
         //修改密码、设置支付密码时,必须绑定邮箱或手机
         if (in_array($_GET['type'], array('modify_pwd', 'modify_paypwd')) && $member_info['member_email_bind'] == '0' && $member_info['member_mobile_bind'] == '0') {
             showMessage('请先绑定邮箱或手机', 'index.php?act=member_security&op=index', 'html', 'error');
         }
         Tpl::output('member_info', $member_info);
         Tpl::showpage('member_security.auth');
     }
 }
开发者ID:ff00x0,项目名称:shopnc,代码行数:57,代码来源:member_security.php


示例11: delOp

 /**
  * 购物车删除单个商品,未登录前使用cart_id即为goods_id
  */
 public function delOp()
 {
     $cart_id = intval($_GET['cart_id']);
     if ($cart_id < 0) {
         return;
     }
     $model_cart = Model('cart');
     $data = array();
     if ($_SESSION['member_id']) {
         //登录状态下删除数据库内容
         $delete = $model_cart->delCart('db', array('cart_id' => $cart_id, 'buyer_id' => $_SESSION['member_id']));
         if ($delete) {
             $data['state'] = 'true';
             $data['quantity'] = $model_cart->cart_goods_num;
             $data['amount'] = $model_cart->cart_all_price;
         } else {
             $data['msg'] = Language::get('cart_drop_del_fail', 'UTF-8');
         }
     } else {
         //未登录时删除cookie的购物车信息
         $delete = $model_cart->delCart('cookie', array('goods_id' => $cart_id));
         if ($delete) {
             $data['state'] = 'true';
             $data['quantity'] = $model_cart->cart_goods_num;
             $data['amount'] = $model_cart->cart_all_price;
         }
     }
     setNcCookie('cart_goods_num', $model_cart->cart_goods_num, 2 * 3600);
     $json_data = json_encode($data);
     if (isset($_GET['callback'])) {
         $json_data = $_GET['callback'] == '?' ? '(' . $json_data . ')' : $_GET['callback'] . "({$json_data});";
     }
     exit($json_data);
 }
开发者ID:xuxuecheng,项目名称:shopnc,代码行数:37,代码来源:cart.php


示例12: del_msgOp

 /**
  * AJAX删除消息
  */
 public function del_msgOp()
 {
     // 验证参数
     $smids = $_GET['smids'];
     if (!preg_match('/^[\\d,]+$/i', $smids)) {
         showDialog(L('para_error'), '', 'error');
     }
     $smid_array = explode(',', $smids);
     // 验证是否为管理员
     if (!$this->checkIsAdmin()) {
         showDialog(L('para_error'), '', 'error');
     }
     $where = array();
     $where['store_id'] = $_SESSION['store_id'];
     $where['sm_id'] = array('in', $smid_array);
     // 删除消息记录
     Model('store_msg')->delStoreMsg($where);
     // 删除阅读记录
     unset($where['store_id']);
     Model('store_msg_read')->delStoreMsgRead($where);
     // 清除店铺消息数量缓存
     setNcCookie('storemsgnewnum' . $_SESSION['seller_id'], 0, -3600);
     showDialog(L('nc_common_op_succ'), 'reload', 'succ');
 }
开发者ID:uwitec,项目名称:xbshop,代码行数:27,代码来源:store_msg.php


示例13: getCartNum

 /**
  * 计算购物车总商品数和总金额 
  * @param string $type 购物车信息保存类型 db,cookie,cache
  * @param array $condition 只有登录后操作购物车表时才会用到该参数
  */
 public function getCartNum($type, $condition = array())
 {
     if ($type == 'db') {
         $cart_all_price = 0;
         $cart_goods = $this->listCart('db', $condition);
         $this->cart_goods_num = count($cart_goods);
         if (!empty($cart_goods) && is_array($cart_goods)) {
             foreach ($cart_goods as $val) {
                 $cart_all_price += $val['goods_price'] * $val['goods_num'];
             }
         }
         $this->cart_all_price = ncPriceFormat($cart_all_price);
     } elseif ($type == 'cache') {
         $obj_cache = Cache::getInstance(C('cache.type'));
         $cart_array = $obj_cache->get($_COOKIE['PHPSESSID'], 'cart_');
         $cart_array = @unserialize($cart_array);
         $cart_array = !is_array($cart_array) ? array() : $cart_array;
         $this->cart_goods_num = count($cart_array);
         $cart_all_price = 0;
         if (!empty($cart_array)) {
             foreach ($cart_array as $v) {
                 $cart_all_price += floatval($v['goods_price']) * intval($v['goods_num']);
             }
         }
         $this->cart_all_price = $cart_all_price;
     } elseif ($type == 'cookie') {
         $cart_str = get_magic_quotes_gpc() ? stripslashes(cookie('cart')) : cookie('cart');
         $cart_str = base64_decode(decrypt($cart_str));
         $cart_array = @unserialize($cart_str);
         $cart_array = !is_array($cart_array) ? array() : $cart_array;
         $this->cart_goods_num = count($cart_array);
         $cart_all_price = 0;
         foreach ($cart_array as $v) {
             $cart_all_price += floatval($v['goods_price']) * intval($v['goods_num']);
         }
         $this->cart_all_price = $cart_all_price;
     }
     setNcCookie('cart_goods_num', $this->cart_goods_num, 2 * 3600);
     return $this->cart_goods_num;
 }
开发者ID:norain2050,项目名称:xingkang,代码行数:45,代码来源:cart.model.php


示例14: indexOp

	/**
	 * 首页 话题列表
	 */
	public function indexOp(){
		// 圈子信息
		$this->circleInfo();

		// 圈主和管理信息
		$this->manageList();

		// 会员信息
		$this->memberInfo();

		// sidebar相关
		$this->sidebar();

		$model = Model();
		// 话题列表
		$where = array();
		$where['circle_id']	= $this->c_id;
		$thc_id = intval($_GET['thc_id']);
		if($thc_id > 0){
			$where['thclass_id']= $thc_id;
			Tpl::output('thc_id', $thc_id);
		}
		if(intval($_GET['cream']) == 1){
			$where['is_digest'] = 1;
		}
		$theme_list = $model->table('circle_theme')->where($where)->order('is_stick desc,lastspeak_time desc')->page(20)->select();
		$theme_list = array_under_reset($theme_list, 'theme_id');
		Tpl::output('show_page', $model->showpage('2'));
		Tpl::output('theme_list', $theme_list);

		// 附件列表
		if(!empty($theme_list)){
			$themeid_array = array_keys($theme_list);
			$affix_list = $model->table('circle_affix')->where(array('affix_type'=>1,'theme_id'=>array('in', $themeid_array)))->select();
			$affix_list = array_under_reset($affix_list, 'theme_id', 2);
			Tpl::output('affix_list', $affix_list);
		}

		// 今日话题数
		// 当天时间戳
		$year = date("Y");$month = date("m");$day = date("d");
		$dayBegin = mktime(0,0,0,$month,$day,$year);
		$todaythcount = $model->table('circle_theme')->where(array('theme_addtime'=>array('egt',$dayBegin), 'circle_id'=>$this->c_id))->count();
		Tpl::output('todaythcount', $todaythcount);

		//展示形式,默认以图文展示 list/preview
		if($_GET['type'] != ''){
			$display_mode = ($_GET['type'] == 'list')?'list':'preview';
			setNcCookie('circleDisplayMode', $display_mode, 30*24*60*60);
		}else{
			$display_mode = cookie('circleDisplayMode') ? cookie('circleDisplayMode') : 'preview';
		}
		Tpl::output('display_mode',$display_mode);

		// 话题分类
		$where = array();
		$where['circle_id']		= $this->c_id;
		$where['thclass_status']= 1;
		$thclass_list = $model->table('circle_thclass')->where($where)->order('thclass_sort asc')->select();
		$thclass_list = array_under_reset($thclass_list, 'thclass_id');
		Tpl::output('thclass_list', $thclass_list);

		// Read Permission
		$readperm = $this->readPermissions($this->cm_info);
		Tpl::output('readperm', $readperm);
		Tpl::output('m_readperm', $this->m_readperm);

		$this->circleSEO($this->circle_info['circle_name']);
		// breadcrumb navigation
		$this->breadcrumd();
		Tpl::showpage('group');
	}
开发者ID:noikiy,项目名称:shop-2,代码行数:75,代码来源:group.php


示例15: select_cityOp

 public function select_cityOp()
 {
     $city_id = intval($_GET['city_id']);
     $model_live_area = Model('live_area');
     $city = $model_live_area->live_areaInfo(array('live_area_id' => $city_id));
     if (empty($city) && $city_id != 0) {
         showMessage('该城市不存在,请选择其他城市');
     }
     setNcCookie('city_id', $city_id);
     redirect("index.php?act=show_live_groupbuy");
 }
开发者ID:mengtaolin,项目名称:shopping,代码行数:11,代码来源:show_live_groupbuy.php


示例16: remind_renewalOp

 /**
  * 提醒续费
  */
 public function remind_renewalOp()
 {
     $store_id = intval($_GET['store_id']);
     $store_info = Model('store')->getStoreInfoByID($store_id);
     if (!empty($store_info) && $store_info['store_end_time'] < TIMESTAMP + 864000 && cookie('remindRenewal' . $store_id) == null) {
         // 发送商家消息
         $param = array();
         $param['code'] = 'store_expire';
         $param['store_id'] = intval($_GET['store_id']);
         $param['param'] = array();
         QueueClient::push('sendStoreMsg', $param);
         setNcCookie('remindRenewal' . $store_id, 1, 86400 * 10);
         // 十天
         showMessage('消息发送成功');
     }
     showMessage('消息发送失败');
 }
开发者ID:flying3615,项目名称:chuniang,代码行数:20,代码来源:store.php


示例17: create_replyOp

 /**
  * POST 话题回复
  */
 public function create_replyOp()
 {
     $model = Model();
     $m_theme = $model->table('circle_theme');
     $theme = $m_theme->where(array("theme_id" => $this->t_id))->select();
     $this->c_id = $theme[0]['circle_id'];
     $to_user_id = $theme[0]['member_id'];
     //        var_dump($this->c_id);
     //圈子信息
     $this->circleInfo();
     // 会员信息
     $this->memberInfo();
     // 不是圈子成员不能发帖
     if (!in_array($this->identity, array(1, 2, 3))) {
         output_error("您不是圈子成员");
     }
     // 话题信息
     $this->themeInfo();
     if (isset($_POST)) {
         /**
          * 验证
          */
         $obj_validate = new Validate();
         $obj_validate->validateparam = array(array("input" => $_POST["replycontent"], "require" => "true", "message" => '回复不能为空'));
         $error = $obj_validate->validate();
         if ($error != '') {
             output_error($error);
         } else {
             $model = Model();
             $insert = array();
             $insert['theme_id'] = $this->t_id;
             $insert['circle_id'] = $this->c_id;
             $insert['member_id'] = $this->member_info['member_id'];
             $insert['member_name'] = $this->member_info['member_name'];
             $insert['reply_content'] = circleCenterCensor($_POST['replycontent']);
             $insert['reply_addtime'] = time();
             $insert['is_closed'] = 0;
             // 回复楼层验证
             if ($this->r_id != '') {
                 $reply_info = Model()->table('circle_threply')->where(array('theme_id' => $this->t_id, 'reply_id' => $this->r_id))->find();
                 if (!empty($reply_info)) {
                     $insert['reply_replyid'] = $reply_info['reply_id'];
                     $insert['reply_replyname'] = $reply_info['member_name'];
                 }
             }
             $reply_id = $model->table('circle_threply')->insert($insert);
             if ($reply_id) {
                 // 话题被回复数增加 最后发言人发言时间
                 $update = array();
                 $update['theme_id'] = $this->t_id;
                 $update['theme_commentcount'] = array('exp', 'theme_commentcount+1');
                 $update['lastspeak_id'] = $this->member_info['member_id'];
                 $update['lastspeak_name'] = $this->member_info['member_name'];
                 $update['lastspeak_time'] = time();
                 $model->table('circle_theme')->update($update);
                 // 成员回复数增加 最后回复时间
                 $model->table('circle_member')->where(array('member_id' => $this->member_info['member_id'], 'circle_id' => $this->c_id))->update(array('cm_comcount' => array('exp', 'cm_comcount+1'), 'cm_lastspeaktime' => time()));
                 // set cookie of SEC
                 if (intval(C('circle_intervaltime')) > 0) {
                     setNcCookie('circle_intervaltime', true, intval(C('circle_intervaltime')));
                 }
                 if ($this->theme_info['member_id'] != $this->member_info['member_id']) {
                     // Experience for replyer
                     $param = array();
                     $param['member_id'] = $this->member_info['member_id'];
                     $param['member_name'] = $this->member_info['member_name'];
                     $param['circle_id'] = $this->c_id;
                     $param['theme_id'] = $this->t_id;
                     $param['type'] = 'reply';
                     $param['itemid'] = $this->t_id . ',' . $reply_id;
                     Model('circle_exp')->saveExp($param);
                     // Experience for releaser
                     $param = array();
                     $param['member_id'] = $this->theme_info['member_id'];
                     $param['member_name'] = $this->theme_info['member_name'];
                     $param['theme_id'] = $this->t_id;
                     $param['circle_id'] = $this->c_id;
                     $param['type'] = 'replied';
                     $param['itemid'] = $this->t_id;
                     Model('circle_exp')->saveExp($param);
                 }
                 $jpush = new JPush();
                 $extras = array();
                 $extras['push_type'] = "hasReply";
                 $extras['id'] = $this->t_id;
                 $extras['circle_id'] = $this->theme_info['circle_id'];
                 //  回复自己的帖子不推送
                 if ($to_user_id != $this->member_info['member_id']) {
                     $jpush->pushMessageByAlias($this->member_info['member_name'] . "发表了新的回帖", "有新的回贴", $extras, array($to_user_id));
                 }
                 output_data(array('success' => '回复成功'));
             } else {
                 output_error("回复失败");
             }
         }
     }
 }
开发者ID:ff00x0,项目名称:shopnc-api,代码行数:100,代码来源:circle_theme.php


示例18: addViewedGoodsToCookie

 /**
  * 浏览过的商品加入浏览历史数据库
  *
  * @param mixed $goods_id 商品ID或者商品ID数组
  * @return array
  */
 public function addViewedGoodsToCookie($goods_id)
 {
     if (!$goods_id) {
         return array('state' => false, 'msg' => '参数错误');
     }
     //浏览时间
     $browsetime = time();
     //构造cookie的一项值,每项cookie的值为商品ID-访问时间
     if (is_array($goods_id)) {
         $goods_idarr = $goods_id;
         foreach ($goods_id as $v) {
             $cookievalue[] = $v . '-' . $browsetime;
         }
     } else {
         $cookievalue[] = $goods_id . '-' . $browsetime;
         $goods_idarr[] = $goods_id;
     }
     unset($goods_id);
     if (cookie('viewed_goods')) {
         //如果cookie已经存在
         $string_viewed_goods = decrypt(cookie('viewed_goods'), MD5_KEY);
         if (get_magic_quotes_gpc()) {
             $string_viewed_goods = stripslashes($string_viewed_goods);
             // 去除斜杠
         }
         $vg_ca = @unserialize($string_viewed_goods);
         if (!empty($vg_ca) && is_array($vg_ca)) {
             foreach ($vg_ca as $vk => $vv) {
                 $vv_arr = explode('-', $vv);
                 if (in_array($vv_arr[0], $goods_idarr)) {
                     //如果该商品的浏览记录已经存在,则删除它
                     unset($vg_ca[$vk]);
                 }
             }
         } else {
             $vg_ca = array();
         }
         //将新浏览历史加入cookie末尾
         array_push($vg_ca, implode(',', $cookievalue));
         //cookie中最多存储50条浏览信息
         if (count($vg_ca) > 50) {
             $vg_ca = array_slice($vg_ca, -50, 50);
         }
     } else {
         $vg_ca = $cookievalue;
     }
     $vg_ca = encrypt(serialize($vg_ca), MD5_KEY);
     setNcCookie('viewed_goods', $vg_ca);
 }
开发者ID:dotku,项目名称:shopnc_cnnewyork,代码行数:55,代码来源:goods_browse.model.php


示例19: _createOrderStep6

 /**
  * 订单后续其它处理
  *
  */
 private function _createOrderStep6()
 {
     $ifcart = $this->_post_data['ifcart'];
     $goods_buy_quantity = $this->_order_data['goods_buy_quantity'];
     $input_voucher_list = $this->_order_data['input_voucher_list'];
     $store_cart_list = $this->_order_data['store_cart_list'];
     $input_buy_items = $this->_order_data['input_buy_items'];
     $order_list = $this->_order_data['order_list'];
     $input_address_info = $this->_order_data['input_address_info'];
     $notice_list = $this->_order_data['notice_list'];
     $fc_id = $this->_order_data['fc_id'];
     $ifgroupbuy = $this->_order_data['ifgroupbuy'];
     //变更库存和销量
     QueueClient::push('createOrderUpdateStorage', $goods_buy_quantity);
     //更新使用的代金券状态
     if (!empty($input_voucher_list) && is_array($input_voucher_list)) {
         QueueClient::push('editVoucherState', $input_voucher_list);
     }
     //更新F码使用状态
     if ($fc_id) {
         QueueClient::push('updateGoodsFCode', $fc_id);
     }
     //更新抢购购买人数和数量
     if ($ifgroupbuy) {
         foreach ($store_cart_list as $goods_list) {
             foreach ($goods_list as $goods_info) {
                 if ($goods_info['ifgroupbuy'] && $goods_info['groupbuy_id']) {
                     $groupbuy_info = array();
                     $groupbuy_info['groupbuy_id'] = $goods_info['groupbuy_id'];
                     $groupbuy_info['quantity'] = $goods_info['goods_num'];
                     QueueClient::push('editGroupbuySaleCount', $groupbuy_info);
                 }
             }
         }
     }
     //删除购物车中的商品
     $this->delCart($ifcart, $this->_member_info['member_id'], array_keys($input_buy_items));
     @setNcCookie('cart_goods_num', '', -3600);
     //保存订单自提点信息
     if (C('delivery_isuse') && intval($input_address_info['dlyp_id'])) {
         $data = array();
         $data['mob_phone'] = $input_address_info['mob_phone'];
         $data['tel_phone'] = $input_address_info['tel_phone'];
         $data['reciver_name'] = $input_address_info['true_name'];
         $data['dlyp_id'] = $input_address_info['dlyp_id'];
         foreach ($order_list as $v) {
             $data['order_sn_list'][$v['order_id']]['order_sn'] = $v['order_sn'];
             $data['order_sn_list'][$v['order_id']]['add_time'] = $v['add_time'];
         }
         QueueClient::push('saveDeliveryOrder', $data);
     }
     //发送提醒类信息
     if (!empty($notice_list)) {
         foreach ($notice_list as $code => $value) {
             QueueClient::push('sendStoreMsg', array('code' => $code, 'store_id' => key($value), 'param' => current($value)));
         }
     }
 }
开发者ID:Maplecms,项目名称:shopnc-api,代码行数:62,代码来源:buy.logic.php


示例20: mergecart

 /**
  * cookie中的cart存入数据库
  *
  */
 private function mergecart()
 {
     //登录之后,判断是否存在购物车cookie
     if (cookie('cart') && $_SESSION['member_id']) {
         //读取cookie购物车信息
         $cart_str = cookie('cart');
         if (get_magic_quotes_gpc()) {
             $cart_str = stripslashes($cart_str);
         }
         //去除斜杠
         $cookie_cart = unserialize($cart_str);
         if (!empty($cookie_cart)) {
             //取出已有购物车信息
             $model_cart = Model('cart');
             $cart_goods_arr = $model_cart->listCart();
             $cart_goodsspecid_arr = array();
             if (!empty($cart_goods_arr)) {
                 foreach ($cart_goods_arr 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP setNoMenorQueCero函数代码示例发布时间:2022-05-15
下一篇:
PHP setMetaData函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap