typecho评论连接新窗口打开解决方法

分类:技术 3.31k浏览

typecho这个博客程序自带的评论系统,用户留下的URL默认是“当前窗口打开”。最近因为网站的需要,需要修改为新窗口打开。搜索了下代码,方法如下。

1、修改:var\Widget\Abstract\Comments.php文件

2、查找
echo '<a href="' , $this->url , '"' , ($noFollow ? ' rel="external nofollow"' : NULL) , >' , $this->author , '</a>';
3、替换为

echo '<a href="/l.php?url=' , $this->url , '"' , ($noFollow ? ' rel="external nofollow"' : NULL) , ' target="_blank">' , $this->author , '</a>';

即可解决。