Discuz社区在后台设置好门户标题、关键字、描述,更新缓存,发现用户登录状态下,门户首页的关键字和描述正常显示;但在游客状态下不显示
找到“ source/class/helper/helper_seo.php ”目录下的文件的38行~43行代码,如下:
if($descriptiontext && (isset($_G['makehtml']) || CURSCRIPT == 'forum' || IS_ROBOT || $_G['adminid'] == 1)) {
$seodescription = helper_seo::strreplace_strip_split($searchs, $replaces, $descriptiontext);
}
if($keywordstext && (isset($_G['makehtml']) || 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);
}
修改完成后,进入后台更新缓存,然后刷新门户首页,就可以正常显示了,完成。







参与评论请先登录
请 登录 或 注册 后发表评论。