帝国CMS批量提取正文内容到简介方法
1、先备份数据库
2、保存e/admin/ChangeByID.php,代码如下:
<?phpdefine('EmpireCMSAdmin','1');require("../class/connect.php");require("../class_sql.php");require("../class/functions.php");require LoadLang("pub/fun.php");require("../class/t_functions.php");require("../datacache/class.php");require("../datacache/MemberLevel.php");$link=db_connect();$empire=new mysqlquery();$tbname="news";$sid=(int)$_GET['startid'];$b=0;$rs=$empire->query("SELECT id,newstext FROM {$dbtbpre}ecms_{$tbname}_data_1 WHERE id>{$sid} limit 20"); while($r=$empire->fetch($rs)) { $smalltext=''; !$r['newstext'] or $smalltext=SubSmalltextVal($r['newstext'],200); $smalltext=addslashes($smalltext); $smalltext && $empire->query("UPDATE {$dbtbpre}ecms_{$tbname} SET smalltext='{$smalltext}' WHERE id=".$r[id]); $b=$r['id']; }$b or exit('转换结束!');echo "<meta http-equiv="refresh" content="1;url=ChangeByID.php?startid=".$b."">";echo "已转换ID".$b;db_close();$empire=null;?>
3、浏览器访问ChangeByID.php即可看到效果!
以上就是帝国CMS如何批量取正文内容到简介的全部内容,希望对大家的学习和解决疑问有所帮助,也希望大家多多支持武林网。新闻热点
疑难解答