帝國cms復(fù)制欄目時(shí)同時(shí)復(fù)制子欄目建站知識(shí)
導(dǎo)讀:1建站知識(shí)帝國CMS模板網(wǎng)下面的帝國CMS教程欄目為您提供了帝國cms復(fù)制欄目時(shí)同時(shí)復(fù)制子欄目網(wǎng)站建設(shè)哪家好網(wǎng)站建設(shè)制作。
1、修改admin/addclass.php文件,大約在1153行,<input type="submit" name="Submit" value="提交"> 的前面增加:<?php if($docopy) { ?><input type="checkbox" name="copyzlm" value="1" checked>復(fù)制子欄目 <? }?> 2、修改admin/emsclass.php文件,大約在52行,將“AddClass($_POST,$logininid,$loginin);”修改為“cAddClass($_POST,$logininid,$loginin);” 3、將以下代碼拷貝到class/userfun.php中。
function cAddClass($add,$userid,$username){ global $empire,$dbtbpre; if($add[copyzlm]=='1'){ cAddClass1($add,$userid,$username); $r = $empire->fetch1( "select * from {$dbtbpre}enewsclass order by classid desc limit 1" ); $bsql=$empire->query("select * from {$dbtbpre}enewsclass where bclassid='$add[classid]' and bclassid<>'0'"); while($br=$empire->fetch($bsql)){ $br[copyzlm]='1'; $br[bclassid]=$r[classid]; $br[pripath]=$r[classpath]; $br[classpath]=strrchr($br[classpath],'/'); if($br[islast]==0){ $brr=$br; cAddClass($brr,$userid,$username);//遞歸 }else{ cAddClass1($br,$userid,$username,'1'); } } }else{ AddClass($add,$userid,$username); } } //增加欄目 function cAddClass1($add,$userid,$username,$zz=0){ global $empire,$dbtbpre; //增加外部欄目 if($add[ecmsclasstype]) { AddWbClass($add,$userid,$username); } $add[classpath]=trim($add[classpath]); if(!$add[classname]||!$add[classpath]||!$add[modid]) { printerror("EmptyClass",""); } if($add[islast]&&(!$add[newstempid]||!$add[listtempid])) { printerror("LastMustChange",""); } //操作權(quán)限 CheckLevel($userid,$username,$classid,"class"); if($zz==0){ $add=DoPostClassVar($add); } //目錄已存在 if(strchr($add[classpath],".")||strchr($add[classpath],"/")||strchr($add[classpath],"")) { // printerror("badpath",""); } $classpath=$add[pripath].$add[classpath]; if(file_exists("../../".$classpath)) { printerror("ReClasspath",""); } //取得表名 $tabler=GetModTable($add[modid]); $tabler[tid]=(int)$tabler[tid]; //增加大欄目 if(!$add[islast]) { if(empty($add[bclassid]))//主欄目 { $sonclass=""; $featherclass=""; } else//中級(jí)欄目 { //取得上一級(jí)父欄目 $r=$empire->fetch1("select featherclass,islast,wburl from {$dbtbpre}enewsclass where classid='$add[bclassid]'"); if($r[islast])//是否終極欄目 { printerror("BclassNotLast",""); } if($r[wburl]) { printerror("BclassNotWb",""); } if(empty($r[featherclass])) { $r[featherclass]="|"; } $featherclass=$r[featherclass].$add[bclassid]."|"; $sonclass=""; } //建立目錄 CreateClassPath($classpath); $sql=$empire->query("insert into {$dbtbpre}enewsclass(bclassid,classname,is_zt,sonclass,lencord,link_num,newstempid,onclick,listtempid,featherclass,islast,classpath,classtype,newspath,filename,filetype,openpl,openadd,newline,hotline,goodline,classurl,groupid,myorder,filename_qz,hotplline,modid,checked,docheckuser,checkuser,firstline,bname,islist,searchtempid,tid,tbname,maxnum,checkpl,down_num,online_num,listorderf,listorder,reorderf,reorder,intro,classimg,jstempid,addinfofen,listdt,showclass,showdt,checkqadd,qaddlist,qaddgroupid,qaddshowkey,adminqinfo,doctime,classpagekey,dtlisttempid,classtempid,nreclass,nreinfo,nrejs,nottobq,ipath,addreinfo,haddlist,sametitle,definfovoteid,wburl,qeditchecked,wapstyleid,repreinfo,pltempid,cgroupid) values($add[bclassid],'$add[classname]',0,'$sonclass',$add[lencord],$add[link_num],$add[newstempid],0,$add[listtempid],'$featherclass',$add[islast],'$classpath','$add[classtype]','$add[newspath]',$add[filename],'$add[filetype]',$add[openpl],$add[openadd],$add[newline],$add[hotline],$add[goodline],'$add[classurl]',$add[groupid],$add[myorder],'$add[filename_qz]',$add[hotplline],$add[modid],$add[checked],$add[docheckuser],'$add[checkuser]',$add[firstline],'$add[bname]',$add[islist],$add[searchtempid],$tabler[tid],'$tabler[tbname]',$add[maxnum],$add[checkpl],$add[down_num],$add[online_num],'$add[listorderf]','$add[listorder]','$add[reorderf]','$add[reorder]','$add[intro]','$add[classimg]',$add[jstempid],$add[addinfofen],$add[listdt],$add[showclass],$add[showdt],$add[checkqadd],$add[qaddlist],'$add[qaddgroupid]',$add[qaddshowkey],$add[adminqinfo],$add[doctime],'$add[classpagekey]','$add[dtlisttempid]','$add[classtempid]',$add[nreclass],$add[nreinfo],$add[nrejs],$add[nottobq],'$add[ipath]',$add[addreinfo],$add[haddlis網(wǎng)站seo優(yōu)化軟件t],$add[sametitle],$add[definfovoteid],'',$add[qeditchecked],$add[wapstyleid],'$add[repreinfo]','$add[pltempid]','$add[cgroupid]');"); $lastid=$empire->lastid(); //副表 $empire->query("replace into {$dbtbpre}enewsclassadd(classid,classtext) values('$lastid','".addslashes($add[classtext])."');"); TogNotReClass(1); GetClass(); if($add[islist]==0||$add[islist]==2) { $classtemp=$add[islist]==2?GetClassText($lastid):GetClassTemp($add['classtempid']); NewsBq($lastid,$classtemp,0,1); } DelListEnews();//刪除緩存文件 GetSearch($add[modid]);//更新緩存 if($sql){ insert_dolog("classid=".$lastid."<br>classname=".$add[classname]);//操作日志 // printerror("AddClassSuccess","AddClass.php?enews=AddClass&from=$add[from]"); } else{ printerror("DbError",""); } } //增加終級(jí)欄目 else { //文件前綴 $add[filename_qz]=RepFilenameQz($add[filename_qz]); if(empty($add[bclassid]))//主類別為終級(jí)欄目時(shí) { $sonclass=""; $featherclass=""; } else//子欄目 { //取得上一級(jí)父欄目 $r=$empire->fetch1("select featherclass,islast,wburl from {$dbtbpre}enewsclass where classid='$add[bclassid]'"); //是否終極類別 if($r[islast]) { printerror("BclassNotLast",""); } if($r[wburl]) { printerror("BclassNotWb",""); } if(empty($r[featherclass])){ $r[featherclass]="|"; } $featherclass=$r[featherclass].$add[bclassid]."|"; $sonclass=""; } //建立欄目目錄 CreateClassPath($classpath); $sql=$empire->query("insert into {$dbtbpre}enewsclass(bclassid,classname,sonclass,is_zt,lencord,link_num,newstempid,onclick,listtempid,featherclass,islast,classpath,classtype,newspath,filename,filetype,openpl,openadd,newline,hotline,goodline,classurl,groupid,myorder,filename_qz,hotplline,modid,checked,docheckuser,checkuser,firstline,bname,islist,searchtempid,tid,tbname,maxnum,checkpl,down_num,online_num,listorderf,listorder,reorderf,reorder,intro,classimg,jstempid,addinfofen,listdt,showclass,showdt,checkqadd,qaddlist,qaddgroupid,qaddshowkey,adminqinfo,doctime,classpagekey,dtlisttempid,classtempid,nreclass,nreinfo,nrejs,nottobq,ipath,addreinfo,haddlist,sametitle,definfovoteid,wburl,qeditchecked,wapstyleid,repreinfo,pltempid,cgroupid) values($add[bclassid],'$add[classname]','$sonclass',0,$add[lencord],$add[link_num],$add[newstempid],0,$add[listtempid],'$featherclass',$add[islast],'$classpath','$add[classtype]','$add[newspath]',$add[filename],'$add[filetype]',$add[openpl],$add[openadd],$add[newline],$add[hotline],$add[goodline],'$add[classurl]',$add[groupid],$add[myorder],'$add[filename_qz]',$add[hotplline],$add[modid],$add[checked],$add[docheckuser],'$add[checkuser]',$add[firstline],'$add[bname]',$add[islist],$add[searchtempid],$tabler[tid],'$tabler[tbname]',$add[maxnum],$add[checkpl],$add[down_num],$add[online_num],'$add[listorderf]','$add[listorder]','$add[reorderf]','$add[reorder]','$add[intro]','$add[classimg]',$add[jstempid],$add[addinfofen],$add[listdt],$add[showclass],$add[sh網(wǎng)站建設(shè)公司owdt],$add[checkqadd],$add[qaddlist],'$add[qaddgroupid]',$add[qaddshowkey],$add[adminqinfo],$add[doctime],'$add[classpagekey]','$add[dtlisttempid]','$add[classtempid]',$add[nreclass],$add[nreinfo],$add[nrejs],$add[nottobq],'$add[ipath]',$add[addreinfo],$add[haddlist],$add[sametitle],$add[definfovoteid],'',$add[qeditchecked],$add[wapstyleid],'$add[repreinfo]','$add[pltempid]','$add[cgroupid]');"); $lastid=$empire->lastid(); //副表 $empire->query("replace into {$dbtbpre}enewsclassadd(classid,classtext) values('$lastid','".addslashes($add[classtext])."');"); //修改父欄目的子欄目 if($add[bclassid]) { $b_r=$empire->fetch1("select企業(yè)網(wǎng)站建設(shè) sonclass,featherclass from {$dbtbpre}enewsclass where classid='$add[bclassid]'"); if(empty($b_r[sonclass])) { $b_r[sonclass]="|"; } $new_sonclass=$b_r[sonclass].$lastid."|"; $update=$empire->query("update {$dbtbpre}enewsclass set sonclass='$new_sonclass' where classid='$add[bclassid]'"); //更改父類別的父欄目的子欄目 $where=ReturnClass($b_r[featherclass]); if(empty($where)){ $where="classid=0"; } $bsql=$empire->query("select sonclass,classid from {$dbtbpre}enewsclass where ".$where); while($br=$empire->fetch($bsql)) { if(empty($br[sonclass])) { $br[sonclass]="|"; } $new_sonclass=$br[sonclass].$lastid."|"; $update=$empire->query("update {$dbtbpre}enewsclass set sonclass='$new_sonclass' where classid='$br[classid]'"); } } DelListEnews();//刪除緩存文件 TogNotReClass(1); GetClass(); GetSearch($add[modid]);//更新緩存 if($sql){ insert_dolog("classid=".$lastid."<br>classname=".$add[classname]);//操作日志 // printerror("AddLastClassSuccess","AddClass.php?enews=AddClass&from=$add[from]"); } else{ printerror("DbError","history.go(-1)"); } } }
聲明: 本文由我的SEOUC技術(shù)文章主頁發(fā)布于:2023-05-22 ,文章帝國cms復(fù)制欄目時(shí)同時(shí)復(fù)制子欄目建站知識(shí)主要講述欄目,帝國,帝國cms復(fù)制欄目時(shí)同時(shí)復(fù)制子欄目建站網(wǎng)站建設(shè)源碼以及服務(wù)器配置搭建相關(guān)技術(shù)文章。轉(zhuǎn)載請(qǐng)保留鏈接: http://www.bifwcx.com/article/web_4538.html
為你推薦與帝國cms復(fù)制欄目時(shí)同時(shí)復(fù)制子欄目建站知識(shí)相關(guān)的文章
-
通王TWCMS 2.0.3網(wǎng)站模板程序下載
(126)人喜歡 2024-01-15 -
Windows官方原版在哪里下載
(175)人喜歡 2024-01-15 -
WordPress網(wǎng)站模板發(fā)帖標(biāo)題顏色設(shè)置
(131)人喜歡 2024-01-07 -
修改discuz論壇帖子標(biāo)題80字符的長(zhǎng)度限制
(249)人喜歡 2024-01-07 -
wordpress程序調(diào)用不帶超鏈接的Tag標(biāo)簽
(234)人喜歡 2024-01-05 -
網(wǎng)站在不同時(shí)期需調(diào)整內(nèi)容更新的方向
(112)人喜歡 2023-08-12