This plugin uses Javascript to hide the true location of you comments script, making it difficult for spammers to find it in order to bombard you with spam.

It is important to note that if you use this plugin, commenters must be using a Javascript-enabled brower in order to post comments.

I have been testing this plugin on one of my blogs for about 12 hours, and I have received zero spam in that time period on that blog. I will be installing it on all my blogs today.

Installation:

1. Download Now:

DisguiseCommentURL.zip

Membership required, please sign-in or register:

2. Extract and upload MTDisguiseCommentURL.pl to your 'plugins' directory within your 'mt' directory.

3. Open your Individual Entry Archive template and find the following line:

<form method="post" action="<$MTCGIPath$><$MTCommentScript$>" name="comments_form" onsubmit="if (this.bakecookie[0].checked) rememberMe(this)">

Delete <$MTCGIPath$> and <$MTCommentScript$> and replace with a fake comment URL. An example might be http://www.mydomain.com/postcomments.cgi -- but don't use this example! Make up something unique. Remember, the URL should point to a non-existent file.

2. In the same template, after the </form> tag, enter:

<$MTDisguiseCommentURL$>

3. Rebuild your Individual Archives, and you are done. Post a test comment to make sure it works.

Update (12/17/04 08:57 EST): I have just received a report that this trick does NOT work using the Safari web browser. This is likely becuase this is not the "proper" way to use BASE HREF. I will be posting a javascript version soon.

I tried this about 5 hours ago, and it works. I have received ZERO spam since I implemented this -- and I usually get hundreds a day.

The trick requires a simple template edit and works by tricking the spambots into think that your comment script is somewhere else. So when they try to spam you, they get 404 errors. Everyone else can post fine as usual.

Steps:

1. In your Individual Entry Archive, look for the following:

<form method="post" action="<$MTCGIPath$><$MTCommentScript$>" name="comments_form" onsubmit="if (this.bakecookie[0].checked) rememberMe(this)">

and replace it with:

<base href="<$MTCGIPath$>">
<form method="post" action="<$MTCommentScript$>" name="comments_form" onsubmit="if (this.bakecookie[0].checked) rememberMe(this)">

2. Further down the page, after the </form> tag, enter:

<base href="<$MTBlogURL$>">

3. Rebuild your Indivdual Archives, and you are done.

This tricks spammers into thinking that your comment script is in the same folder as your entry. Since I starting using this, I have received zero spam and about 50 'Page Not Found' 404 errors in my web stats, presumably spambots trying to look for my comments script in the wrong places.

In combination with this, you may want to rename your comments script, just to be safe. I have not done so, but it may help.

This trick -- like many others -- is easy for the spammers to work around. If enough people start doing this, they will make adjustments to defeat it. For now, however, it is working extremely well. :D

This is a hack I began using recently, in an emergency situation. Blog comment spam was creating a huge CPU load on my web server, to the point that it was causing server crashes and CPU restrcitions from my (now former) web host. I have heard increasing report of web hosting banning the use of Movable Type on their hosting plans for the same reason.

This an MT-Blacklist hack that automatically blocks the IP address of someone trying to post commnent that matches your blacklist. It does this using htaccess, so repeated POSTs from that IP will never reach the MT scripts, thus saving your CPU.

First, let me be clear that I agree with Jay Allen and Adam Kalsey's comments about the drawbacks of IP blocking. And I recommend that you read those posts linked to in the previous sentence, before using this hack. I do disagree with the general notion that "IP banning is useless", because it can reduce the CPU load, and that it the only benefit of this hack. This hack will not reduce your blog spam. It may, however, reduce the CPU burden of MT and MT-Blacklist while spam is being checked against the (ever growing) blacklist and blocked accordingly.

Requirements:

MT 3.1+
MT-Blacklist 2.0+
Apache Web Server

Installation:

1. If you haven't done so already, read the 2 posts that I linked to in the previous paragraph. This hack is not perfect, and those posts do a job explaining some of the reasons why.

