小修改阻止Movable Type的垃圾评论

引用通告(0) 评论(1)

这段时间针对MT系统的垃圾评论多的让人受不了,看了官方的应对措施,不管是MT-Blacklist,还是MT-DBSL,以及Scode,由于我所用的虚拟主机的Perl环境问题,都不能正常运行。怎么办?难道就眼睁睁的看着自己的Blog被评论机器人大肆灌水?不仅占用空间,还污染环境?这是万万不能容忍的!而经过摸索,终于找到了一个暂时的可行的解决办法。

用文本编辑器打开“MT所在路径/lib/MT/App”下的Comments.pm文件,搜索:

if (!$blog->allow_anon_comments &&
        (!$comment->author || !$comment->email)) {
        return $app->handle_error($app->translate(
                           "Name and email address are required."));

在其后面加上

if ( $comment->author eq "online poker" || $comment->author eq "viagra" || $comment->author eq "phentermine" || $comment->author eq "valium" || $comment->author eq "debt consolidation" || $comment->author eq "poker" || $comment->author eq "phentermine" || $comment->author eq "online poker" || $comment->author eq "no limit texas hold em" || $comment->author eq "poker rooms" || $comment->author eq "internet poker" || $comment->author eq "party poker" || $comment->author eq "texas hold em poker" || $comment->author eq "poker tournament" || $comment->author eq "no limit texas hold em" || $comment->author eq "poker party" || $comment->author eq "cialis"){
            return $app->handle_error($app->translate(
                           "Your name is spammer."));

其中$comment->author eq "online poker"中的online poker可以替换为其它发送垃圾评论的用户名。

这样做后效果还是比较明显的,但愿能够给那些和我一样使用没有相应模块的虚拟主机的朋友们以帮助!

引用通告(0)

被引用的日记: 小修改阻止Movable Type的垃圾评论

TrackBack URL for this entry: http://www.thinkjam.org/loveblog/tjtb.cgi/95.
如果您想引用这篇日记到您的Blog,
请复制上面的链接,放置到您发表文章时的相应界面中。

评论(1)

I found this site and it has a lot of articles on a lot of subjects...

发表评论

最新发布

世界地球日
猛然间看到Google换了Logo,肯定是有什么大日子发生。果然,今天是一年…
Google提供域名Whois信息查询服务
昨天在DRL看到有坛友发此信息,追究起来,出处应该还是GSeeker,正好这…
入吾彀中
【解释】:彀:张满弓弩;彀中:指箭能射及的范围,比喻牢笼,圈套。进入了我的弓箭射…