dedecms,我想统计栏目下文章数量,应该怎么实现呢?
1个回答
2016-06-10
展开全部
调用方式:
<script src="{dede:global.cfg_cmsurl/}/plus/mycount.php?tid={栏目id}" type='text/javascript' language="javascript"></script>
在plus目录下新建mycount.php:
require_once(dirname(__FILE__)."/../include/common.inc.php");
$sql = "select count(*) as num from `dede_arctiny` where typeid=$tid";
$row = $dsql->GetOne($sql);
if(is_array($row)){
echo "document.write('".$row['num']."')";
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询