Copyright @ 2015-2024 织梦园 版权所有 Power by DedeCms
鲁ICP备15039853号-2

模板标签 TAG标签 网站地图 XML地图 今日更新 返回顶部
很多站长都想要网站有栏目文章统计功能,特意为大家搜集整理了两种方法来实现这个功能,方法如下:
***种方法:
1、修改include/inc_arcpart_view.php文件
找到function ParseTemplet()函数
修改为:
function ParseTemplet()
{
if(!is_array($this->dtp->CTags)) return "";
foreach($this->dtp->CTags as $tagid=>$ctag)
{
$tagname = $ctag->GetName();
//countclass www.genban.org统计栏目文章数量
if( $tagname == "countclass" ){
$tid = $ctag->GetAtt("typeid");
$row = $this->dsql->GetOne("Select count(ID) as dd From dede_archives where typeid='$tid' and arcrank<>-1");
$this->dtp->Assign($tagid,$row['dd']);
}
2、网页调用方法
{dede:countclass typeid=栏目ID/}
例如:
{dede:countclass typeid='2′/}
第二种方法:
1、修改include/inc_functions.php文件,增加函数如下:
function GetTotalArc($tid)
{
global $dsql;
$sql = GetSonIds($tid);
$row = $dsql->GetOne("Select count(id) as dd From dede_archives where typeid in({$sql})");
return $row['dd']; }
2、调用方法
[field:ID runphp='yes'] @me = GetTotalArc(@me);[/field:ID]