1. <legend id='zM9o6'><style id='zM9o6'><dir id='zM9o6'><q id='zM9o6'></q></dir></style></legend>
      1. <tfoot id='zM9o6'></tfoot>

        <i id='zM9o6'><tr id='zM9o6'><dt id='zM9o6'><q id='zM9o6'><span id='zM9o6'><b id='zM9o6'><form id='zM9o6'><ins id='zM9o6'></ins><ul id='zM9o6'></ul><sub id='zM9o6'></sub></form><legend id='zM9o6'></legend><bdo id='zM9o6'><pre id='zM9o6'><center id='zM9o6'></center></pre></bdo></b><th id='zM9o6'></th></span></q></dt></tr></i><div id='zM9o6'><tfoot id='zM9o6'></tfoot><dl id='zM9o6'><fieldset id='zM9o6'></fieldset></dl></div>
        • <bdo id='zM9o6'></bdo><ul id='zM9o6'></ul>

        <small id='zM9o6'></small><noframes id='zM9o6'>

      2. PbootCMS生成的sitemap.xml中增加tag标签链接

        时间:2023-06-14

          <bdo id='GiubW'></bdo><ul id='GiubW'></ul>

            <tbody id='GiubW'></tbody>
          <legend id='GiubW'><style id='GiubW'><dir id='GiubW'><q id='GiubW'></q></dir></style></legend>

          <i id='GiubW'><tr id='GiubW'><dt id='GiubW'><q id='GiubW'><span id='GiubW'><b id='GiubW'><form id='GiubW'><ins id='GiubW'></ins><ul id='GiubW'></ul><sub id='GiubW'></sub></form><legend id='GiubW'></legend><bdo id='GiubW'><pre id='GiubW'><center id='GiubW'></center></pre></bdo></b><th id='GiubW'></th></span></q></dt></tr></i><div id='GiubW'><tfoot id='GiubW'></tfoot><dl id='GiubW'><fieldset id='GiubW'></fieldset></dl></div>

          <small id='GiubW'></small><noframes id='GiubW'>

            • <tfoot id='GiubW'></tfoot>
                • pbootcms默认生成的sitemap.xml中是不含tag标签链接的,如果我们想要实现在sitemap.xml直接生成tags标签,这个要怎么操作呢?

                  实现步骤

                  养好习惯,修改这些文件之前做好备份。
                  1、打开/apps/home/model/SitemapModel.php,在78行后面增加个指定分类标签调用代码。
                  // 指定分类标签调用
                  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() 下一篇:没有了

                  相关文章

                  最新文章

                • <small id='tTyX8'></small><noframes id='tTyX8'>

                • <legend id='tTyX8'><style id='tTyX8'><dir id='tTyX8'><q id='tTyX8'></q></dir></style></legend>
                    1. <tfoot id='tTyX8'></tfoot>
                      • <bdo id='tTyX8'></bdo><ul id='tTyX8'></ul>

                      <i id='tTyX8'><tr id='tTyX8'><dt id='tTyX8'><q id='tTyX8'><span id='tTyX8'><b id='tTyX8'><form id='tTyX8'><ins id='tTyX8'></ins><ul id='tTyX8'></ul><sub id='tTyX8'></sub></form><legend id='tTyX8'></legend><bdo id='tTyX8'><pre id='tTyX8'><center id='tTyX8'></center></pre></bdo></b><th id='tTyX8'></th></span></q></dt></tr></i><div id='tTyX8'><tfoot id='tTyX8'></tfoot><dl id='tTyX8'><fieldset id='tTyX8'></fieldset></dl></div>