2. Open Submission.pm for editing, found in /mt/plugins/Blacklist/lib/Blacklist/App/.

3. Look for the following line:

$message = $app->translate("MT-Blacklist comment denial on '[_1]'.<br />Author: [_2]; Email: [_3]<br />[_4] matched: [_5]", MT::Util::encode_html($blog->name), $com_author, $com_email, $item_type, '<a href="'.$item_url.'">'.$matches->[0]->{item}->text.'</a>');

For me this is on line 552. After this line, add:

### AutoIPBlock
my $remote_ip = $app->remote_ip;
my $htaccess = ".htaccess";
open(DAT,">>$htaccess") || die("Cannot Open File");
print DAT "deny from $remote_ip\n";
close(DAT);
###

4. A few lines lower (now on line 561), find the following line:

$message = $app->translate("MT-Blacklist comment denial on '[_1]'.<br />Author: [_2]; Email: [_3]<br />[_4] blacklist items matched.", MT::Util::encode_html($blog->name), $com_author, $com_email, scalar(@$matches));

After this line, add:

### AutoIPBlock
my $remote_ip = $app->remote_ip;
my $htaccess = ".htaccess";
open(DAT,">>$htaccess") || die("Cannot Open File");
print DAT "deny from $remote_ip\n";
close(DAT);
###

5. Another few lines down (now at line 579), find:

$message = $app->translate("MT-Blacklist ping denial on '[_1]'.<br />Blog: [_2]; URL: [_3]<br />[_4] matched: [_5]", MT::Util::encode_html($blog->name), MT::Util::encode_html($remote_blog), MT::Util::encode_html($remote_url), $item_type, '<a href="'.$item_url.'">'.$matches->[0]->{item}->text.'</a>');

After this line, add:

### AutoIPBlock
my $remote_ip = $app->remote_ip;
my $htaccess = ".htaccess";
open(DAT,">>$htaccess") || die("Cannot Open File");
print DAT "deny from $remote_ip\n";
close(DAT);
###

6. Another few lines down (now at line 588 ) find:

$message = $app->translate("MT-Blacklist ping denial on '[_1]'.<br />Blog: [_2]; URL: [_3]<br />[_4] blacklist items matched.", MT::Util::encode_html($blog->name), MT::Util::encode_html($remote_blog), MT::Util::encode_html($remote_url), scalar(@$matches));

After this line, add:

### AutoIPBlock
my $remote_ip = $app->remote_ip;
my $htaccess = ".htaccess";
open(DAT,">>$htaccess") || die("Cannot Open File");
print DAT "deny from $remote_ip\n";
close(DAT);
###

Note: Steps 3 and 4 above are for comments, and steps 5 and 6 are for trackbacks. If you nwat to enable this hack for only comments or trackbacks, you can skip steps accordingly.

7. In your 'mt' directory (directory where your mt.cgi file lives), upload a blank file with the name of '.htaccess' (note the preceding '.')

8. Test it by posting a comment with a string known to be on your blacklist. If it works, you will be banned from posting. It will also ban your IP from accessing the MT admin area, so you need to go in via FTP and remove your IP from the .htaccess file.

That's it. This is a simple, very rudimentary hack, that should only be used in mergency situations, where CPU load has become an issue due to repeated spamming by spambots.

Note: I am not an expert when in comes to CPU load and such. I don't know how much CPU cycles are saved by this hack. I do know that it seems to help a lot when my old server was crashing frequently due to CPU load.

