动易dedecms数据转成dedecms的php程序

动易dedecms数据转成dedecms的php程序,第1张

动易dedecms数据转成dedecms的php程序 PS:这个可以举一反三,如新云或NB等asp文章系统都可转为织梦dedecms或其它php的cms  [复制此代码]CODE: 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 "
";  echo mysql_error();  echo "
";  //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 "
";  echo mysql_error();  echo "
";  //exit;  }  }  }  $rs->MoveNext();  $i ;  if($iP==0)sleep(5);  }  echo "完成";  ?>
动易dedecms数据转成织梦dedecms的php程序就介绍完了。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/3008216.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-09-27
下一篇 2022-09-27

发表评论

登录后才能评论

评论列表(0条)

保存