DZ原生代码交流学习,买插件不如自己动手解决
 
发新帖
楼主: 天启
查看: 668|回复: 0

[教程] DZ游客下不显示关键字和描述信息的问题

[复制链接]
天启VIP6 发表于 2019-11-13 16:45:02 | 显示全部楼层
找到文件:source\module\forum\forum_viewthread.php

搜索下面代码:
  1. if(IS_ROBOT || $_G['adminid'] == 1) $summary = str_replace(array("\r", "\n"), '', messagecutstr(strip_tags($post['message']), 160));
复制代码
替换为:
  1. $summary = str_replace(array("\r", "\n"), '', messagecutstr(strip_tags($post['message']), 160));
复制代码


门户、群组等看不见SEO修改方法如下:找到文件“source/class/helper/helper_seo.php”这个文件
  1. if($descriptiontext && (isset($_G['makehtml']) || CURSCRIPT == 'forum' || IS_ROBOT || $_G['adminid'] == 1)) {
  2. $seodescription = helper_seo::strreplace_strip_split($searchs, $replaces, $descriptiontext);
  3. }
  4. if($keywordstext && (isset($_G['makehtml']) || CURSCRIPT == 'forum' || IS_ROBOT || $_G['adminid'] == 1)) {
  5. $seokeywords = helper_seo::strreplace_strip_split($searchs, $replaces, $keywordstext);
  6. }
复制代码
替换为:
  1. if($descriptiontext) {
  2. $seodescription = helper_seo::strreplace_strip_split($searchs, $replaces, $descriptiontext);
  3. }
  4. if($keywordstext) {
  5. $seokeywords = helper_seo::strreplace_strip_split($searchs, $replaces, $keywordstext);
  6. }
复制代码


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