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

1、统计当前专题内的文章数量
gettotal(“select count(*) as total from {$dbtbpre}enewsztinfo where ztid=’$GLOBALS[navclassid]'”)?>

2、统计专题文章数量
①sql代码

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}]
  • “>
     (gettotal(“select count(*) as total from {$dbtbpre}enewsztinfo where ztid=’$bqr[ztid]'”);
    echo $num;?>)

[/e:loop]

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注