昨天给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