五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

PbootCMS生成的sitemap.xml中增加tag標(biāo)簽鏈接

2023-09-13 16:05 作者:pbootcms模板  | 我要投稿

pbootcms默認(rèn)生成的sitemap.xml中是不含tag標(biāo)簽鏈接的,如果我們想要實現(xiàn)在sitemap.xml直接生成tags標(biāo)簽,這個要怎么操作呢?

養(yǎng)好習(xí)慣,修改這些文件之前做好備份。

1、打開/apps/home/model/SitemapModel.php,在78行后面增加個指定分類標(biāo)簽調(diào)用代碼。

// 指定分類標(biāo)簽調(diào)用

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串起來 AB模板網(wǎng)

? ? $tags = array_unique(explode(',', $tags)); // 再把所有tags組成數(shù)組并去重

? ? foreach ($tags as $key2 => $value2) {

? ? ? ? if (! in_array($value2, array_column($data, 'tags'))) { // 避免重復(fù)輸出

? ? ? ? ? ? $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模板教程:https://www.91084.com/pbootcms/

pbootcms網(wǎng)站模板下載:https://www.91084.com/


PbootCMS生成的sitemap.xml中增加tag標(biāo)簽鏈接的評論 (共 條)

分享到微博請遵守國家法律
芜湖县| 河东区| 宣城市| 恭城| 麦盖提县| 河东区| 江孜县| 平谷区| 苗栗市| 和政县| 秦安县| 长宁县| 新兴县| 临朐县| 延寿县| 泊头市| 墨竹工卡县| 漳州市| 七台河市| 玛多县| 梁平县| 阳信县| 通榆县| 永寿县| 南宫市| 晴隆县| 青阳县| 苍溪县| 辉县市| 甘孜| 五大连池市| 裕民县| 武汉市| 晋中市| 新化县| 阿拉尔市| 景德镇市| 宜川县| 呼伦贝尔市| 丘北县| 巴彦县|