SCode Manual
Installation
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.phpIf the plugin was successfully installed, you should see something similar to this on the
Pluginslisting underSystem Overview.
Click the
Show Settingslink to display settings you must set for SCode before use and you will see the following 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
755or777depending on your server.)Length - set the length of the codes generated by SCode (for example
6generates 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
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 theIndividual Entry Archive,Comment ListingandComment Previewtemplates).<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
textareaas 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>Next you will need to enable SCode checking on the blog. To do so, click
Settingson the left hand menu and then click thePluginstab. ClickShow SettingsforSCodeand check the box that appears
Finally, if you are using static publishing, rebuild the templates that you've updated.
[ADSENSE]

Leave a comment