织梦cms批量取消审核文档的实现方法_DedeCms教程
教程Tag:暂无Tag,欢迎添加,赚取U币!
织梦cms批量取消审核文档的实现方法
教你来实现在原来dede文章批量管理的地方 添加一个 “取消审核” :
教你来实现在原来dede文章批量管理的地方 添加一个 “取消审核” :
实现方法:
- <span style="font-family:tahoma,geneva,sans-serif;"><span style="font-size:14px;">01 /*--------------------------
- //取消审核文档
- function checkArchives1() { }
- ---------------------------*/
- else if($dopost=="checkArchives1")
- {
- CheckPurview('a_Check,a_AccCheck,sys_ArcBatch');
- require_once(DEDEADMIN."/inc/inc_archives_functions.php");
- if( !empty($aid) && empty($qstr) )
- {
- $qstr = $aid;
- }
- if($qstr=='')
- {
- ShowMsg("参数无效!",$ENV_GOBACK_URL);
- exit();
- }
- $arcids = ereg_replace('[^0-9,]','',ereg_replace('`',',',$qstr));
- $query = "Select arc.id,arc.typeid,ch.issystem,ch.maintable,ch.addtable From `dede_arctiny` arc
- left join `dede_arctype` tp on tp.id=arc.typeid
- left join `dede_channeltype` ch on ch.id=tp.channeltype
- where arc.id in($arcids) ";
- $dsql->SetQuery($query);
- $dsql->Execute('ckall');
- while($row = $dsql->GetArray('ckall'))
- {
- $aid = $row['id'];
- //print_r($row);
- $maintable = ( trim($row['maintable'])=='' ? 'dede_archives' : trim($row['maintable']) );
- $dsql->ExecuteNoneQuery("Update `dede_arctiny` set arcrank='-1' where id='$aid' ");
- if($row['issystem']==-1)
- {
- $dsql->ExecuteNoneQuery("Update `".trim($row['addtable'])."` set arcrank='-1' where aid='$aid' ");
- }
- else
- {
- $dsql->ExecuteNoneQuery("Update `$maintable` set arcrank='-1' where id='$aid' ");
- }
- $pageurl = MakeArt($aid,false);
- }
- ShowMsg("成功审核指定的文档!",$ENV_GOBACK_URL);
- exit();
- }
- </span></span>
然后再修改管理目录(默认为Dede)的模板目录(templets)的文件:content_list.htm。
找到:
在下面添加代码:
- <span style="font-family:tahoma,geneva,sans-serif;"><span style="font-size:14px;">1 function checkArc(aid){
- var qstr=getCheckboxItem();
- if(aid==0) aid = getOneItem();
- location="archives_do.php?aid="+aid+"&dopost=checkArchives&qstr="+qstr;
- }
找到“审核”按钮的代码,在下面加取消审核,以下代码是审核与取消审核一起的:
- function checkArc1(aid){
- var qstr=getCheckboxItem();
- if(aid==0) aid = getOneItem();
- location="archives_do.php?aid="+aid+"&dopost=checkArchives1&qstr="+qstr;
- }
- pan></span>
以上内容仅供大家学习参考,希望对你有帮助。
- <span style="font-family:tahoma,geneva,sans-serif;"><span style="font-size:14px;">1 <a href="javascript:checkArc(0)" class="coolbg"> 审核 </a>
- <a href="javascript:checkArc1(0)" class="coolbg"> 取消审核 </a>
- </span></span>
相关DedeCms教程: