第一種:根據(jù)所在欄目ID自動判斷顯示所在欄目的文章數(shù)
(<span>[field:ID runphp='yes'] @me = GetTotalArc(@me);[/field:ID]</span>)
第二種:指定欄目ID
第三種:DedeCMS欄目文章數(shù)量統(tǒng)計調(diào)用,欄目名稱按照文章數(shù)量排列
第四種:
修改include/common.func.php 在最后加入代碼: //*****統(tǒng)計欄目文章數(shù)在htm 最下方添加:
function dynamic_num($current_id){
global $dsql;
$t_num = $dsql->GetOne("select count(*) as num from `dede_archives` where typeid='$current_id'");
if(is_array($t_num)){
return "本欄目共有".$t_num[num]."篇文章";
}else{
return "本欄目共有0篇文章" ;
}
}
在列表頁中這樣調(diào)用:
{dede:type}[field:id function="dynamic_num(@me)" /]{/dede:type}
{dede:sql sql="SELECT count( * ) AS c FROM cmsxx_archives
WHERE pubdate > UNIX_TIMESTAMP( CURDATE( ) ) "}
<li class="count">今日更新:<span>[field:c/]</span> 篇</li>
{/dede:sql}
{dede:sql sql="Select count(ID) as c From cmsxx_archives
WHERE FROM_UNIXTIME(pubdate,'%m')=month(curdate())"}
<li class="count">當月更新:<span>[field:c/]</span> 篇</li>
{/dede:sql}
{dede:sql sql="select count(*) as c from cmsxx_archives}
<li class="count">共有文章:<span>[field:c/]</span> 篇</li>
{/dede:sql}
{dede:sql sql="select sum(click) as c from cmsxx_archives"}
<li class="count">總共閱讀:<span>[field:c/]</span> 人次</li>
{/dede:sql}
{dede:sql sql="select count(mid) as c from cmsxx_member "}
<li class="count">共有會員:<span>[field:c/]</span> 名</li>
{/dede:sql}
還可以指定欄目ID,例如:
{dede:sql sql="select count(*) as c from cmsxx_archives where channel in(1,2,3,5,6,9)"}
<li class="count">共有文章:<span>[field:c/]</span> 篇</li>
{/dede:sql}
版權(quán)聲明: 本站資源均來自互聯(lián)網(wǎng)或會員發(fā)布,如果侵犯了您的權(quán)益請與我們聯(lián)系,我們將在24小時內(nèi)刪除!謝謝!
轉(zhuǎn)載請注明: 織夢dedecms怎么調(diào)用欄目文章數(shù) 統(tǒng)計對應(yīng)欄目的文章數(shù)