protected function check_login() { if (!isset($_SESSION['is_login'])) { $ref_url = MICROSHOP_SITE_URL . request_uri(); header('location: ' . SHOP_SITE_URL . '/index.php?act=login&ref_url=' . getRefUrl()); die; } }
function getBlacklist() { $blacklist_data = array(); if (is_file(DIR_SYSTEM . 'blacklist.txt')) { $blacklist = DIR_SYSTEM . 'blacklist.txt'; } else { $blacklist = 'https://raw.githubusercontent.com/epiksel/spammerbye/master/blacklist.txt'; } $spammers = file($blacklist, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); foreach ($spammers as $spammer) { $blacklist_data[] = utf8_strtolower(getRefUrl(trim($spammer))); } return $blacklist_data; }
/** * 创建圈子 */ public function add_groupOp() { if ($_SESSION['is_login'] != 1) { @header('location: ' . SHOP_SITE_URL . '/index.php?act=login&ref_url=' . getRefUrl()); } if (!intval(C('circle_iscreate'))) { showMessage(L('circle_grooup_not_create'), '', '', 'error'); } $model = Model(); // 在验证 // 允许创建圈子验证 $where = array(); $where['circle_masterid'] = $_SESSION['member_id']; $create_count = $model->table('circle')->where($where)->count(); if (intval($create_count) >= C('circle_createsum')) { showDialog(L('circle_create_max_error')); } // 允许加入圈子验证 $where = array(); $where['member_id'] = $_SESSION['member_id']; $join_count = $model->table('circle_member')->where($where)->count(); if (intval($join_count) >= C('circle_joinsum')) { showDialog(L('circle_join_max_error')); } if (chksubmit()) { /** * 验证 */ $obj_validate = new Validate(); $obj_validate->validateparam = array(array("input" => $_POST["c_name"], "require" => "true", "message" => L('circle_name_not_null'))); $error = $obj_validate->validate(); if ($error != '') { showDialog($error); } else { $insert = array(); $insert['circle_name'] = $_POST['c_name']; $insert['circle_masterid'] = $_SESSION['member_id']; $insert['circle_mastername'] = $_SESSION['member_name']; $insert['circle_desc'] = $_POST['c_desc']; $insert['circle_tag'] = $_POST['c_tag']; $insert['circle_pursuereason'] = $_POST['c_pursuereason']; $insert['circle_status'] = 2; $insert['is_recommend'] = 0; $insert['class_id'] = intval($_POST['class_id']); $insert['circle_addtime'] = time(); $insert['circle_mcount'] = 1; $result = $model->table('circle')->insert($insert); if ($result) { // Membership level information $data = rkcache('circle_level') ? rkcache('circle_level') : rkcache('circle_level', true); // 把圈主信息加入圈子会员表 $insert = array(); $insert['member_id'] = $_SESSION['member_id']; $insert['circle_id'] = $result; $insert['circle_name'] = $_POST['c_name']; $insert['member_name'] = $_SESSION['member_name']; $insert['cm_applytime'] = $insert['cm_jointime'] = time(); $insert['cm_state'] = 1; $insert['cm_level'] = $data[1]['mld_id']; $insert['cm_levelname'] = $data[1]['mld_name']; $insert['cm_exp'] = 1; $insert['cm_nextexp'] = $data[2]['mld_exp']; $insert['is_identity'] = 1; $insert['cm_lastspeaktime'] = ''; $model->table('circle_member')->insert($insert); showDialog(L('nc_common_op_succ'), 'index.php?act=group&c_id=' . $result, 'succ'); } else { showDialog(L('nc_common_op_fail')); } } } Tpl::output('create_count', $create_count); Tpl::output('join_count', $join_count); // 圈子分类 $class_list = $model->table('circle_class')->where(array('class_status' => 1))->order('class_sort asc')->select(); Tpl::output('class_list', $class_list); $this->circleSEO(L('circle_create')); Tpl::showpage('group_add'); }
<div class="right"> <div class="member-box"> <?php if (empty($_SESSION['member_id'])) { ?> <div class="portrait"><img src="<?php echo $member_avatar; ?> " onload="javascript:DrawImage(this,72,72);" /></div> <dl class="welcome"> <dt><?php echo $lang['microshop_text_welcome']; ?> </dt> <dd><a href="<?php echo SHOP_SITE_URL . '/index.php?act=login&ref_url=' . getRefUrl(); ?> " class="login-now"><?php echo $lang['microshop_text_login']; ?> </a></dd> </dl> <?php } else { ?> <div class="portrait"> <a href="<?php echo MICROSHOP_SITE_URL . DS; ?> index.php?act=home&member_id=<?php echo $_SESSION['member_id']; ?>
<!-- <li> <a href="<?php echo MICROSHOP_SITEURL . '/index.php?act=home&op=album'; ?> "><?php echo $lang['nc_microshop_album']; ?> </a> </li> --> </ul> </li> <?php } else { ?> <li class="no-sub pngFix"><a href="<?php echo SiteUrl . '/index.php?act=login&ref_url=' . getRefUrl(); ?> "><?php echo $lang['nc_login']; ?> </a></li> <?php } ?> <li class="pngFix"><a href="javascript:void(0)"><?php echo $lang['nc_publish']; ?> <i></i></a> <ul> <li><a href="<?php echo MICROSHOP_SITEURL . '/index.php?act=publish&op=goods_buy';
<?php $member_avatar = getMemberAvatar($_SESSION['member_avatar']); ?> <?php } ?> <div class="head-portrait"><span class="thumb size32" title="<?php echo $_SESSION['member_name'];?>"><i></i><img src="<?php echo $member_avatar;?>" onload="javascript:DrawImage(this,30,30);" /></span></div> <ul class="sub-menu"> <?php if(isset($_SESSION['is_login'])) {?> <li class="pngFix"><a href="javascript:void(0)"><span title="<?php echo $_SESSION['member_name'];?>"><?php echo $_SESSION['member_name'];?></span><i></i></a> <ul> <li><a href="<?php echo MICROSHOP_SITE_URL.'/index.php?act=home&op=goods'?>"><?php echo $lang['nc_microshop_goods'];?></a></li> <li><a href="<?php echo MICROSHOP_SITE_URL.'/index.php?act=home&op=personal'?>"><?php echo $lang['nc_microshop_personal'];?></a></li> <!-- <li> <a href="<?php echo MICROSHOP_SITE_URL.'/index.php?act=home&op=album'?>"><?php echo $lang['nc_microshop_album'];?></a> </li> --> </ul> </li> <?php } else { ?> <li class="no-sub pngFix"><a href="<?php echo SHOP_SITE_URL.'/index.php?act=login&ref_url='.getRefUrl();?>"><?php echo $lang['nc_login'];?></a></li> <?php } ?> <li class="pngFix"><a href="javascript:void(0)"><?php echo $lang['nc_publish'];?><i></i></a> <ul> <li><a href="<?php echo MICROSHOP_SITE_URL.'/index.php?act=publish&op=goods_buy';?>"><?php echo $lang['microshop_goods_buy'];?></a> </li> <li><a href="<?php echo MICROSHOP_SITE_URL.'/index.php?act=publish&op=goods_favorites';?>"><?php echo $lang['microshop_goods_favorite'];?></a> </li> <li><a href="<?php echo MICROSHOP_SITE_URL.'/index.php?act=home&op=personal&publish=personal';?>"><?php echo $lang['nc_microshop_personal'];?></a> </li> <!-- <li> <a href="<?php echo MICROSHOP_SITE_URL.'/index.php?act=publish&op=album';?>"><?php echo $lang['nc_microshop_album'];?></a> </li> --> </ul> </li> <li class="pngFix"><a href="javascript:void(0)"><?php echo $lang['microshop_text_like'];?><i></i></a> <ul> <li> <a href="<?php echo MICROSHOP_SITE_URL.'/index.php?act=home&op=like_list&type=goods'?>"><?php echo $lang['nc_microshop_goods'];?></a> </li> <!--