typecho评论链接重定向
文章导读
wordpree评论链接重定向方法已有很多人分享,但是对于typecho我却找不到类似这样的详细修改方法,typecho官方文档不完整,而我又是php菜鸟,所以折腾了好久才修改好。通过这次折腾让我更是怀念wordpress了。
打开var/Widget/Abstract/Comments.php文件,寻找
if ($this->url && $autoLink) { echo '<a href="' , $this->url , '"' , ($noFollow ? ' rel="external nofollow"' : NULL) , '>' , $this->author , '</a>'; } else { echo $this->author; }
修改为
if ($this->url && $autoLink) { if(strpos($this->url, $this->options->siteUrl)!==false) { echo '<a href="', $this->url, '">', $this->author, '</a>'; } else { echo '<a href="', $this->options->siteUrl, 'go.html?url=', urlencode($this->url), '"', ' rel="nofollow"', '>', $this->author, '</a>'; } } else { echo $this->author; }
2013-10-22
版权所有:《Keep it hot》 => 《typecho评论链接重定向》
本文地址:http://keephot.eu.org/?post=12
除非注明,文章均为 《Keep it hot》 原创,欢迎转载!转载请注明本文地址,谢谢。
上一篇:2019年仍然有效的七大(真正免费)VPN服务
|
下一篇:typecho默认主题下添加导航菜单
发表评论: