Discuz X2.5和Discuz X2都有同樣的問題,就是在用戶未登錄的時候,看到的keywords和description都是“首頁”,其實,搜索引擎收錄的時候,是能獲取到這兩個值的,不用擔(dān)心。只是,這樣看起來不夠友好,所以,我們需要修改一下。:)
找到這個文件: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);
- }
復(fù)制代碼 替換為:- if($descriptiontext) {
- $seodescription = helper_seo::strreplace_strip_split($searchs, $replaces, $descriptiontext);
- }
- if($keywordstext) {
- $seokeywords = helper_seo::strreplace_strip_split($searchs, $replaces, $keywordstext);
- }
復(fù)制代碼 保存,即可!轉(zhuǎn)載請注明來源:http://wangaiche.com
|