discuz x3.2如何默认让游客看到关键词和描述

乔飞强 Discuz!评论5,605字数 1248阅读模式

这个问题在x3以前的版本中可以通过找到\source\class\class_core.php文件的
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);
}
这段代码替换删除部分内容即可,但是此方法已经失效了,在X3.2以后的版本中在\source\class\class_core.php文件中找不到上述的代码,针对这个问题,风之力科技经过多时研究发现,要想实现discuz让游客看到关键词和描述,打开以下文件:
\source\class\helper\helper_seo.php文件,同样找到下列代码:
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);
}
即可!

为什么开放给游客看关键词和描述?
1、用爱站工具检索时,发现不了上述关键词和描述,但是用站长工具是可以识别,据说百度蜘蛛也是可以发现;
2、这样更利于网站SEO优化

继续阅读
我的微信
这是我的微信扫一扫
weinxin
我的微信
我的微信公众号
我的微信公众号扫一扫
weinxin
我的公众号
 
乔飞强
  • 网站侵权说明: 本网站的文章部分内容可能来源于网络,仅供大家学习与参考,如有侵权,请联系站长QQ1134652417删除处理。
Discuz X3论坛SEO优化设置教程 Discuz!

Discuz X3论坛SEO优化设置教程

下面先上图看看站帮网的优化设置和三标签的书写方法: 标题:站帮网-专注网站建设教程的站长论坛-站长帮助中心 关键词:站长论坛,站长帮助中心,网站建设 描述:站帮网又称站长帮助中心,为站长提供网站建设帮...

发表评论