小编教你实现了在原来dede文章批量管理的地方 添加一个 “取消审核” :
实现方法:
修改管理目录(默认为dede)下的文件:archives_do.php 插入以下代码(位置随意 可以放审核文档下面 方便记忆):
01 /*--------------------------
02 //取消审核文档
03 funB 5 ^ Cction checkArchives1() { }
04 ---------------------------*/
05 else if($dopost=="checkArchives1")
06 {H ; ! O h
07 CD 0 ! d kheckPurview('a_Check,a_AccCheck,sys_ArcBatch');
08| e O i , t W require_once(DEDEADMIN."/inc/inc_archives_functions.php");
09 if( !empty($aid) && empty($qstr) )
10 {
11 $qstr = $aid;
12 }
13 if($qstr=='')9 7 y B L =
14 {
15 ShowM- & Y Asg("参数无效!",$ENV_GOBACK_URL);
16 exit();
17 }
18 $arc; a Q 0 a _ T $ids = ereg{ M $ j a o D C_replace('[^0-9,]','',ereg_replace('`',',',$qstr));
19 $query = "Select arc.id,arc.typeid,ch.issystem,ch.maintable,ch.addtable From `dede_arctiny` a8 v c 9 3rc
20 left join `dede_arctype` tp on tp.id=arc.typeid
21 left join `dede_channeltype` ch on ch.id=tp.channeltype
22 where arc.id in($arcd % w G p } # - Fids) ";
23 $dsql->SetQuery($query);
24 $dsql->Execute('ckall');
25 while($row = $dsql->GetArray('ckall'))
26b } } {
27 $ai\ } * 9 ,d = $row['id'];
28 //print_r($ro. K | y n S T O Pw);
29 $maintable = ( trim($row['maintable'])=='' ? 'dede_f L | G y ^ @ _ %archG { E y b \ lives' : trim($row['maintable']) );
30 $d9 Z \sql->ExecuteNoneQuery("Update `dede_arctiny` set arcrank='-1' where id='$aid' ");
31 if($row['issystem']==-1)
32 {
33 $dsql-* N d \ D @>ExecuteNoneQuery("Update `".trim($row['addtable'])S d b | e."` set arcrank='-1' where aid='$aid' ");
34 }
35 else
36 {
37 $dsql->ExecuteNoneQuery("Updatep L A 7 X B `$maiC 2 $ntable` set arcrank='-1' where id='$g h U ( jaid' "8 Y @ 7);
38 }
39 $pageurl = MakeArt($aid,false);
40 }
41 ShowMsg("成功审核指定的g _ ] O文档!",$ENV3 V w G e ]_GOBACK_URL);
42 exu O [ w 0 d { 7 Rit();
43 }
然后再修改管理目录(默认为Dede)的模板目录(templets)的文件:conT 9 S @ 0 Ftent_list.W N ? + 5 , Fhtm。
找到:
1 function checkAr= } 3 & D C 6 Wc(aid){
2 var qstrK r }=getCheckboxItem();
3 if(aid==0) a~ ! # Tid = getOneItem();
4 location="archives_do.php?aid="+aid+"&dopost=checkArchives&qstr="+qstr;
5 }
在下面添加代码:
1 function checkArc1(aid){
2 var qstr=getCheckboxItex O J 5 _ / !m();
3 if(aid==0) aid = getOneItem();
4 location="archives_do.phpL r 5 v m t V?aid="+aid+"&d+ k Bopost=checkArchives1&qstr="+qstr;
5 }
找? x : = # ? s : v到“审核”按钮c o D的代码,在下面加取消审核,以下代码是审核与取消审核一* q p P ! Y y l S起的:
1 <a hW I K * j u Iref=, t i s z D G * |"jU h Y Oavascript:checkArc(0)" class="coolv . , rbg"> 审核 <1 0 t/a>
2 <a href="~ v Yjave 3 T D oascript:checkArc1(0)" class="coolbg"&d ) ^ S \ A $gt; 取消审核 </a>