PbootCMS英文站搜索效果页面包屑显示中文的修改方法 - pbootcms教程
时间:2023-08-08 14:50
浏览:0
评论:0
修改内容
打开\apps\home\controller\SearchController.PHP,把里面的代码全部替换成以下(分为2x和3x版本,对应版本替换):
pb2.1.1版本替换
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版本替换
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(); } } }替换效果
1. 本站所有资源来源于用户上传或网络,仅作为参考研究使用,如有侵权请邮件联系站长!
2. 本站积分货币获取途径以及用途的解读,想在本站混的好,请务必认真阅读!
3. 本站强烈打击盗版/破解等有损他人权益和违法作为,请各位会员支持正版!
4. Pbootcms > PbootCMS英文站搜索效果页面包屑显示中文的修改方法 - pbootcms教程
2. 本站积分货币获取途径以及用途的解读,想在本站混的好,请务必认真阅读!
3. 本站强烈打击盗版/破解等有损他人权益和违法作为,请各位会员支持正版!
4. Pbootcms > PbootCMS英文站搜索效果页面包屑显示中文的修改方法 - pbootcms教程