<var id="xvh3p"><noframes id="xvh3p"><var id="xvh3p"></var><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing>
<var id="xvh3p"><strike id="xvh3p"><var id="xvh3p"></var></strike></var><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<span id="xvh3p"><noframes id="xvh3p"><dl id="xvh3p"></dl>
<span id="xvh3p"><noframes id="xvh3p">
<dl id="xvh3p"><noframes id="xvh3p">
<listing id="xvh3p"><noframes id="xvh3p"><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<th id="xvh3p"><strike id="xvh3p"></strike></th>
<dl id="xvh3p"><noframes id="xvh3p">
<th id="xvh3p"><noframes id="xvh3p">

观点

互联网+时代,说建站,谈运营与网络营销

DEDECMS统计栏目文章(软件)总数

时间:2020-12-15

偶然在某网站上看到栏目分类 旁边显示着软件总数,看了一下网站程序还是用DEDECMS的。所以就想办法去实现了这一功能;因为是在各页面都能调用到总数,所以不是用loop调用就是用sql调用,具体方法:

调用会员总数:

 

{dede:sql sql="select count(mid) as c from dede_member "}共有会员:[field:c /] 名{/dede:sql}

 

示例 共有会员:31 名

调用本月更新总数:

 

{dede:sql sql="SELECT count( ID ) AS c FROM dede_archives WHERE FROM_UNIXTIME( pubdate, '%m' ) = month(curdate( )) "} 本月更新:[field:c /] 篇{/dede:sql}

 

示例 本月更新:39 篇

调用文章总数:

 

{dede:sql sql="select count(*) as c from dede_archives where channel=1"}共有文章:[field:c /] 篇{/dede:sql}

 

示例: 共有文章:244 篇

调用栏目下的文章总数:

 

{dede:sql sql='SELECT d.typename,d.id,count(da.id) as heji FROM dede_arctype d left join dede_archives da on da.typeid=d.id where d.reid=0 and da.arcrank>=0 group by d.typename order by heji desc limit 0,8;'} <span><a href="/plus/list.php?tid=[field:id/]">[field:typename/]更新文章</a><span>([field:heji/]篇)</span></span><br /> {/dede:sql}

 

示例:栏目名称更新文章(247篇)

以此类推,调用其他(比如软件总数,评论总数)也是同样的原理,搞清楚了dedecms在mysql所建立的表,再认真研究以上代码,所有问题都不在是难事了!

0
首页
案例
关于
联系