Help - Search - Members - Calendar
Full Version: closing comments
Movable Type Community Forum > Additional Resources > Tips and Tricks
gavin
I keep getting random comments to old entries on my blog, mostly spam mixed in with a few confused people from google. I've decided to close the comments for any entry over 7 days old. This is how to do it (though it will only work for MySQL users).

Save this script as mt-closecomments and chmod +x it.

CODE
#!/bin/sh
user="****"
pass="****"
sql="update mt_entry set entry_allow_comments = 2 where TO_DAYS(NOW()) - TO_DAYS(entry_created_on) > 7"
mysql -u$user -p$pass -e"$sql" mt


The just add a cronjob, I decided to run it every day at 1:45am:

CODE
45 1 * * * /home/gavin/scripts/mt-closecomments


Enjoy!
Gavin.
fooljay
If you ask me, there is nothing more annoying than comments which have been closed only due to age of the post.

I will give you an example: a long time ago, I wrote up a hack which explained how to get rid of target="_blank" in the MTCommentAuthorLink, because it ruins XHTML-strict validation. Subsequently, many people linked to it.

I realized that people were still employing this hack, even though it is obsolete for v2.6+ thanks to the sanitize attribute. So, I did a Google search on all pages linking to mine or pages which detailed the hack but did not link to mine. On all found pages, I posted the updated information. Some people retired comments by date, so I was unable to comment, leaving later Googlers with bad information.

I did the same thing recently with the (complete) fix for the MT bookmarklet for Safari.

Closing comments just because the entry is old is a bad idea. If you want to educate Googlers, you can use the MT-RefSearch plugin (http://www.sixapart.com/log/2002/12/mtrefsearch_v07.shtml) and modify the text to explain that they are on an old archive page. The plugin will provide them with relevant on-site search results and may give them an indication that there is more recent and relevant content.

Closing comments because of the occasional comment spam is throwing the baby out with the bathwater...
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.