帝国CMS批量提取正文内容到smalltext简介(php smalltext)

时间:2023年10月12日

/

来源:网络

/

编辑:佚名

帝国CMS批量提取正文内容到smalltext简介(php smalltext)代码:
使用方法:
1、先备份数据库
2、以下代码保存到:/e/admin/ChangeSmallText.php
注意:$tbname="news";修改为要提取的模型;($r['newstext'],200);修改为要提取smalltext的长度
3、浏览器访问:/e/admin/ChangeSmallText.php
/e/admin/changesmalltext.php?startid=2516 修改为要提取smalltext的开始ID
<?php
define('EmpireCMSAdmin','1');
require("../class/connect.php");
require("../class/db_sql.php");
require("../class/functions.php");
require LoadLang("pub/fun.php");
require("../class/t_functions.php");
require("../data/dbcache/class.php");
require("../data/dbcache/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=changesmalltext.php?startid=".$b."">";
echo "已转换ID".$b;
db_close();
$empire=null;
?>
猜你需要

豫ICP备2021026617号-1  豫公网安备:41172602000185   Copyright © 2021-2028 www.78moban.com/ All Rights Reserved

本站作品均来自互联网,转载目的在于传递更多信息,并不代表本站赞同其观点和对其真实性负责。如有侵犯您的版权,请联系 1565229909#qq.com(把#改成@),我们将立即处理。