请问PbootCMS增加同tag标签文章数量显示(1)
-
- 打开文件
/APPs/home/controller/ParserController.php
。 - 找到并修改以下代码:
$tags = implode(',', $rs); // 把栏目tags串起来 $tagsArrSum = array_count_values(explode(',', $tags)); // @mk-tags_one_sum 把所有tags组成数组并计算每个值得数量
- 找到并修改以下代码:
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;
- 前台使用:
{pboot:tags scode=6 target=tag}[tags:text]([tags:sum]){/pboot:tags}
- 打开文件
更新时间:2025-04-10 23:47:32
转载请注明原文链接:https://www.muzicopy.com/suibi/3577.html