详情页

帝国cms后台列表页批量修改信息标题

时间:2024年03月29日

编辑:佚名

修改/e/data/html/list/alllistinfo.php文件
第一步、查找 $ignamer=$ftnr['igr'];  在其下面插入如下代码
function dp_editmoreinfotitle($add,$userid,$username){
        global $empire,$dbtbpre,$class_r;  
        $classid=(int)$add['classid'];  
        $infoid=$add['infoid'];  
        $n1=$add['title'];  
        $count=count($infoid);  
        $tbname=$class_r[$classid]['tbname'];  
        if(!$classid||!$tbname||!$count)  
        {  
                printerror("请选择需要修改的信息",'history.go(-1)',1,0,1);  
        }  
        //操作权限  
        $doselfinfo=CheckLevel($userid,$username,$classid,"news");  
        if(!$doselfinfo['doeditinfo'])//编辑权限  
        {  
                printerror("没有足够的权限",'history.go(-1)',1,0,1);  
        }  
        $dopubid=0;  
        $donum=0;  
        $dolog='';  
        //主表  
        $infotb='';  
        for($i=0;$i<$count;$i++)  
        {  
                $doinfoid=(int)$infoid[$i];  
                if(empty($infotb))  
                {  
                        //索引表  
                        $index_r=$empire->fetch1("select classid,checked from {$dbtbpre}ecms_".$tbname."_index where id='$doinfoid' limit 1");  
                        if(!$index_r['classid'])  
                        {  
                                continue;  
                        }  
                        //返回表  
                        $infotb=ReturnInfoMainTbname($tbname,$index_r['checked']);  
                }  
                $do1=$n1[$i];  
                $empire->query("update ".$infotb." set title='$do1' where id='$doinfoid'");  
        }  
        printerror("修改成功",$_SERVER['HTTP_REFERER'],1,0,1);  
}  
$enews=$_POST['enews'];  
if($enews=="EditMoreInfoTitle"){  
        hCheckEcmsRHash();  
        dp_editmoreinfotitle($_POST,$logininid,$loginin);  
}    
第二步、查找 <?=$r[title]?>  找到后进行如下的操作
 将<?=$r[title]?> 和相邻上下两行的 <a >和</a>标签删除(一共删除3行),换成代码:
<input type="text" name="title[]" value="<?=$oldtitle?>" style="width:99%">  
第三步 查找 <span id="moveclassnav"></span>
 在其上插入一行,输入代码:
<input type="submit" name="Submit7" value="批量修改标题" onclick="document.listform.enews.value='EditMoreInfoTitle';document.listform.action='ListAllInfo.php';">
相关文章
猜你需要