在使用PbootCMS搭建英文站时会发现搜索结果页的面包屑为中文,标题为英文,该如何处理?可二开增加英文站对应文字来解决。
修改内容
打开ppshomecontrollerSearchController.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(); } } }
替换效果
最后更新于 2020-12-23 22:51:39 本文来源:https://www.pbhtml.com/232.html略有修改 相关知识点: PbootCMS搜索 PbootCMS多语言
- 1蓝天采集器内容页网址获取的时候,出错
- 2蓝天采集器蓝天采集器安装好后仍提示安装
- 3蓝天采集器数据库插入数据时候的问题
- 4蓝天采集器在测试爬取字段的时候,一直在转圈
- 5蓝天采集器批量添加起始网址数量有问题
- 6蓝天采集器提示信息
- 7蓝天采集器采集保存API问题
- 8PbootCMS建站系统模板新手必读|安装操作教程
- 9蓝天采集器怎么样采集商品首图
- 10金融投资/证券理财网站建设方案
- 11蓝天采集器翻译功能可否增加腾讯翻译君API?
- 12蓝天采集器无法检测到本地CMS
- 13MetInfo企业网站管理系统(米拓cms)火车头采集入库使用教程
- 14163K网站系统网站客服的QQ在线状态设置说明
- 15蓝天采集器正在校验更新文件
- 16蓝天采集器z-blog发布问题
- 17蓝天采集器发布设置,点击保存后,没有任何变化
- 18蓝天采集器群主希望能支持destoon7.0
- 19蓝天采集器邮箱发出去的文字都是乱码
- 20蓝天采集器关键json采集的问题
-
蓝天采集器这是什么问题
本帖最后由 猪头妹很2 于 2018-4-26 02:08 编辑 [p=120, null, left]我测试采集都没有问题,但是点采集就错误?? [p=120, null, left][size=100px] 页面错误!请稍后再试···
-
pbootcms常见的导航高亮下拉标···
我们在做网站的时候经常会遇到一些特殊的导航,比如导航带高亮,二级导航镶嵌下拉等等。当有这些的时候就找不到方法了,默认是无法输出的,今天呢蜀戎网就给大家讲解一下,如何来写这种导航标签。一级栏目调用例子:<ul>{pboot:nav···
-
163K网站系统图片系统+七牛云存储···
图片七牛云存储说明:1、开启七牛云存储后,全站的图片数据的调用和流量都将基于您的七牛云空间,可极大程度释放您网站服务器带宽的压力,大幅提升网站的显示速度2、图片数据默认自动上传到您网站本身的服务器上,当图片被初次浏览的时候即自动同步到您的七···
-
163k地方门户系统X10_V2(2···
163k地方门户系统在行业内是非常的有名气了使用的人数也是非常的多,作为一个门户系统一直不断的在更新是非常的不容易的。当然了好东西什么时候都不过期的,使用的人数一直在上升可以说潜力是非常大的。好了不多说今天我们来讲下X10如何升级到最新的版···
-
蓝天采集器安装出现问题了,安装不了
安装出现问题了,安装不了,什么办法解决啊,谢了 mysql什么版本?