memberinfo; $grouplist = getcache('grouplist'); $priv_db = pc_base::load_model('category_priv_model'); //加载栏目权限表数据模型 //判断会员组是否允许投稿 if(!$grouplist[$memberinfo['groupid']]['allowpost']) { showmessage(L('member_group').L('publish_deny'), HTTP_REFERER); } //判断每日投稿数 $this->content_check_db = pc_base::load_model('content_check_model'); $todaytime = strtotime(date('y-m-d',SYS_TIME)); $_username = $this->memberinfo['username']; $allowpostnum = $this->content_check_db->count("`inputtime` > $todaytime AND `username`='$_username'"); if($grouplist[$memberinfo['groupid']]['allowpostnum'] > 0 && $allowpostnum >= $grouplist[$memberinfo['groupid']]['allowpostnum']) { showmessage(L('allowpostnum_deny').$grouplist[$memberinfo['groupid']]['allowpostnum'], HTTP_REFERER); } $siteids = getcache('category_content', 'commons'); header("Cache-control: private"); if(isset($_POST['dosubmit'])) { $catid = intval($_POST['info']['catid']); //判断此类型用户是否有权限在此栏目下提交投稿 if (!$priv_db->get_one(array('catid'=>$catid, 'roleid'=>$memberinfo['groupid'], 'is_admin'=>0, 'action'=>'add'))) showmessage(L('category').L('publish_deny'), APP_PATH.'index.php?m=member'); $siteid = $siteids[$catid]; $CATEGORYS = getcache('category_content_'.$siteid, 'commons'); $category = $CATEGORYS[$catid]; $modelid = $category['modelid']; if(!$modelid) showmessage(L('illegal_parameters'), HTTP_REFERER); $this->content_db = pc_base::load_model('content_model'); $this->content_db->set_model($modelid); $table_name = $this->content_db->table_name; $fields_sys = $this->content_db->get_fields(); $this->content_db->table_name = $table_name.'_data'; $fields_attr = $this->content_db->get_fields(); $fields = array_merge($fields_sys,$fields_attr); $fields = array_keys($fields); $info = array(); foreach($_POST['info'] as $_k=>$_v) { if($_k == 'content') { $info[$_k] = remove_xss(strip_tags($_v, '