详情页

帝国CMS模板当前专题或者指定专题信息数量统计的几种方法

时间:2023年05月22日

编辑:佚名

1、统计当前专题内的文章数量
<?=$empire->gettotal(“select count(*) as total from {$dbtbpre}enewsztinfo where ztid=’$GLOBALS[navclassid]'”)?>
2、统计专题文章数量
①sql代码
<?
$num=$empire->gettotal(“select count(*) as total from {$dbtbpre}enewsztinfo where ztid=专题id”);
echo $num;
?>
注释:(ztid=专题id 可以修改为  ztid=ztid)
②灵动标签+php
[e:loop={“select ztpath,ztname,ztid from [!db.pre!]enewszt where zcid=0”,36,24,0}]
<li>
<a href=“<?=$bqr[ztpath]?>”><?=$bqr[ztname]?></a>
&nbsp;(<? $num=$empire->gettotal(“select count(*) as total from {$dbtbpre}enewsztinfo where ztid=’$bqr[ztid]'”);
echo $num;?>)
</li>
[/e:loop]
相关文章
猜你需要