在需要顯示的頁面模板里面添加以下代碼
<?php
$bclassid=$GLOBALS[navclassid]; //取得本欄目id
//取得本欄目下的子欄目
?>
[e:loop={'select classid,classname,maxnum,classpath from [!db.pre!]enewsclass where bclassid=206 order by myorder',0,24,0}]
<?
$total=$empire->gettotal("select count(*) as total from phome_ecms_hudong where classid=$bqr[classid]");
$total3=$empire->gettotal("select count(*) as total from phome_ecms_hudong where classid=$bqr[classid] and hf<>''");
if($total==0)
{
$out=0;
}
else
{
$out=$total3/$total;
}
$ss=$out*100;
$zz=$ss;
?>
<?=$bqr[classname]?>
<?=$bqr[maxnum]?>
<br /><?=$total?>
<br /><?=$total3?>
<br /><?=$zz?>%
[/e:loop]