<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">

观点

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

织梦tag显示每个tag相应的文章数量

时间:2020-12-15

有些时候我们想实现类似于wordpress那样的tag,就是在显示tag的链接和tag名的同时,还能显示每个tag关联的文章的数量。如下图所示:

 

这就需要修改/include/taglib/tag.lib.php这个文件,找到第87行左右的“$row['link'] = $cfg_cmsurl."/tags.php?/".urlencode($row['keyword'])."/";‘

在这行的下面添加如下代码:

 

1 $count $dsql->GetOne("Select count(tid) From `dede_taglist` where tag = '".$row['tag']."'");
2 $row['count'] = $count['count(tid)'];

 

添加好后就可以通过[field:count/]来获取当前tag标签关联的文章数量了,例如:

 

1 {dede:tag sort='hot' getall='2'
2   <li><a title="[field:count/]个话题" href="[field:link/]">[field:tag /]</a></li>
3   {/dede:tag}
    0
    首页
    案例
    关于
    联系