You may have been recently hit by several waves of Trackback spam, including a major assault over the last 24 hours. These attacks are clearly automated, sending many pings in a short period of time. Even if MT-Blacklist is effecting repelling these attacks, it can still cause problems for some. In the past few weeks, MT-Blacklist was working so hard to block all the spam that it contributed to a heavy CPU load on the server, resulting in several crashes (I have since moved to a dedicated server). So I have been looking for ways to ease the burden of MT-Blacklist. For trackback spam, one of the first things I tried was to rename my Trackback script from the default 'mt-tb.cgi', thinking maybe that's how these spammers were finding and attaching my sites. It didn't work. Within minutes, they were hitting the newly renamed script. Based on this, it seems that there must be Spam Spiders at play here, crawling the web and sending trackback spam as soon as they find trackback URLs. And since they seem to have adapted to the new name, perhaps these spiders are looking for some other pattern, perhaps the text " The Trackback URL for this entry is". I have tried changed that text on all of my blogs, but I think it might help. Instead, I decided to disguise the Trackback URL so that it would be difficult for spiders to parse and attach my sites.

MTDisguiseTrackbackURL is a mini-plugin that replaces the MT function for the <MTEntryTrackbackURL> tag that is displayed in the Trackback Listing template. MTDisguiseTrackbackURL outputs the URL using a few javascript commands, breaking up the full URL in the underlying HTML code. But as long as your visitors are using a JavaScript-enabled browser, the URL will appear the exact same way that it does now, and they can easily copy and paste the URL manually.

If you want to seem an example, view the Trackbacks page for this entry, and view source to see the JavaScript code.

Installation:

Installation is very easy:

1. Download Now:

DisguiseTrackbackURL.zip.

Membership required, please sign-in or register:

2. Extract the DisguiseTrackURL.pl and upload it to the 'plugins' directory within your 'mt' directory.

3. That's all. Since Trackback listing pages are dynamically displayed, you don't need to rebuild anything.

As always, feedback is appreciated.


By the way, if you haven't heard yet, a critical bug has been found in the latest version of MT-Blacklist. Don't delete any blogs! Click here for more information.

Anil Dash has posted about my forums powered by Movable Type. I started doing this more than a year ago, and I have evolved it on some sites into active forums with additional features. For example, take a look at Seinfeld Forum. As you can see, this Movable Type-powered forum has over 4,000 topics (entries) and over 15,000 replies (comments). Features include a "post count" (using the CommentLeaders plugin) and an associated status level based on post count. I recently added automication pagination of threads using my MTDynamic plugin (although I don't think I have released that version of the plugin yet). I have also added a search function that searches only the forum section of the site (using a source-modified version of MT search). Another active forum example is Mars Forum -- over 20,000 replies (comments) on that one.

I have not yet posted this to MT hacks yet, mainly because it would take a long time to document all of the steps to get this set up. I do plan to do that, but I have been very busy. Let me know if you are interested (extra motivation may help me find the time :) )

For a complete list of the new features in v0.6, click here.

MTTrackbackEntry is a Movable Type plugin and hack that enables you to create new entries from the Trackbacks that you receive. In other words, it enables other people to post new entries in your blog, simply by pinging an entry or category on your blog. The title of this plugin/hack could just as easily be called TrackbackCrosspost, since it can act as a trackback-based cross-posting tool.

Currently, entries are created AND pings are received and recorded by default. In v0.6, actual ping entries can be optionally turned off. So if you turn off pings, TrackbackEntry will only record a new entry. Personally, I can't think of many practical cases for record the ping as well - it just clutters up your database.

TrackbackEntry is especially useful when used to ping Categories rather than entries. When a category is pinged, the new entry is added to that category. This provides more control over the display of Trackback-Entries (display in sidebar, sub-page, etc.)

New: Category Creation

In v0.6, you can enable a new category creation feature. This powerful feature enables people to create entries in categories that don't yet exist on your blog. For example, ping the following:

...mt-tbentry.cgi/books

would create a new category in your blog called "books" and add the entry to that category. If your blog already has a category called "books", the entry is simply added to that category. One of the benefits of this approach is that people don't need to remember the trackback id of the category.

MT-Blacklist Support

