dede织梦转帝国CMS代码记录

梅花真洁白啊!像冬天里的雪花;梅花真美丽啊!像翩翩起舞的天鹅;梅花真坚强啊!像个英勇的战士。梅花坚强不屈的精神一直激励着我前进。
1.转换栏目
 
 
insert into ak_enewsclass (classid,bclassid,classname,myorder,classpath,intro,classpagekey) select id,reid,typename,sortrank,typedir,description,keywords  from dede_arctype;
 
update phome_enewsclass set tbname='news', modid='1';
 
 
update ak_enewsclass set islist=1,listtempid=1,dtlisttempid=1,newstempid=1,classtype='.html',filetype='.html';
  
 
2.更新栏目featerclass字段
 
 
<?php
require ('e/class/connect.php'); //引入数据库配置文件和公共函数文件
require ('e/class/db_sql.php'); //引入数据库操作文件
$link = db_connect(); //连接MYSQL
$empire = new mysqlquery(); //声明数据库操作类
 
 
$sql = $empire ->query("select classid,bclassid from {$dbtbpre}enewsclass");
while($r = $empire ->fetch($sql))
{
    $featherclass = '';
    if($r['bclassid']){
        $featherclass .= '|' .$r['bclassid'];
        $sql1 = $empire ->query("select classid,bclassid from {$dbtbpre}enewsclass where classid = $r[bclassid]");
        if($r1 = $empire ->fetch($sql1)){
            if($r1['bclassid']){
                $featherclass = '|' .$r1['bclassid'] .$featherclass;
                $sql2 = $empire ->query("select classid,bclassid from {$dbtbpre}enewsclass where classid = $r1[bclassid]");
 
                if($r2 = $empire ->fetch($sql2)){
                    if($r2['bclassid']){
                        $featherclass = '|' .$r2['bclassid'] .$featherclass;
                        $sql3 = $empire ->query("select classid,bclassid from {$dbtbpre}enewsclass where classid = $r2[bclassid]");
                        if($r3 = $empire ->fetch($sql3)){
                            if($r3['bclassid']){
                                $featherclass = '|' .$r3['bclassid'] .$featherclass;
                                $sql4 = $empire ->query("select classid,bclassid from {$dbtbpre}enewsclass where classid = $r3[bclassid]");
                                if($r4 = $empire ->fetch($sql4)){
                                    if($r4['bclassid']){
                                        $featherclass = '|' .$r4['bclassid'] .$featherclass;
                                        $sql5 = $empire ->query("select classid,bclassid from {$dbtbpre}enewsclass where classid = $r4[bclassid]");
                                        if($r5 = $empire ->fetch($sql5)){
                                            if($r5['bclassid']){
                                                $featherclass = '|' .$r5['bclassid'] .$featherclass;
                                                $sql6 = $empire ->query("select classid,bclassid from {$dbtbpre}enewsclass where classid = $r5[bclassid]");
                                                if($r6 = $empire ->fetch($sql6)){
                                                    if($r6['bclassid']){
                                                        $featherclass = '|' .$r6['bclassid'] .$featherclass;
                                                    }
 
                                                }
                                            }
 
                                        }
                                    }
 
                                }
                            }
 
                        }
                    }
                }
            }
        }
        $featherclass .= '|';
        if($empire ->query("update {$dbtbpre}enewsclass set featherclass = '$featherclass'  where classid = $r[classid]")){
            echo $r['classid'] .'更新成功<br>';
        }else
            echo $r['classid'] .'更新失败~~~~~~~~~<br>';
    }
}
 
db_close(); //关闭MYSQL链接
$empire = null; //注消操作类变量
?>
 
 
3.更新栏目sonclass字段
 
 
<?php
require('e/class/connect.php');        //引入数据库配置文件和公共函数文件
require('e/class/db_sql.php');        //引入数据库操作文件
$link=db_connect();                //连接MYSQL
$empire=new mysqlquery();        //声明数据库操作类
 
