Install MT-Approval

  • Download the MT-Approval distribution archive.
  • Navigate to the Movable Type home directory.
  • Unpack the distribution archive, keeping the directory structure intact.
  • Your archive should contain these files:
    • MT_HOME/plugins/Approval/mtplugin.pkg
    • MT_HOME/plugins/Approval/Approval.html
    • MT_HOME/plugins/Approval/Approval.pl
    • MT_HOME/plugins/Approval/lib/Approval/App.pm
    • MT_HOME/plugins/Approval/lib/Approval/Plugin.pm
  • That's it - MT-Approval is installed!

Upgrading MT-Approval

If you are upgrading from a prior version of MT-Approval, you should be absolutely sure to remove all prior versions. This is especially the case with V2, because changes to Movable Type mean that some pieces of MT-Approval have changed location as well. Here is a brief list of things to look for. If you find them, remove them, just to make sure that they won't cause any problems down the road. Once they are gone, put the new distrubtion into place.

    • Remove any of these files and directories if you find them:
    • MT_HOME/Approval.pl
    • MT_HOME/mt-approval.cgi
    • MT_HOME/mt-approval.txt
    • MT_HOME/extlib/jayseae/approval.pm
    • MT_HOME/tmpl/cms/approval.tmpl

These are leftovers from places that the plugin used to be installed. To insure that you get a clean installation, you should also completely remove the entire Approval directory, and simply re-upload it. This way you will be sure that all the files are being replaced with the new versions. Since just about every piece of the plugin was updated in this release to address the new release of Movable Type, this is highly suggested. Otherwise you might end up with pieces that are not updated.

That's it. Really. Everything else will take care of itself - just as long as you have the correct pieces in the correct place, you're good to go.

MT-Approval Settings: System

After the installation completes, you may wish to visit the settings for the plugin. To set all the blogs on the system to the same value, change the settings at the system level. To change settings for an individual blog, change the settings on that blog. Once set at the blog level, the system level settings may be reapplied by selecting to reset the settings (though your changes will be lost).

To update the system settings, go to the System Settings page (System Overview -> Plugins -> MT-Approval -> Settings). For the blog level settings, go to Blog Preferences -> Plugins -> MT-Approval -> Settings. The pages look identical except for their color, however the blog-level settings have one additional feature: The ability to install the Comment Spam JavaScript template. More on this in a minute, after we talk about the other settings.

MT-Approval Settings: Approval Beacon

At the top of the settings screen you have a field that allows you to set the name of the Static Beacon. This is a hidden field that is added to your comment form. The value of the field is checked when the form is submitted. If you want to change the name of the beacon, enter that name here. If you change the name, you'll need to rebuild your templates.

Whether you change the name of the beacon or not, you should decide what to do if the beacon isn't found on the comment submission. Since this is a static beacon - that is, it is generated by Movable Type and not by JavaScript, there should be no reason that this beacon isn't found. The only time it won't be on a comment is if the comment comes from an invalid submission - for instance, if some automated spammer submits a comment directly to your comment script, and that's a bad thing.

You can also choose to encrypt the value of the beacon. This simply adds another layer of complexity to your system, which makes it harder for an automated posting to happen by encrypting the beacon with a value that isn't likely to be known by a robot. It's not difficult to guess this value, but it just makes it that much harder to guess an adds another layer of protection.

