Discuz X2.5和Discuz X2都有同样的问题,就是在用户未登录的时候,看到的keywords和description都是“首页”,其实,搜索引擎收录的时候,是能获取到这两个值的,不用担心。只是,这样看起来不够友好,所以,我们需要修改一下。:)
找到这个文件:source/class/helper/helper_seo.php
把以下代码:- if($descriptiontext && (CURSCRIPT == 'forum' || IS_ROBOT || $_G['adminid'] == 1)) {
- $seodescription = helper_seo::strreplace_strip_split($searchs, $replaces, $descriptiontext);
- }
- if($keywordstext && (CURSCRIPT == 'forum' || IS_ROBOT || $_G['adminid'] == 1)) {
- $seokeywords = helper_seo::strreplace_strip_split($searchs, $replaces, $keywordstext);
- }
复制代码
替换为:- if($descriptiontext) {
- $seodescription = helper_seo::strreplace_strip_split($searchs, $replaces, $descriptiontext);
- }
- if($keywordstext) {
- $seokeywords = helper_seo::strreplace_strip_split($searchs, $replaces, $keywordstext);
- }
复制代码
保存,即可!转载请注明来源:http://gai001.com
|