動易CMS數(shù)據(jù)轉(zhuǎn)成dedecms的php程序
來源:易賢網(wǎng) 閱讀:1486 次 日期:2016-07-07 10:20:51
溫馨提示:易賢網(wǎng)小編為您整理了“動易CMS數(shù)據(jù)轉(zhuǎn)成dedecms的php程序”,方便廣大網(wǎng)友查閱!

PS:這個可以舉一反三,如新云或NB等asp文章系統(tǒng)都可轉(zhuǎn)為dedecms或其它php的cms

CODE:

代碼如下:

<?php

//讀取mdb數(shù)據(jù)庫例程

set_time_limit(0);

$conn = new com("ADODB.Connection");

$connstr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=". realpath("E:\web2\qq.mdb");

$conn->Open($connstr);

$rs = new com("ADODB.RecordSet");

$rs->Open("select * from PE_Article Where ArticleID>0 orDER BY ArticleID ASC",$conn,1,1);

$conn2 = mysql_connect("localhost","root","");

mysql_select_db("dede",$conn2);

mysql_query("SET NAMES GBK",$conn2);

$i=0;

while(! $rs->eof) {

$id = $rs->Fields('ArticleID')->value;

$title = addslashes($rs->Fields('Title')->value);

$classid = $rs->Fields('ClassID')->value;

$keywordstr = $rs->Fields('Keyword')->value;

$keywordstr = str_replace("|"," ",$keywordstr);

$keyword = trim($keywordstr);

$datestr = $rs->Fields('UpdateTime')->value;

$datearr = explode("-",$datestr);

$yy = $datearr[0] ;

$mm = $datearr[1] ;

$dd = rand(1,28);

$time=mktime(0,0,0,$mm,$dd,$yy);

$content =addslashes($rs->Fields('Content')->value);

$content = str_replace('[InstallDir_ChannelDir]{$UploadDir}','/UploadFiles',$content);

//$uploadfile = $rs->Fields('UploadFiles')->value;

$sql0 = "select ID from dede_archives where ID='$id'";

$rs0 = mysql_query($sql0,$conn2);

$row = mysql_fetch_array($rs0);

if(intval($row['ID'])==0){

$sql1 = "insert into dede_archives (ID,typeid,channel,title,sortrank,pubdate,senddate,adminID,keywords) values ('$id','$classid',1,'$title','$time','$time','$time',1,'$keyword')";

$rs1 = mysql_query($sql1,$conn2);

if(!$rs1){

echo $sql1;

echo "<br>";

echo mysql_error();

echo "<br>";

//exit;

}

$id2 = mysql_insert_id();

if($id2>0){

$sql2 = "insert into dede_addonarticle (aid ,typeid, body ) values('$id','$classid','$content');";

$rs2 = mysql_query($sql2,$conn2);

if(!$rs2){

echo $sql2;

echo "<br>";

echo mysql_error();

echo "<br>";

//exit;

}

}

}

$rs->MoveNext();

$i ;

if($iP==0)sleep(5);

}

echo "完成";

?>

更多信息請查看CMS教程
易賢網(wǎng)手機(jī)網(wǎng)站地址:動易CMS數(shù)據(jù)轉(zhuǎn)成dedecms的php程序
由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請考生以權(quán)威部門公布的正式信息和咨詢?yōu)闇?zhǔn)!
相關(guān)閱讀CMS教程

2025國考·省考課程試聽報名

  • 報班類型
  • 姓名
  • 手機(jī)號
  • 驗證碼
關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 加入群交流 | 手機(jī)站點(diǎn) | 投訴建議
工業(yè)和信息化部備案號:滇ICP備2023014141號-1 云南省教育廳備案號:云教ICP備0901021 滇公網(wǎng)安備53010202001879號 人力資源服務(wù)許可證:(云)人服證字(2023)第0102001523號
云南網(wǎng)警備案專用圖標(biāo)
聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關(guān)注公眾號:hfpxwx
咨詢QQ:526150442(9:00—18:00)版權(quán)所有:易賢網(wǎng)
云南網(wǎng)警報警專用圖標(biāo)