January 29, 2004

"Pending" queue for comments    [ Site Info ]

I've added some code to my MT install to create a submission queue for comments.   This isn't something that I wanted to do, since it creates a delay between submission of a comment and the comment becoming visible on the site, but the volume of comment-spam I've received (over 100 spams today, took me half an hour to go through and delete them) forces me to do this.

See below for quick download & install instructions.

If you're using Movable Type without a MySQL backend, you can follow the steps below.   If you're using a MySQL backend, you probably want to look at ScriptGoddess' solution instead.

Download comment_q.tar.gz or comment_q.zip from David Raynes' site.

Extract the files using your ZIP or tar/gz utility of choice (Linux users: 'tar xvfz comment_q.tar.gz' will do the trick).

Move the mt-comments-pending.cgi file to your MT cgi-bin directory and make sure it's executable (Linux users: 'chmod 755 mt-comments-pending.cgi').

Follow the steps below from "instructions.txt" in ScriptyGoddesses' ZIP file:


::STEP 5:: MODIFY MOVEABLE TYPE FILES: Comments.pm
Edit Comments.pm (located here: YourMTFolder/lib/MT/App/) following **ONE** of the options below...

---ALL BLOGS OPTION---
This will make the script work with all blogs in your MT install.
Change this line (If you have trouble finding the line - do a search to find it):

$comment->entry_id($q->param('entry_id'));

to:

$comment->entry_id('0');
$comment->temp_entry_id($q->param('entry_id'));

[alternate methods snipped]


::STEP 6:: MODIFY MOVEABLE TYPE FILES: Comment.pm

Edit Comment.pm (located here: YourMTFolder/lib/MT/)

Change this line:

'id', 'blog_id', 'entry_id', 'author', 'email', 'url', 'text', 'ip'

to:

'id', 'blog_id', 'entry_id', 'temp_entry_id', 'author', 'email', 'url', 'text', 'ip'


And then add a link to /cgi-bin/mt-comments-pending.cgi from your admin interface (your welcome message is a good place to drop it).   I added some text to the comment listing, comment preview and individual article archives to display a message to users letting them know that comments will be queued.   Easiest way to do this is to create a custom template with your text and then insert:

<$MTInclude module="Name"$>

into those templates, where "Name" is the name for your custom template.

Posted by edobbs at January 29, 2004 09:06 PM