1、修正会员中心投稿列表模板phpcmstemplatesdefaultmember/content_published.html

将操作列改为 如下:

<ahref="index.php?m=member&c=content&a=edit&catid={$info[catid]}&id={$info[id]}">修正</a>|<ahref="index.php?m=member&c=content&a=delete&catid={$info[catid]}&id={$info[id]}">删去

2、修正phpcms/modules/member/content.php 的会员修正删去函数。

2.1、注释public function edit() 中的if($r['status']==99) showmessage(L('has_been_verified'));

2.2、修正public function delete() 的$where = " checkid='$checkid' and username='$username' and status!=99 "; 改为$where = " checkid='$checkid' and username='$username'";

完好代码如下:

/**
*修正内容
*/
publicfunctionedit(){
$_username=$this->memberinfo['username'];
if(isset($_POST['dosubmit'])){
$catid=$_POST['info']['catid']=intval($_POST['info']['catid']);
$siteids=getcache('category_content','commons');
$siteid=$siteids[$catid];
$CATEGORYS=getcache('category_content_'.$siteid,'commons');
$category=$CATEGORYS[$catid];
if($category['type']==0){
$id=intval($_POST['id']);
$catid=$_POST['info']['catid']=intval($_POST['info']['catid']);
$this->content_db=pc_base::load_model('content_model');
$modelid=$category['modelid'];
$this->content_db->set_model($modelid);
//判别会员组投稿是否需求审阅
$memberinfo=$this->memberinfo;
$grouplist=getcache('grouplist');
$setting=string2array($category['setting']);
if(!$grouplist[$memberinfo['groupid']]['allowpostverify']||$setting['workflowid']){
$_POST['info']['status']=1;
}
$info=array();
foreach($_POST['info']as$_k=>$_v){
if($_k=='content'){
$_POST['info'][$_k]=strip_tags($_v,'<p><a><br><img><ul><li><p>');
}elseif(in_array($_k,$fields)){
$_POST['info'][$_k]=new_html_special_chars(trim_script($_v));
}
}
$_POST['linkurl']=str_replace(array('"','(',')',",",'','%'),'',new_html_special_chars(strip_tags($_POST['linkurl'])));
$this->content_db->edit_content($_POST['info'],$id);
$forward=$_POST['forward'];
showmessage(L('update_success'),$forward);
}
}else{
$show_header=$show_dialog=$show_validator='';
$temp_language=L('news','','content');
//设置cookie在附件增加处调用
param::set_cookie('module','content');
$id=intval($_GET['id']);
if(isset($_GET['catid'])&&$_GET['catid']){
$catid=$_GET['catid']=intval($_GET['catid']);
param::set_cookie('catid',$catid);
$siteids=getcache('category_content','commons');
$siteid=$siteids[$catid];
$CATEGORYS=getcache('category_content_'.$siteid,'commons');
$category=$CATEGORYS[$catid];
if($category['type']==0){
$modelid=$category['modelid'];
$this->model=getcache('model','commons');
$this->content_db=pc_base::load_model('content_model');
$this->content_db->set_model($modelid);
$this->content_db->table_name=$this->content_db->db_tablepre.$this->model[$modelid]['tablename'];
$r=$this->content_db->get_one(array('id'=>$id,'username'=>$_username,'sysadd'=>0));
if(!$r)showmessage(L('illegal_operation'));
#if($r['status']==99)showmessage(L('has_been_verified'));
$this->content_db->table_name=$this->content_db->table_name.'_data';
$r2=$this->content_db->get_one(array('id'=>$id));
$data=array_merge($r,$r2);
requireCACHE_MODEL_PATH.'content_form.class.php';
$content_form=newcontent_form($modelid,$catid,$CATEGORYS);
$forminfos_data=$content_form->get($data);
$forminfos=array();
foreach($forminfos_dataas$_fk=>$_fv){
if($_fv['isomnipotent'])continue;
if($_fv['formtype']=='omnipotent'){
foreach($forminfos_dataas$_fm=>$_fm_value){
if($_fm_value['isomnipotent']){
$_fv['form']=str_replace('{'.$_fm.'}',$_fm_value['form'],$_fv['form']);
}
}
}
$forminfos[$_fk]=$_fv;
}
$formValidator=$content_form->formValidator;
includetemplate('member','content_publish');
}
}
header("Cache-control:private");
}
}
/**
*
*会员删去投稿...
*/
publicfunctiondelete(){
$id=intval($_GET['id']);
if(!$id){
returnfalse;
}
//判别该文章是否待审,而且归于该会员
$username=param::get_cookie('_username');
$userid=param::get_cookie('_userid');
$siteid=get_siteid();
$catid=intval($_GET['catid']);
$siteids=getcache('category_content','commons');
$siteid=$siteids[$catid];
$CATEGORYS=getcache('category_content_'.$siteid,'commons');
$category=$CATEGORYS[$catid];
if(!$category){
showmessage(L('operation_failure'),HTTP_REFERER);
}
$modelid=$category['modelid'];
$checkid='c-'.$id.'-'.$modelid;
#$where="checkid='$checkid'andusername='$username'andstatus!=99";
$where="checkid='$checkid'andusername='$username'";
$check_pushed_db=pc_base::load_model('content_check_model');
$array=$check_pushed_db->get_one($where);
if(!$array){
showmessage(L('operation_failure'),HTTP_REFERER);
}else{
$content_db=pc_base::load_model('content_model');
$content_db->set_model($modelid);
$table_name=$content_db->table_name;
$content_db->delete_content($id,"",$catid);//删去文章
$check_pushed_db->delete(array('checkid'=>$checkid));//删去对应投稿表
showmessage(L('operation_success'),HTTP_REFERER);
}
}


声明:有的资源均来自网络转载,版权归原作者所有,如有侵犯到您的权益 请联系邮箱:123456@qq.com 我们将配合处理!

原文地址:PHPCMS V9 会员投稿可编辑删除发布于2022-05-22 07:43:38

相关推荐