Version 0.6 includes optional support for MT-Blacklist. I have only tested this with v 1.63rc2 with MT 2.661. When this option is turned on, incoming pings are scanned against your blacklist just like a real trackback. This option is off by default.

Template Tags

There are only two new tags provided (because most of functionality lies in the scripts, not in the plugin itself). The following tags enable you to output the TrackbackEntry URLs for entries and categories:

<MTEntryTrackbackEntryLink> - Similar to <MTEntryTrackbackLink>, this tag will display the TrackbackEntry URL for a particular entry. Others can use this URL to to send a TrackbackEntry ping, which will create a Trackback record for the entry and create a new entry in the blog.

<MTCategoryTrackbackEntryLink> - Similar to <MTCategoryTrackbackLink>, this tag will display the TrackbackEntry URL for a particular category. Others can use this URL to to send a TrackbackEntry ping, which will create a Trackback record for the category and create a new entry in the category.

Requirements

Net::Blogger - Sorry, I neglected to mention this is the first release.

Installation

1. Download Now:

MTTrackbackEntry.zip and extract the files.

Membership required, please sign-in or register:

2. Place "mt-tbentry.cgi" in your MT directory (same directory as mt.cgi). Then CHMOD to 755.

3. Place "TrackbackEntry.pl" in your "plugins" directory within your MT directory.

4. Create a new user to be be used for Trackback-Entries. Make note of the username and password. Give the user permisions to post and rebuild files on each of the blogs that you want to enable TrackbackEntry.

5. Open "TrackbackEntry.pm" and find the line that reads:

my $mt_username = 'tbentriesusername';

Replace 'tbentriesusername' with the user name chosen in Step 4 (the username should be enclosed in single quotes). (remember that MT usernames are case-sensitive)

6. Just below this line, you should find the following line:

my $mt_password = 'tbentriespassword';

Replace 'tbentriespassword' with the password chosen in Step 4 (the password should be enclosed in single quotes).

7. Search for "OPTIONS" and choose the options that you want by setting them to 1 or 0. Options include: create new category, default blog, default category, use MT-Blacklist, and create trackback.

8. Save the file and upload to '/lib/MT/App/' within your MT directory (same directory as "Trackback.pm")

9. Begin using the tags described above to inform your visitors of the TrackbackEntry URLs for your entries and categories.

10. Test it out be asking someone to send you a TrackbackEntry ping. (If you want me to send you a test ping, let me know)

Displaying TrackbackEntries

For displaying TrackbackEntries, it is important to understand what data gets stored in which entry fields:

-the Ping Excerpt gets stored in the Entry Body field.
-the Ping Blog Name gets stored in the Extended Entry field.
-the Ping Source URL gets stored in the Excerpt field.
-the Ping Remote IP gets stored in the Keyworda field.

As such you can use the associated MT template tags to display the entries. If you want to display a list of entries that are mixed between your own entries and TrackbackEntries, you may want to make use of the Compare plugin like this:

<MTIfNotEqual a="[MTEntryAuthor]" b="tbentriesusername">
<a href="<$MTEntryAuthorURL$>"><$MTEntryAuthor$></a>
</MTIfNotEqual>
<MTIfEqual a="[MTEntryAuthor]" b="tbentriesusername">
<MTIfEqual a="[MTEntryExcerpt no_generate='1']" b="">
<$MTEntryMore convert_breaks="0"$>
</MTIfEqual>
<MTIfNotEqual a="[MTEntryExcerpt no_generate='1']" b="">
<a href="<$MTEntryExcerpt no_generate="1"$>"><$MTEntryMore convert_breaks="0"$></a>
</MTIfNotEqual>
</MTIfEqual>

The above template snippet displays a linked version of the author's. In the case of TrackbackEntries, the blog name is used as the author name and the source URL is used as the author URL.

Please let me know what you think.

Version History

0.5
-Initial release
0.6
-recording of trackback is now optional
-category creation
-MT-Blacklist support

