无限星辰工作室-客户无限互联网动力之源

标题: Discuz!x3.2 导航添加nofollow 属性解决方案之一 [打印本页]

作者: crx349    时间: 2015-10-14 00:33
标题: Discuz!x3.2 导航添加nofollow 属性解决方案之一
方案说明:某些应用环境下,可能需要将导航部分的连接全部加上nofollow
适用版本:Discuz!x3.2
解决方法:
1.打开\source\function\cache\cache_setting.php

搜索:
  1. $item = "<a href="$subnav[url]" hidefocus="true" ".($subnav['title'] ? "title="$subnav[title]" " : '').($subnav['target'] == 1 ? "target="_blank" " : '').parsehighlight($subnav['highlight']).">$subnav[name]</a>";
复制代码

修改为
  1. $item = "<a href="$subnav[url]" rel="nofollow" hidefocus="true" ".($subnav['title'] ? "title="$subnav[title]" " : '').($subnav['target'] == 1 ? "target="_blank" " : '').parsehighlight($subnav['highlight']).">$subnav[name]</a>";
复制代码


搜索:
  1. $data['navs'][$id]['nav'] = "id="$navid" ".($onmouseover ? 'onmouseover="'.$onmouseover.'"' : '')."><a href="$nav[url]" hidefocus="true" ".($nav['title'] ? "title="$nav[title]" " : '').($nav['target'] == 1 ? "target="_blank" " : '')." $nav[style]>$nav[name]".($nav['identifier'] == 5 && $nav['type'] == 0 ? '<b class="icon_down"></b>' : '')."</a";
复制代码

修改为
  1. $data['navs'][$id]['nav'] = "id="$navid" ".($onmouseover ? 'onmouseover="'.$onmouseover.'"' : '')."><a href="$nav[url]" rel="nofollow" hidefocus="true" ".($nav['title'] ? "title="$nav[title]" " : '').($nav['target'] == 1 ? "target="_blank" " : '')." $nav[style]>$nav[name]".($nav['identifier'] == 5 && $nav['type'] == 0 ? '<b class="icon_down"></b>' : '')."</a";
复制代码


2.覆盖同名文件,更新缓存





欢迎光临 无限星辰工作室-客户无限互联网动力之源 (https://xmspace.net/) Powered by Discuz! X3.4