dedecms发布分页问题完全解决方案(3)_DedeCms教程

编辑Tag赚U币
教程Tag:暂无Tag,欢迎添加,赚取U币!
");
$body = addslashes($body);
$dsql->ExecuteNoneQuery("Update $table set $field='$body' where aid='$aid' ; ");
}
}
}//end if limit


替换为:

/----------------------------
//更新自动分页
//----------------------------

if($dojob=='page'){
require_once(dirname(__FILE__)."/inc/inc_archives_functions.php");
//统计记录总数
if($totalnum==0){
$addquery = " where aID>0 ";
if($sid!=0) $addquery .= " And aID>='$sid' ";
if($eid!=0) $addquery .= " And aID<='$eid' ";
$row = $dsql->GetOne("Select count(*) as dd From $table $addquery");
$totalnum = $row['dd'];
}
//获取记录,并分析
if($totalnum > $startdd+$pagesize) $limitSql = " limit $startdd,$pagesize";
else if(($totalnum-$startdd)>0) $limitSql = " limit $startdd,".($totalnum - $startdd);
else $limitSql = "";
$tjnum = $startdd;
if($limitSql!=""){
$addquery = " where aID>0 ";
if($sid!=0) $addquery .= " And aID>='$sid' ";
if($eid!=0) $addquery .= " And aID<='$eid' ";
$fquery = "Select aid,$field From $table $addquery $limitSql ;";
$dsql->SetQuery($fquery);
$dsql->Execute();
while($row=$dsql->GetArray())
{
$tjnum++;
$body = $row[$field];
$aid = $row['aid'];
if(strlen($body) < $msize) continue;
if(!preg_match("/

查看更多 DedeCms教程  织梦模板  织梦DedeCms视频教程  织梦dedecms专题

来源:DEDECMS论坛//所属分类:DedeCms教程/更新时间:2008-03-07
相关DedeCms教程