官方解释:现在为了节省一些流量,在查看源代码的时候,只有管理员可以看到页面中的 keyword 和 description,而其他普通会员和游客是看不到的,但是蜘蛛是可以看到。
处理方法:
寻找文件:source/function/function_core.php
找到代码:
- if($descriptiontext && (CURSCRIPT == 'forum' || IS_ROBOT || $_G['adminid'] == 1)) {
- $seodescription = strreplace_strip_split($searchs, $replaces, $descriptiontext);
- }
- if($keywordstext && (CURSCRIPT == 'forum' || IS_ROBOT || $_G['adminid'] == 1)) {
- $seokeywords = strreplace_strip_split($searchs, $replaces, $keywordstext);
- }
复制代码
可以修改成这样:
- if($descriptiontext && (CURSCRIPT == 'forum' || CURSCRIPT == 'portal' || IS_ROBOT || $_G['adminid'] == 1)) {
- $seodescription = strreplace_strip_split($searchs, $replaces, $descriptiontext);
- }
- if($keywordstext && (CURSCRIPT == 'forum' || CURSCRIPT == 'portal' || IS_ROBOT || $_G['adminid'] == 1)) {
- $seokeywords = strreplace_strip_split($searchs, $replaces, $keywordstext);
- }
复制代码
我的方法,就是加个判断是门户,也对游客显示关键字。
也可以这样修改,更简单,不判断:
- if($descriptiontext) {
- $seodescription = strreplace_strip_split($searchs, $replaces, $descriptiontext);
- }
- if($keywordstext) {
- $seokeywords = strreplace_strip_split($searchs, $replaces, $keywordstext);
- }
复制代码
|