MTTrackbackEntry is a Movable Type plugin and hack that enables you to create new entries from the Trackbacks that you receive. In other words, it enables other people to post new entries in your blog, simply by pinging an entry or category on your blog. The title of this plugin/hack could just as easily be called TrackbackCrosspost, since it can act as a trackback-based cross-posting tool.

Currently, entries are created AND pings are received and recorded. This means that TrackbackEntry will receive and record pings the same as usual, but it will also add a new entry. Perhaps a future version will only add new entries, or at least provide an option in this area.

TrackbackEntry is especially useful when used to ping Categories rather than entries. When a category is pinged, the new entry is added to that category. This provides more control over the display of Trackback-Entries (display in sidebar, sub-page, etc.)

Template Tags

There are only two new tags provided (because most of functionality lies in the scripts, not in the plugin itself). The following tags enable you to output the TrackbackEntry URLs for entries and categories:

<MTEntryTrackbackEntryLink> - Similar to <MTEntryTrackbackLink>, this tag will display the TrackbackEntry URL for a particular entry. Others can use this URL to to send a TrackbackEntry ping, which will create a Trackback record for the entry and create a new entry in the blog.

<MTCategoryTrackbackEntryLink> - Similar to <MTCategoryTrackbackLink>, this tag will display the TrackbackEntry URL for a particular category. Others can use this URL to to send a TrackbackEntry ping, which will create a Trackback record for the category and create a new entry in the category.

Installation

1. Download Now:

MTTrackbackEntry.zip and extract the files.

Membership required, please sign-in or register:

2. Place "mt-tbentry.cgi" in your MT directory (same directory as mt.cgi). Then CHMOD to 755.

3. Place "TrackbackEntry.pl" in your "plugins" directory within your MT directory.

4. Create a new user to be be used for Trackback-Entries. Make note of the username and password. Give the user permisions to post and rebuild files on each of the blogs that you want to enable TrackbackEntry.

5. Open "TrackbackEntry.pm" and find the line that reads:

my $mt_username = 'tbentriesusername';

Replace 'tbentriesusername' with the user name chosen in Step 4 (the username should be enclosed in single quotes). (remember that MT usernames are case-sensitive)

6. Just below this line, you should find the following line:

my $mt_password = 'tbentriespassword';

Replace 'tbentriespassword' with the password chosen in Step 4 (the password should be enclosed in single quotes).

7. Save the file and upload to '/lib/MT/App/' within your MT directory (same directory as "Trackback.pm")

8. Begin using the tags described above to inform your visitors of the TrackbackEntry URLs for your entries and categories.

9. Test it out be asking someone to send you a TrackbackEntry ping. (If you want me to send you a test ping, let me know)

Displaying TrackbackEntries

For displaying TrackbackEntries, it is important to understand what data gets stored in which entry fields:

-the Ping Excerpt gets stored in the Entry Body field.
-the Ping Blog Name gets stored in the Extended Entry field.
-the Ping Source URL gets stored in the Excerpt field.
-the Ping Remote IP gets stored in the Keyworda field.

As such you can use the associated MT template tags to display the entries. If you want to display a list of entries that are mixed between your own entries and TrackbackEntries, you may want to make use of the Compare plugin like this:

<MTIfNotEqual a="[MTEntryAuthor]" b="tbentriesusername">
<a href="<$MTEntryAuthorURL$>"><$MTEntryAuthor$></a>
</MTIfNotEqual>
<MTIfEqual a="[MTEntryAuthor]" b="tbentriesusername">
<MTIfEqual a="[MTEntryExcerpt no_generate='1']" b="">
<$MTEntryMore convert_breaks="0"$>
</MTIfEqual>
<MTIfNotEqual a="[MTEntryExcerpt no_generate='1']" b="">
<a href="<$MTEntryExcerpt no_generate="1"$>"><$MTEntryMore convert_breaks="0"$></a>
</MTIfNotEqual>
</MTIfEqual>

