本站(小鱼儿博客园:扣扣>958396827)也是刚刚从dedecms5.7转换到帝国CMS的
<?php
require('../../class/connect.php'); //引入数据库配置文件和公共函数文件
require('../../class/db_sql.php'); //引入数据库操作文件
require('../../class/functions.php'); //公共方法
require("../../data/dbcache/class.php"); //栏目缓存
$link=db_connect(); //连接MYSQL
$empire=new mysqlquery(); //声明数据库操作类
$sql=$empire->query("select * from {$dbtbpre}ecms_news order by id desc limit 1000000"); //查询新闻表最新10条记录
while($r=$empire->fetch($sql)) //循环获取查询记录
{
//echo"标题:".$r['newstime']."<br>";
echo"标题:".$r['title'].$r['id']."<br>";
$tagstr = array();
$tsql=$empire->query("select * from dede_taglist where aid=".$r['id']." limit 100"); //
while($tr=$empire->fetch($tsql)) //循环获取查询记录
{
if($tr['tag'] != ''){
$tagstr[] = $tr['tag'];
}
}
if(count($tagstr) > 0){
if(eReturnInfoTags($r[classid], $r[id], 1) == ''){
echo $tags = implode(',', $tagstr);
eInsertTags($tags,$r[classid], $r[id],$r[newstime]);
$indexsql=$empire->query("update {$dbtbpre}ecms_news_data_1 set infotags='$tags' where id='$r[id]' limit 1");
}
//
}
echo '<hr>';
}
db_close(); //关闭MYSQL链接
$empire=null; //注消操作类变量
?>
如果本文对你有帮助,欢迎打赏本站