rich menga books search contact

***Secret FSR Fender guitars? Yes, they exist, and they're right here

Amazon links are affiliated. Learn more.

MovableType plugin hack

I'm still recovering from a cold as I write this.. ugh. Oh, and fair warning: This is a MT geekoid post, but I figured it would be useful to some out there.

Before I moved this blog from my previous domain I had a lot of problems with comment and trackback spam.

The comment spam was easy to fix. You rename the mt-comments.cgi to something else, like mt-comments_XrT.cgi or whatever, then modify your mt.cfg to reflect the newly named file. In the mt.cfg there's a line that states:

#CommentScript mt-comments.cgi

Once you rename mt-comments.cgi to something else, remove the # and change to:

CommentScript mt-comments_XrT.cgi

..or whatever you named it to. Save the file, logout/login to MT, rebuild the site. Done deal. When the spam comes back, rename it again, modify MT again, rebuild. Not a big deal really.

Even though I got the comment spam out of there, comments were still enabled for really old entries. I did some scoping around and found MTCloseComments, which works well. It "expires" the ability to post comments after x days old (whatever you specify).

My brain started working on this one.

"I bet I can get this script to stop accepting pings for entries after a certain date also."

I opened up the script and looked at it. I found that it specifically touches the entry_alllow_comments part of mt_entry in the MySQL database and simply changes the value from "1" (open) to "2" (closed) combined with some math to know when to close comments for each entry.

So I hacked it. I made my own version called MTClosePings. Basically, I did the following:

1) Changed any instance of "CloseComments" to "ClosePings".

2) Instead of having the script modify entry_allow_comments, I had it modify entry_allow_pings instead. Just like the original changes entry_allow_comments from "2" to "1", I had this one change entry_allow_pings from "1" to "0".

3) Kept everything else the same, except for renaming the file

Uploaded it, tested it.

Wah-lah, it worked. I added the code to my main template file to "expire" (as in take away) the ability to ping entries over 10 days old. Works like a charm. Upload, modify template, rebuild. Done deal.

Download the script if you like. Use it exactly like MTCloseComments, except use code as MTClosePings instead of MTCloseComments (obviously). This is tested with MT v3.16, I don't know if it works with older versions or not.

Big thanks to Alan M. Carroll for writing the original!


Best ZOOM R8 tutorial book
highly rated, get recording quick!

***Guitar deals & steals? Where? Right here. Price drops, B-stock and tons more.
🔥 Popular Articles 🔥
The BOSS DS-1 is an awful guitar pedal
Yes, I think this pedal sucks...
Casio F-91W
Casio F-91W cheat sheet
A quick guide on how to set the time, date and a few other tips and tricks.
Fender 3250L Guitar Strings
Rich's recommended guitar strings for Squier Stratocasters
Guitar string recommendation for Squier and Fender Stratocaster guitars
Squier Affinity Telecaster
7 reasons why every metal player should own a Telecaster
Smarter metal players use a Telecaster
Fender Classic Series '70s Stratocaster guitar
Fender Classic Series '70s Stratocaster guitar review
A review of the Fender Classic Series '70s Stratocaster
Fender American Professional Stratocaster Black
These are the best looking guitars you can buy
Some guitar players just want a guitar that has the right look first before anything else.
⭐ Recent Articles ⭐
Jackson JS11 Dinky
Jackson JS11 Dinky, the ultimate project guitar?
When it comes to ready-to-mod guitars, it doesn't get much better than this.
Gibson L6-S, a Norlin era beast from the 1970s
Oh, no... not another Norlin era Gibson.
1960 Fender Musicmaster
Fender Musicmaster might be the ultimate retirement guitar
It's real-deal Fender vintage, it's available, and there's one other rather nice advantage to owning one of these.
Gretsch G2655T Streamliner Brownstone Maple
The easiest Bigsby? Gretsch G2655T Streamliner
When you want a Bigsby vibrato on a genuinely well-built guitar for not a lot of money, you go Gretsch.
Epiphone Les Paul Standard 60s Bourbon Burst
Almost perfect, Epiphone Les Paul Standard '60s Bourbon Burst
There is a whole lot of wow to this Les Paul.
Squier 40th Anniversary Jazzmaster Gold Edition
Classic or tacky? Squier 40th Anniversary Jazzmaster Gold Edition
Is this a classic, or is it tacky? Let's talk about that.