user-pic

防垃圾评论的策略(1):安装Keystroke Plugin

Vote 0 Votes

昨天给CNLOG装了个预防垃圾留言的Keystroke插件,该插件我曾经试用过,非常好使,装上他基本能屏蔽所有垃圾评论。

首先下载 keystrokes-0.1.5.zip之后,解冻后将文件包中的两个文件分别安装到下列目录当中

MT/plugins/keystrokes.pl

MT/php/plugins/function.MTKeystrokes.php


然后在“单篇日记归档”、和“系统”模块中的“评论预览模板”“评论列表模板(可能直接调用CGI不好吧,MT3.3后已经去掉此模版)”的3个地方追加下面的“红字”标签。

・・・・・・

<MTEntryIfCommentsOpen> 
<form method="post" action="<$MTCGIPath$><$MTCommentScript$>" 
name="comments_form" onsubmit="if (this.bakecookie.checked) rememberMe(this)">
<$MTKeystrokes$>
<input type="hidden" name="static" value="1" />

・・・・・・

<p id="comments-open-text">
<label for="comment-text">评论: <MTIfAllowCommentHTML>(你可以使用 HTML 标签设置风格)</MTIfAllowCommentHTML></label>
<textarea id="comment-text" name="text" rows="15" 
cols="50" onkeypress="keystrokes(this.form)" ></textarea>
</p>

<div id="comments-open-footer" class="comments-open-footer">
<input type="submit" accesskey="v" name="preview" id="comment-preview" value="预览" />
<input type="submit" accesskey="s" onclick="keystrokes(this.form)" name="post" 
id="comment-post" value="发表"/>
</div>

・・・・・・

修改完以后再重建一下你的MT就可以了。如果安装了该插件,但没整理模版,将导致评论无法提交。如果MT平台中有多个用户则需要逐个修改模版,建议先修改MT默认模版,再使用Template Backup and Refresh 结合Power Rebuild插件进行大规模重建。

Add a Reply

Forum Groups

Blogcs 基于MT平台的BSP

MovableType 中文化

1 0

Last Topic: Movable Type 中文化 - 平生一笑 by bb on 2008年10月11日

1 0

Last Topic: Zhu8's Weblog:猪八的网:浮生志 by Zhu8 on 2008年10月16日

MovableType 问题咨询

Be the first to post a topic in this forum

MovableType 使用

16 11

Last Topic: Image::Magick 模块的安装 by bb on 2008年11月 9日

30 35

Last Topic: MT-Twitter:将MT文章同步到Twitter by bb on 2008年3月 9日

22 1

Last Topic: 修改MT的作者归档路径 by bb on 2008年10月25日

MovableType 模板

Be the first to post a topic in this forum

22 17

Last Topic: MovableType评论格式化 replies-to-replies by bb on 2008年10月15日

MovableType 延伸

14 17

Last Topic: 从Wordpress转移到Movabletype by bb on 2007年5月12日

2 2

Last Topic: 最新版MovableType 4.22 已经发布 by bb on 2008年11月19日