Just below the name of the beacon you get to decide how to handle this situation. You can set the value to Off, in which case a missing beacon is ignored entirely. If you set the value to Moderate, then the comment is moderated. For a missing beacon, neither of these values is suggested, however, because you should always have a beacon. You should either Discard comments (don't accept them at all) or Junk them. If you choose to Junk comments, you can adjust the weight of the junking, and you may want to assign a heavy weight to this condition, since it should never happen.

MT-Approval Settings: Approval Challenge

One of the most popular features of the Comment Challenge plugin was the simple text-based question that asked users to enter a word prior to submitting their comment. Unfortunately, since the Comment Challenge plugin has not yet been updated for MT4, the feature doesn't quite work as yet. So I added it to MT-Approval.

You will need to specify the Challenge - which should be something that tells people what they need to enter - and a Response - which should be the value that they are going to have to actually enter on the screen. The Response value is not case-sensitive, so you don't need to worry about that. But you may want to keep it short.

Once you have entered your Challenge and Response, you have the same choice of what to do if they are missing. Only in this case, the action applies if the Response is wrong as well. Again, you can set the action Off, you can Discard the comment, Moderate the comment or Junk the comment. As before, if you Junk the comment, you can choose the weight that applies.

MT-Approval Settings: Load Date and Save Date

If you're feeling a little adventurous, and don't mind using a bit of JavaScript, then you can implement the Load Date and Save Date. These are also beacons of sorts, but since they actually are set when certain activities happen, and not when the pages are built, they require JavaScript. This means that users without JavaScript - or automated posters without JavaScript - will be out of luck.

As with the Static Beacon above, you can set the name for these beacons here. You will also need to set the name for the JavaScript Template below, and you will need to make sure that you have built that template, or the value will not be created correctly.

Again you will have the option of determining what to do if there is no value here - Off, Discard, Moderate or Junk, and as before, if you Junk the comment, you can choose the weight that applies. You can also set the actions for each value - so if you want to do one thing for the Load Date and another for the Save Date, you can do so!

MT-Approval Settings: Timestamp

Now that you have the Load Date and Save Date, you can really have some fun. Because your average person - that is, a real live person - is going to take at least a few seconds to fill in your comment form, make sure that they do so. Since we know when they loaded the page, and we know when they submitted the page, we can check to see how long it took them to fill it out. Most automated postings won't take any time at all - that's why they do what they do, after all: Because they can and because it doesn't take any time to do it. If they have to slow down, it gets more expensive to them.

Here you can tell the plugin just how long you think that it should take for a real, live human being to post a comment. The value is in seconds, and while it may seem like 15 seconds is a short time for a default, keep two things in mind. First, it's your site, so you can set it to whatever you want. Second, this numbr applies to the preview as well - so it's not just for the regular comment form!

Just like we have done before, you'll now have the option to set the action to take if the threshold you set isn't met - Off, Discard, Moderate or Junk, and as before, if you Junk the comment, you can choose the weight that applies.

MT-Approval Settings: JavaScript and Message Templates

If you are going to use any JavaScript, whether it is the redirection or the fields that require it, you will need to specify the JavaScript Template name here. Lucky for you that if you are on the blog settings screen, this gives you a drop-down list of all your index templates and you can just choose the one you want. It doesn't get much easier than that. If you are on the system settings screen, you can type in the name of your default template so that your blogs will get the right value by default.

The Message Template is used to send a message to folks who don't have JavaScript, and while you don't have to use it, it is considered good form - just in case someone wanders by and doesn't have JavaScript turned on, but they would like to leave a comment. This tells them how to do so. Again, on the blog settings screen you'll have a drop-down list of all your index templates and the system settings will allow you to type in a default name.

MT-Approval Settings: Blog

On the blog-level settings, you have the option of installing the Comment Spam JavaScript template that ships with MT-Approval. You do not have to use this option, and you can install it manually by cutting and pasting this text:

function getByID(n, d) {
    if (!d) d = document;
    if (d.getElementById)
        return d.getElementById(n);
    else if (d.all)
        return d.all[n];
}

function setDate (id) {
    var f = getByID(id);
    f.value = new Date().getTime()/1000.0;
    return true;
}

// set comment form action
document.comments_form.action = "<$MTCGIPath$><$MTCommentScript$>";

After installing the template - either via the link or by cutting and pasting, make sure that you set the template name by choosing from the drop-down menu. It doesn't matter what you call it - so long as you choose the name from the list and save your settings (this is the JavaScript Template). This allows the plugin to fill in that informaion correctly. If this is not correct, the rest of the plugin will not work and you may not be able to receive comments at all!

Once you have installed the Comment Spam JavaScript template, you need to create another template that will provide a message to users who do not have JavaScript installed. A good starting point for this is likely the Comment Response template, but you can make it anything you like. The contents should be something like:

You are seeing this error because your browser does not support JavaScript, or because JavaScript is not currently enabled. If your browser supports JavaScript, simply turn it back on and you will be able to comment normally. We are sorry for any inconvenience this may cause.

This should go into an index template, and once saved, you should also select this template from the drop-down list (this is the Message Template). Unlike with the JavaScript Template, if you choose the wrong name here, it won't break anything, but someone who would like to leave a comment - and who should be able to - and gets the wrong template - may not be able to figure out the problem. So you should try and set it correctly.

At this point, the plugin settings are complete, and you are ready to proceed with adding the necessary tags into your templates. Head to the manual to make everything work.