<form id="1fljn"></form>
      <address id="1fljn"></address>
        <form id="1fljn"><nobr id="1fljn"><th id="1fljn"></th></nobr></form>

              + 收藏我們

              網站模板

              網站模板搜索
              404模板 營銷型模板 政府網站模板 單頁模板 雙語模板 標簽大全

              注冊

              PbootCMS英文站搜索效果頁面包屑顯示中文的修改方法

              AB模板網 / 2022-03-02
              PbootCMS英文站搜索效果頁面包屑顯示中文的修改方法

              修改內容

              打開\apps\home\controller\SearchController.php,把里面的代碼全部替換成以下(分為2x和3x版本,對應版本替換):

              pb2.1.1版本替換

              <?php
              /**
               * @copyright (C)2020-2099 Hnaoyun Inc.
               * @author XingMeng
               * @email hnxsh@foxmail.com
               * @date 2020年3月8日
               *  搜索控制器     
               */
              namespace app\home\controller;
              
              use core\basic\Controller;
              
              class SearchController extends Controller
              {
              
                  protected $parser;
              
                  protected $htmldir;
              
                  public function __construct()
                  {
                      $this->parser = new ParserController();
                      $this->htmldir = $this->config('tpl_html_dir') ? $this->config('tpl_html_dir') . '/' : '';
                  }
              
                  // 內容搜索@mk-lang 增加英語
                  public function index()
                  {
                      if (cookie('lg') == 'cn') {
                          $searchtpl = request('searchtpl');
                          if (! preg_match('/^[\w]+\.html$/', $searchtpl)) {
                              $searchtpl = 'search.html';
                          }
                          
                          $content = parent::parser($this->htmldir . $searchtpl); // 框架標簽解析
                          $content = $this->parser->parserBefore($content); // CMS公共標簽前置解析
                          $pagetitle = get('keyword') ? get('keyword') . '-' : '';
                          $content = str_replace('{pboot:pagetitle}', $this->config('search_title') ?: $pagetitle . '搜索結果-{pboot:sitetitle}-{pboot:sitesubtitle}', $content);
                          $content = $this->parser->parserPositionLabel($content, 0, '搜索', homeurl('search')); // CMS當前位置標簽解析
                          $content = $this->parser->parserSpecialPageSortLabel($content, - 1, '搜索結果', homeurl('search')); // 解析分類標簽
                          $content = $this->parser->parserSearchLabel($content); // 搜索結果標簽
                          $content = $this->parser->parserAfter($content); // CMS公共標簽后置解析
                          echo $content; // 搜索頁面不緩存
                          exit();
                      } else {
                          $searchtpl = request('searchtpl');
                          if (! preg_match('/^[\w]+\.html$/', $searchtpl)) {
                              $searchtpl = 'search.html';
                          }
                          
                          $content = parent::parser($this->htmldir . $searchtpl); // 框架標簽解析
                          $content = $this->parser->parserBefore($content); // CMS公共標簽前置解析
                          $pagetitle = get('keyword') ? get('keyword') . '-' : '';
                          $content = str_replace('{pboot:pagetitle}', $this->config('search_title') ?: $pagetitle . 'The search results-{pboot:sitetitle}-{pboot:sitesubtitle}', $content);
                          $content = $this->parser->parserPositionLabel($content, 0, 'Search', homeurl('search')); // CMS當前位置標簽解析
                          $content = $this->parser->parserSpecialPageSortLabel($content, - 1, 'The search results', homeurl('search')); // 解析分類標簽
                          $content = $this->parser->parserSearchLabel($content); // 搜索結果標簽
                          $content = $this->parser->parserAfter($content); // CMS公共標簽后置解析
                          echo $content; // 搜索頁面不緩存
                          exit();
                      }
                  }
              }

              pb3.0.3版本替換

              <?php
              /**
               * @copyright (C)2020-2099 Hnaoyun Inc.
               * @author XingMeng
               * @email hnxsh@foxmail.com
               * @date 2020年3月8日
               *  搜索控制器     
               */
              namespace app\home\controller;
              
              use core\basic\Controller;
              use core\basic\Url;
              
              class SearchController extends Controller
              {
              
                  protected $parser;
              
                  protected $htmldir;
              
                  public function __construct()
                  {
                      $this->parser = new ParserController();
                      $this->htmldir = $this->config('tpl_html_dir') ? $this->config('tpl_html_dir') . '/' : '';
                  }
              
                  // 內容搜索
                  public function index()
                  {
                      if (cookie('lg') == 'cn') {
                          $searchtpl = request('searchtpl');
                          if (! preg_match('/^[\w]+\.html$/', $searchtpl)) {
                              $searchtpl = 'search.html';
                          }
                          
                          $content = parent::parser($this->htmldir . $searchtpl); // 框架標簽解析
                          $content = $this->parser->parserBefore($content); // CMS公共標簽前置解析
                          $pagetitle = get('keyword') ? get('keyword') . '-' : '';
                          $content = str_replace('{pboot:pagetitle}', $this->config('search_title') ?: $pagetitle . '搜索結果-{pboot:sitetitle}-{pboot:sitesubtitle}', $content);
                          $content = $this->parser->parserPositionLabel($content, 0, '搜索', Url::home('search')); // CMS當前位置標簽解析
                          $content = $this->parser->parserSpecialPageSortLabel($content, - 1, '搜索結果', Url::home('search')); // 解析分類標簽
                          $content = $this->parser->parserSearchLabel($content); // 搜索結果標簽
                          $content = $this->parser->parserAfter($content); // CMS公共標簽后置解析
                          echo $content; // 搜索頁面不緩存
                          exit();
                      } else {
                          $searchtpl = request('searchtpl');
                          if (! preg_match('/^[\w]+\.html$/', $searchtpl)) {
                              $searchtpl = 'search.html';
                          }
                          
                          $content = parent::parser($this->htmldir . $searchtpl); // 框架標簽解析
                          $content = $this->parser->parserBefore($content); // CMS公共標簽前置解析
                          $pagetitle = get('keyword') ? get('keyword') . '-' : '';
                          $content = str_replace('{pboot:pagetitle}', $this->config('search_title') ?: $pagetitle . 'The search results-{pboot:sitetitle}-{pboot:sitesubtitle}', $content);
                          $content = $this->parser->parserPositionLabel($content, 0, 'Search', Url::home('search')); // CMS當前位置標簽解析
                          $content = $this->parser->parserSpecialPageSortLabel($content, - 1, 'The search results', Url::home('search')); // 解析分類標簽
                          $content = $this->parser->parserSearchLabel($content); // 搜索結果標簽
                          $content = $this->parser->parserAfter($content); // CMS公共標簽后置解析
                          echo $content; // 搜索頁面不緩存
                          exit();
                      }
                  }
              }

              替換效果

              文章搜集與網絡,如有侵權請聯系本站,轉載請說明出處:http://www.haitianjonas.com/pbootcmsjs/9939.html

              有問題可以加入網站技術QQ群一起交流學習

              ☉首先聲明,只要是我們的vip會員全站所有資源均可以免費下載,不做任何限制(了解更多)

              ☉本站的源碼不會像其它下載站一樣植入大量的廣告。

              ☉本站提供的網站源碼,都是做好測試好發布的,均可放心使用。

              ☉本站提供的網站源碼,均帶數據及演示地址?梢栽谌我辉创a詳情頁查看演示地址。

              ☉為了vip利益的最大化,我們還提供了vip贈品(了解更多

              ☉如有其他問題,請加網站客服QQ(9490489)進行交流。

              首頁 pbootcms模板 html模板 會員中心
              中国一级毛片在公交车上

                  <form id="1fljn"></form>
                  <address id="1fljn"></address>
                    <form id="1fljn"><nobr id="1fljn"><th id="1fljn"></th></nobr></form>