$sql=$empire->query("select classid,islast from {$dbtbpre}enewsclass");      
while($r=$empire->fetch($sql))      
{
        //echo"栏目ID:".$r['classid'];
        if(!$r['islast']){
            $sql1=$empire->query("select classid,islast from {$dbtbpre}enewsclass where bclassid = $r[classid]");
            $sonclass = '';
            while($r1=$empire->fetch($sql1)){
                if($r1['islast']) $sonclass = $sonclass.$r1['classid'].'|';
                else{
                    $sql2=$empire->query("select classid,islast from {$dbtbpre}enewsclass where bclassid = $r1[classid]");
                    while($r2=$empire->fetch($sql2)){
                        if($r2['islast']) $sonclass =$sonclass.$r2['classid'].'|';
                        else{
                            $sql3=$empire->query("select classid,islast from {$dbtbpre}enewsclass where bclassid = $r2[classid]");
                            while($r3=$empire->fetch($sql3)){
                                if($r3['islast']) $sonclass =$sonclass.$r3['classid'].'|';
                                else{
                                    $sql4=$empire->query("select classid,islast from {$dbtbpre}enewsclass where bclassid = $r3[classid]");
                                    while($r4=$empire->fetch($sql4)){
                                        if($r4['islast']) $sonclass =$sonclass.$r4['classid'].'|';
                                    }
                                }
                            }
                        }
                    }
                }
            }
            //echo "<br>".'子类栏目'.'|'.$sonclass."<br>";
            if($sonclass){
                $sonclass = '|'.$sonclass;
            }else{
             
            }
             
            if($empire->query("update {$dbtbpre}enewsclass set sonclass = '$sonclass'  where classid = $r[classid]")){
                echo $r['classid'].'更新成功<br>';
            }
            else echo $r['classid'].'更新失败~~~~~~~~~<br>';
 
        }
        else{
             
            //echo '    --终极栏目'."<br>";
        }
}
 
db_close();                        //关闭MYSQL链接
$empire=null;                        //注消操作类变量
?>
 
 
4.更新栏目lastclas字段(dede每个栏目都可添加文章,帝国只有终极栏目才可添加文章)(默认把原dede的最后一级转为终极栏目)
 
 
<?php
require('e/class/connect.php');        //引入数据库配置文件和公共函数文件
require('e/class/db_sql.php');        //引入数据库操作文件
$link=db_connect();                //连接MYSQL
$empire=new mysqlquery();        //声明数据库操作类
 
    $sql=$empire->query("select classid,bclassid from {$dbtbpre}enewsclass");       
    $end = array();
    while($r=$empire->fetch($sql))       
    {
         $sql1=$empire->query("select classid from {$dbtbpre}enewsclass where bclassid = $r[classid]");
         if(!$empire->fetch($sql1)){
            if($empire->query("update {$dbtbpre}enewsclass set islast=1 where classid = $r[classid]"))
                   {
                      echo $r['classid'].'更新成功<br>';
                        }else echo $r['classid'].'--------------更新失败<br>';
         }    
    }
  
db_close();                        //关闭MYSQL链接
$empire=null;                        //注消操作类变量
?>
 
5.转换文章
 
 
insert  into  ak_ecms_news  (id,classid,truetime,onclick,title,titlepic,filename,newstime,lastdotime,smalltext,keyboard)  select  id,typeid,sortrank,click,title,litpic,filename,pubdate,senddate,description,keywords  from dede_archives;
 
 
insert into ak_ecms_news_data_1 (id,classid,newstext,newstempid) select aid,typeid,body,1 from dede_addonarticle;
 
insert  into  ak_ecms_news_index  (id,classid,checked,truetime,newstime,lastdotime)  select  id,typeid,1,sortrank,pubdate,senddate from dede_archives;
  
 
6.栏目全部动态
 
 
update ak_enewsclass set showdt=2 ,listdt=1,nreclass=1,nreinfo=1;

7.帝国后台更新

以上就是dede织梦转帝国CMS代码记录。人生的路,需要一步一步往前走,需要坚持不懈的努力与付出,世上本无过去不的阴影,只有过不去的心情,人生在这个世界上,必须要饱受风霜与挫折,最后才可以创造出天堂的力量,如果有谁告诉你,他用一天的时间获取了成功,那么,请你不要相信,世上本无捷径,成功从来不是偶然的。更多关于dede织梦转帝国CMS代码记录请关注haodaima.com其它相关文章!

标签: dede 织梦转