Dan is sick of comment spam and has realized that if he closes off old comments, it'll probably reduce comment spam. He's right. I've been doing this for months now and it's very effective. So, as my Giftmas gift to the blogging world, here's my whopping 26 lines of Perl code to do the job: blog_close_comments.pl.
It should be easily adapted for anyone using MT and MySQL.
Oh, the Blog::DBI module it requires looks like this.
You'll obviously need your own version.
It's not elegant or fancy, but it's working code that Does The Job and that's what's important. I could have written this using the MT API, but I was in a hurry. Someday I may fix that if I get ambitious.
UPDATE: The Blog::DBI module is not something from CPAN. It's meant to be installed "locally" rather than system-wide. I use it to supprt about half a dozen little blog/perl hacks I have. And it's actually a bit larger than the version I posted. Also, Derek sent a patch to make the blog_id an argument on the command-line. I've applied that.
Posted by jzawodn at December 25, 2003 06:44 AM
Wow that's almost exactly what I meant. Are there no original ideas left out there? Good work!
Add auto-disable trackbacks to that list.. I'm getting spam that way too..
Yeah, but that only works if you're using MySQL to back things. Some of us don't trust these newfangled "database server" doodads... :-P
I have a similar hack for WordPress and b2. Look here http://dinki.mine.nu/word/
Jeremy: sometime this weekend?
Simpler, use cron:
echo 'UPDATE mt_entry SET entry_allow_comments = 2 WHERE entry_blog_id = 2 AND entry_created_on < DATE_SUB(NOW(), INTERVAL 31 DAY)' | mysql
Setting blog_id appropriately. It closes comments on entries older than 31 days.
Also, i would recommend getting the mt-rebuild script:
http://www.mplode.com/tima/archives/000238.html
Otherwise, archive entries will still have the comment form but it won't be usable.
Ooops:
echo 'UPDATE mt_entry SET entry_allow_comments = 2 WHERE entry_blog_id = 2 AND entry_created_on < DATE_SUB(NOW(), INTERVAL 31 DAY)' | mysql
and so they use actually entries and the old entries are closed for "normal comments". I think that a keyword-list and the MT-blacklist can do it better.
> Otherwise, archive entries will still have the comment form but it won't be usable.
i am irritated that there is no hint about closing an old entry. so a lot of visitors, e.g. arriving by search engines, will be fooled. imho that's a real usability lack. how would you feel if you just had written a 5 minute elaboration and pushed the post-button, and then - this:
------------------------------------------------
Your comment submission failed for the following reasons:
Comments are not allowed on this entry.
------------------------------------------------
for closed entries you should either remove the form or give an appropriate hint.
best wishes and a happy new year,
gerald
Gerald,
it's not like any one reads the comments anyways :)
agree to this statement "and so they use actually entries and the old entries are closed for "normal comments". I think that a keyword-list and the MT-blacklist can do it better. "
this is an excellent post. It is very informative. Thank you so much.
this is an excellent post. It is very informative. Thank you so much.
Jessica Smith
Essay Writing
http://www.pureessays.com
This is easier and surely gives comfort to internet users. Thanks for sharing. Post like this offers great benefit. Thank you!
I admire what you have done here. Thank you for sharing. We will look forward for your future updates.
Thanks
Cool, there are actually some great points on here some of my friends will find this worthwhile, I must send them a link, many thanks.
Thanks for sharing such a fine piece of advice about SQL and application. Its really great to read and as well as very helpful to get to know such a great thing, thanks a lot for posting this.
Great share, great article, very usefull for me. Your thought of article is very much creative and interesting to read.
HI, I am rowan Atkinson. I've been doing this for months now and it's very effective.
This post is really very appreciable. I think some new things if you add to your post like current affairs will increase It is popularity.
-------------------------------------------------
rowanat01
Ground Motorcar Parts & Man important quantity is help. This enables our customers to wager their automotive & leatherneck ply requirements with one seed. We handle products of over 300 manufacturers and change operation to other 1350 manufacturers. This pipe of Manufacturers grants us the state to activity you with rightful almost EVERYTHING you impoverishment in the moving and leatherneck Manufacture!