The above template snippet displays a linked version of the author's. In the case of TrackbackEntries, the blog name is used as the author name and the source URL is used as the author URL.

Please let me know what you think.

Movable Type includes templates for the total number of comments in a blog (MTBlogCommentCount) and the total number of comments on an entry (MTEntryCommentCount). But there is no similar template tag for the total number of comments in a category. This template provides this tag: MTCategoryCommentCount.

Installation

1. Download Now:

MTCategoryCommentCount.zip.

Membership required, please sign-in or register:

2. Start using the <MTCategoryCommentCount> tag in a Category context, to output the total number of comments in a Category.

Example

On my Google Forum page, the tables list both "Topics" and "Replies". Topics are Entries and Replies are Comments. I used the <MTCategoryCommentCount> to generate the number of replies in each Forum (Category).

1. Start with one of your blogs (any blog, it doesn't matter)

2. Create a new Template Module.

3. In the "Link this template to a file" field, enter a file system path and file name to save the template text. For shared template modules, I save them all to a "shared" directory and give each file a "txt" extension.

4. Save the template module.

5. Go to another blog that you also want to use the shared template and create a new template module.

6. Don't put anything in the body of the template module.

7. Give the template module a name and specifiy the *same* path and file name in the "Link this template to a file" field.

8. Save the template. You will see the template module code from the first blog appear in the body.

9. At this point you can modify the template code from any of your blogs and it will be updated across all blog using the module.

This plugin is designed to be used with MT-BlackList. The plugin gives you the ability easily see stats about what is being blocked by your blacklist, including the ability to summarize and rank blacklist entries.

BlacklistStats is an adaptation of the Searches plugin by David Raynes. 99.9% of the credit goes to David, as I modified only a very small portion of the code to create this plugin.

Instructions

1. Download the plugin:

blackliststats.zip

Membership required, please sign-in or register:

2. Upload the "blackliststats.pl" file to the plugins directory in your MT installation.

3. Begin using the template tags described below

Template Tags

MTBlacklistStats - A container tag used for displaying statistics about your blacklist activity. The tags below must be used within an MTBlacklistStats container.

arguments:

days: to include blocks from only the last n days (e.g. <MTBlacklistStats days="7">)
lastn: to include n searches in the list (e.g. <MTBlacklistStats lastn="5">)
unique: to include only the latest instance of a particular blacklist entry (e.g. <MTBlacklistStats unique="1">)
rank: orders the blacklist entries by rank, the most common being the first (e.g. <MTBlacklistStats rank="1">), implies unique

MTBlacklistValue - The blacklist entry that caused the comment/trackback to be blocked (ie. viagra.com).

MTBlacklistDate - The date that the comment was blocked. This tag takes a "format" argument, which works the same as MT Date formats.

MTBlacklistIP - The IP address of the person (or server) of the blocked comment/trackback.

MTBlacklistBlog - The name of the blog on which the blog occured. This is useful if you have more than one blog.

MTBlacklistType - The type of block: 'comment' or 'trackback'

MTBlacklistRank - The rank of the blacklist entry. For example, the blacklist entry that resulted in the highest number of blocks would be ranked #1.

MTBlacklistTotal - The total number of blocks for a blacklist entry. For example if 5 comments were blocked containing "viagra.com", this tag would have a value of 5.

Also included in the zip file is a sample template. The template creates two tables:

Blacklist Stats - lists each block by date, most recent listed first.

Rankings - lists each blacklist entry, ranked from the most blocks to the least.

You may need to adjust the stylesheet and image paths. I used the stylesheet used by the MT admin interface.

Notes:

1. If you want keep your stats private, be sure to build the stats file in a protected area.

2. It may be a good idea to uncheck "Rebuild this template automatically..." and just manually rebuild the stats from time to time (especially if you have a large activity log).

3. The plugin pulls data from the activity log. If you reset the activity log, your BlacklistStats will also be reset.