pbootcms默认生成的sitemap.xml中是不含tag标签链接的,如果我们想要实现在sitemap.xml直接生成tags标签,这个要怎么操作呢?
// 指定分类标签调用
public function getSortTags($scode)
{
$join = array(
array(
'ay_content_sort b',
'a.scode=b.scode',
'LEFT'
),
array(
'ay_model c',
'b.mcode=c.mcode',
'LEFT'
)
);
$scode_arr = array();
if ($scode) {
// 获取所有子类分类编码
$this->scodes = array(); // 先清空
$scodes = $this->getSubScodes(trim($scode)); // 获取子类
// 拼接条件
$scode_arr = array(
"a.scode in (" . implode_quot(',', $scodes) . ")",
"a.subscode='$scode'"
);
}
$result = parent::table('ay_content a')->where('a.status=1')->where("c.type=2 AND a.tags<>''")
->where($scode_arr, 'OR')
->join($join)
->order('a.visits DESC')
->column('a.tags');
return $result;
}
2、打开/apps/home/controller/SitemapController.php,在73行后面增加
if (! ! $rs = $this->model->getSortTags('')) {
$tags = implode(',', $rs); // 把栏目tags串起来
$tags = array_unique(explode(',', $tags)); // 再把所有tags组成数组并去重
foreach ($tags as $key2 => $value2) {
if (! in_array($value2, array_column($data, 'tags'))) { // 避免重复输出
$url_rule_type = $this->config('url_rule_type') ?: 3;
if ($url_rule_type == 3) {
$link2 = Url::home('tag=' . urlencode($value2), '');
} else {
$link2 = Url::home('tag/' . urlencode($value2));
}
$str .= $this->makeNode($link2, date('Y-m-d'), '0.80');
}
}
}
PbootCMS附件上传报错UNKNOW: Code: 8192; Desc: stripos()问题描述 PbootCMS附件上传报错UNKNOW: Code: 8192; Desc: stripos(),具体显示如下图所示: 解决办法 打开/core/function/file.php,
pbootcms修改后台文章每页显示数量的修改办法本文是针对后台文章列表每页显示数量的修改!pbootcms后台默认文章显示条数最大是200条/页,如果需要修改更多怎么
pbootcms判断一个字段为空的时候调用另外一个字段用pbootcms时候,当一个字段为空时候,我们调用另外一个字段,要怎么写呢?其实方法很简单,比起dedecms还是比较容
pbootcms列表用istop置顶文章不管用的解决办法我们在用pbootcms做网站时候,在列表页用到istop=1,并且在后台选择了置顶,但是一点作用都没有。 这个问题的话通常
一段简单实用的Pbootcms页码显示样式代码一段简单实用的Pbootcms页码显示样式代码,具体代码如下,需要的朋友可以试下: {pboot:if({page:rows}0)} div class="pagebar
pbootcms系统对于mysql数据库备份的怎样安装?pbootcms有一些网站源码采用的是msql数据库的,这种网站源码要怎么安装呢? 1、首先将pbootcms网站整站的文件全部上传