pbootcms模板tag标签文章显示数量

2025-08-04 0 9
PbootCMS增加同tag标签文章数量显示
pbootcms模板tag标签文章显示数量
教程步骤
打开修改文件:/apps/home/controller/ParserController.php
1、找到这段代码(有两处),在下方添加新代码
$tags = implode(‘,’, $rs); // 把栏目tags串起来
添加后
$tags = implode(‘,’, $rs); // 把栏目tags串起来
$tagsArrSum = array_count_values(explode(‘,’, $tags)); // @mk-tags_one_sum 把所有tags组成数组并计算每个值得数量
pbootcms模板tag标签文章显示数量
2、找到这段代码在下方位置,添加新的判断,具体位置看截图
case ‘text’:
    $one_html = str_replace($matches2[0][$j], $this->adjustLabelData($params, $value[‘tags’]), $one_html);
    break;
添加后
case ‘text’:
    $one_html = str_replace($matches2[0][$j], $this->adjustLabelData($params, $value[‘tags’]), $one_html);
    break;
case ‘sum’:
    $sum = $tagsArrSum[$value[‘tags’]]; // @mk-tags_one_sum
    $one_html = str_replace($matches2[0][$j], $sum, $one_html);
    break;
pbootcms模板tag标签文章显示数量
3、上面修改后,前台就读了个sum标签,具体使用如下
{pboot:tags scode=6 target=tag}
  <li><a href=”[tags:link]”><p title=”[tags:text]”>[tags:text]</p><font><span>([tags:sum])</span></font></a></li>
{/pboot:tags}
收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

版权声明:所有的源码、软件和资料,不得使用于非法商业用途,不得违反国家法律,一切关于该资源商业行为与本站无关。

免费cms模板 pbootcms教程 pbootcms模板tag标签文章显示数量 https://www.mianfeicms.com/1462.html

相关文章

发表评论
暂无评论