SCode Manual

Installation

  1. Extract the distribution and preserve the directories. The directories that have been extracted correspond to the directories in your Movable Type installation. Upload these directories to your Movable Type installation such that file structure looks like so:

    MT_DIR/
    |__ plugins/
    |  \__ SCode/
    |     |__ SCode.pl
    |     |__ mt-scode.cgi
    |     \__ lib/
    |        |__ SCode.pm
    |
    |__ php/
    |   \__ plugins/
    |      |__ function.MTSCodeInsert.php
    |      |__ function.MTSecurityCode.php
    |      |__ function.MTSecurityImage.php
    

    If the plugin was successfully installed, you should see something similar to this on the Plugins listing under System Overview.

    SCode Registration

  2. Click the Show Settings link to display settings you must set for SCode before use and you will see the following settings:

    SCode Settings

    • Temp Directory - set an absolute path to a temporary directory. The codes used by SCode will be stored in this directory hence it is preferable that this isn't a public directory (i.e. someone cannot access it by typing in a URL into a web browser). This directory must also be writeable by Movable Type (you will need to chmod this 755 or 777 depending on your server.)

    • Length - set the length of the codes generated by SCode (for example 6 generates a code 6 characters long e.g. ABCDEF)

    • Max Temp Files - this value controls the maximum number of codes generated by SCode. Once SCode hits the limit, it simply cycles through the existing codes.

    • Action - choose the action you would like taken if an incorrect code is entered by a commenter.

[ADSENSE]

Usage

  1. First you will need to add the SCode fields into your comment form. To do this add <MTSCodeInsert> in all your comment forms (typically these are in the Individual Entry Archive, Comment Listing and Comment Preview templates). <MTSCodeInsert> automatically generates all SCode fields. However, if you would like more flexibility, you can use the following code instead of <MTSCodeInsert>:

    <label for="scode">Security Code:</label><br />
    <input type="hidden" id="code" name="code" value="<$MTSecurityCode$>" />
    <img border="0" src="<$MTCGIPath$><$MTSecurityImage$>?code=<$MTSecurityCode$>"><br />
    <input id="scode" name="scode" />
    

    The best place to add the tag is right after the comment form's textarea as shown below::

    <p id="comments-open-text">
       <label for="comment-text">Comments: <MTIfAllowCommentHTML>(you may use HTML tags for style)</MTIfAllowCommentHTML></label>
       <textarea id="comment-text" name="text" rows="10" cols="30"></textarea>
    </p>
    
  2. Next you will need to enable SCode checking on the blog. To do so, click Settings on the left hand menu and then click the Plugins tab. Click Show Settings for SCode and check the box that appears

    SCode Settings

  3. Finally, if you are using static publishing, rebuild the templates that you've updated.

[ADSENSE]

About

This is part of the official user manual for SCode, a plugin for Movable Type by Arvind Satyanarayan.

More Information »

I Heart Melody