Discuz教程网

Discuz 门户/portal 看不到/没有 keyword 关键字与 description 解决方法

[复制链接]
authicon dly 发表于 2012-7-1 08:12:08 | 显示全部楼层 |阅读模式
官方解释:现在为了节省一些流量,在查看源代码的时候,只有管理员可以看到页面中的 keyword 和 description,而其他普通会员和游客是看不到的,但是蜘蛛是可以看到。

处理方法:
寻找文件:source/function/function_core.php
找到代码:
  1.         if($descriptiontext && (CURSCRIPT == 'forum'  || IS_ROBOT || $_G['adminid'] == 1)) {
  2.             $seodescription = strreplace_strip_split($searchs, $replaces, $descriptiontext);
  3.         }
  4.         if($keywordstext && (CURSCRIPT == 'forum'  || IS_ROBOT || $_G['adminid'] == 1)) {
  5.             $seokeywords = strreplace_strip_split($searchs, $replaces, $keywordstext);
  6.         }
复制代码

可以修改成这样:
  1.         if($descriptiontext && (CURSCRIPT == 'forum' || CURSCRIPT == 'portal' || IS_ROBOT || $_G['adminid'] == 1)) {
  2.             $seodescription = strreplace_strip_split($searchs, $replaces, $descriptiontext);
  3.         }
  4.         if($keywordstext && (CURSCRIPT == 'forum' || CURSCRIPT == 'portal' || IS_ROBOT || $_G['adminid'] == 1)) {
  5.             $seokeywords = strreplace_strip_split($searchs, $replaces, $keywordstext);
  6.         }
复制代码

我的方法,就是加个判断是门户,也对游客显示关键字。

也可以这样修改,更简单,不判断:


  1.         if($descriptiontext) {
  2.             $seodescription = strreplace_strip_split($searchs, $replaces, $descriptiontext);
  3.         }
  4.         if($keywordstext) {
  5.             $seokeywords = strreplace_strip_split($searchs, $replaces, $keywordstext);
  6.         }
复制代码




上一篇:Discuz 去除 forum.php
下一篇:Discuz Errno:1142 转移/更换服务器/上传FTP 无法登陆 解决方法
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

1314学习网 ( 浙ICP备10214163号 )

GMT+8, 2025-5-2 18:51

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表