Comment Registration is a plugin for Movable Type that enables readers to register an account on your site and login to post comments. Commenters register and login directly with your site, not via an external authentication service (this plugin does not use TypeKey).

UPDATE: The latest version of this plugin, version 1.2, includes an important security bug fix. It is highly recommended that sites using previous versions upgrade to version 1.2 immediately. Simply upload the new version to upgrade -- there is no need to edit or re-install templates.

Movable Type supports comment registration (authentication), but commenters must register and sign via TypeKey, a centralized authentication service offered by Six Apart (the makers of MT). While this "remote authentication" approach has some key advantages, there are also reasons why you might prefer a "local authentication" system. The Comment Registration plugin provides this option.

Comment Registration works with the built-in Commenter system of MT (see the "Commenters" menu item on the left-hand navigation menu). When someone creates a commenter account on your site and posts a comment, they will appear on the Commenters screen, including their Nickname, username, URL, email, and a tally of their comments:

Note: Commenters must post at least one comment before they appear on the Commenters listing. If someone creates an account but does not post a comment, they will not appear in the listing.

Because the plugin uses the the built-in Commenters system, you can use all the MT commenter features, such as:

  • Trusting and Banning commenters:
  • Settings for accepting comments:
  • Settings for publishing comments:

Comment Registration comes with 4 default templates (based on the default MT3.3 templates):

Commenter Login - An index template that contains a login form for commenters.
Commenter Registration - And index template that contains a form for creating a commenter account on your system.
Site Javascript - This is a replacement index template for the existing Site Javascript (mt-site.js) template. (Your existing Site Javascript will be renamed as a backup during installation).
Widget: Commenter Login - A Widget Manager widget that you can add to your sidebar, containing a login form for commenters.

Test it Out Now

Head over to the MT Hacks Test Blog and register for an account and then submit a few comments. Start at this test entry by clicking here.

Installation:

  1. Extract the files from the zip file, and upload the contents of the 'plugins' directory to the 'plugins' directory of your MT installation.
  2. Change the permissions on the mt-login.cgi file to 755 (CHMOD 755).
  3. Browse to the blog you want, then go to Settings - Plugins, and then the Settings button for Comment Registration. You will notice that the plugin has no settings of its own, but you will find a link to install the default templates. Click that link. The default templates will be installed and rebuilt.
  4. You must have Authentication enabled for the default templates to work (if you currently allow TypeKey authentication, you can skip this step). Go Settings > Feedback and find the "Authentication status" setting. In field after "Or, manually enter token", enter some text (anything will do).
  5. (Optional) Adjust the Feedback settings for accepting and publishing comments (see images above) as desired.
  6. Save Feedback settings and then manually rebuild the Site Javascript (mt-site.js) index template.

Requirements

  • MT 3.3x

Note that this plugin does not work with MT4, as this plugin's features have be built-in to MT4.

Get Comment Registration

Comment Registration is free for personal use, but you must place a link on your site, such as:

Powered by the <a href="http://mt-hacks.com/commentregistration.html">Comment Registration</a> plugin for Movable Type.

Donations are appreciated:

Download
Download Now
Downloads: 295

Membership required, please sign-in or register:

Commercial License (up to 5 blogs) - $97

Blog Network License (unlimited blogs) - $249

Note for multi-blog installations / blog networks: commenters need only create one account and can use the same login for all of the sites on the same MT installation.

As always, comments and feedback are appreciated. Please reply to this entry.

Fast Search is a PHP plugin for Movable Type. This means that Fast Search uses Movable Type's dynamic PHP-based publishing system to display search results. However, you can continue to use static publishing for all of your indexes and archives. Fast Search is fast in part because it uses mySQL fulltext indexing -- basically this means that a search index will be created for the entries in your database, making searches much faster. Like the built-in search, Fast Search logs searches to the Movable Type Activity log.

Update 3/11/2007:Version 2.02 has been released. This is a critical update for those who installed 2.0 prior to March 10, 2007. Inadvertently, the old version of the MTSearchString tag was included in that zip file. Version 2.02 has the correct version of that tag. Note: if you don't plan on using Tag Search, then you don't really need 2.02.
Update 3/14/2007:Version 2.03 has been released. This version addresses a Unknown column 'mt_entry.entry_id' in 'on clause' error that affected people running mySQL 5+. (A big thanks to David Chiu for providing the fix!)

New Features in Version 2.0

Fast Search v2.0 has several new features:

  • Tag Search. Fast Search now supports Tag Search (MT3.3+). Also known as a tag listing, Tag Search displays a list of entries with a specific tag. If you list tags in your entries, they are probably linked to a Tag Search. Fast Search v2.0 does the same thing, only faster.
  • Better Relevance Ranking. Fulltext searches now provide much better relevance ranking.
  • Easier System-wide Searching. Now it is even easier to to search all blogs in a single search.
  • Search results containing all keywords. This is a small change for Fulltext searches. Previously, if you searched for 'red books' (without quotes), the search results would include any entry containing 'red' or 'books'. In version 2.0, only entries with both 'red' and 'books' will be included in the search results. This makes things more consistent with other search engines.
  • Fast Search Widget. A new Fast Search Widget makes it easy to add a Fast Search form to your sidebar.
  • New Template Tags. Several new template tags make it easier to customize your search results. Fast Search now supports all of the template tags used in the default MT 3.3 search results template -- this means it is even easier to switch to Fast Search

Tag Searches with Fast Search

Fast Search now supports tag search. A tag search will display a list of all entries with a specific tag. Of course, tag searches have the same pagination features as regular searches, enabling you to browse multiple pages of tag search results. Tag search results are always sorted with the most recent entries listed first. Tag searches can done on a single blog (default), or across multiple blogs.

Tag Search Links. If you are using tags with MT 3.3+, you are probably displaying a list of tags with each entry. Each of those tags are linked to a search results page that displays all the entries with that tag. Since those links point to the built-in mt-search.cgi script -- Fast Search includes a new version of the <MTTagSearchLink> tag that points to the Fast Search script. This happens automatically, you don't have to edit your templates -- just enable Fast Search, install the Fast Search template, then rebuild your pages -- the tag links will be automatically updated.

Clean Tag Search URLs

With Fast Search 2.0, it is possible to use nice looking tag search URLs such as:

http://mt-hacks.com/tag/spam
http://mt-hacks.com/tag/comments

This feature requires editing you .htaccess file and a minor edit to the Dynamic Bootstrapping template. This feature is only available to those who purchase a license or those personal users who donate at least $33. I will email you the required files and full instructions.

Better Relevancy

By tweaking the fulltext queries, I have managed to improve the relevancy ranking significantly. To test this out, you should do a few searches (in fulltext mode) before you upgrade to Fast Search 2.0 -- note the results and their relevancy -- then upgrade and do the same searches. You should see much more relevant results at the top of the search results. Please post your feedback on this by replying to this entry.

Search all Blogs Easier

In the previous version of Fast Search, it was possible to search across all blogs on a system, but you had to specify each of them separated by commas. This is fine if you have a few blogs, but what if you have 50? 100? 500? Version 2.0 makes this easier by allowing the special "all" keyword to indicate that you want to search all blogs (example <MTSearchResults blogs="all"> or in the URL/form: ?query=books&blogs=all). A time-saver for large MT installations and blog networks.

Include PHP in your Search Results Template

This not a new feature, but it deserves highlighting. Many sites use PHP on most of their pages for various reasons (for example, to include content such as headers/footer and advertising blocks). The problem is that you can't use PHP on the "built-in" search results pages, because they are dislayed by a (Perl) CGI script. This can make it challenging to maintain your site in a consistent manner. You can avoid such problem with Fast Search -- since it is powered by PHP, you can include blocks of PHP code in the search results template. (Note: there is a small requirement that you need to use <?php to start each block, using simply <? won't work.)

What Search Method is Best?

For most cases, "Fulltext" will be the fastest search method. This is the same method used in version 1.0. There are some cases in which you might two options:

  • Non-Fulltext. Technically speaking this method used a LIKE %query% syntax. If you don't know what that means, don't worry about, just read on.
  • Fallback. The Fallback method is a combination method. FastSearch will first try a fulltext search, and if that returns no results, then it will try a Non-Fulltext search.

Non-Fulltext and Fallback are capable of some types of searches that you can't do with mySQL. You might want to use Non-Fulltext or Fallback to:

  1. search multi-byte languages such as Arabic and Japanese.
  2. search words shorter than 3 characters (such as "MTV")
  3. search partial words
  4. search a mySQL database that does not support Fulltext searching

Template Tags

Version 2.0 of FastSearch is designed to easily replace the existing search functionality in Movable Type, but with added features. For example, if you are currently using customized search templates, you can use them with Fast Search, with very few changes in most cases. Many Fast Search template tags have the same names as their CGI counterparts:

  • <MTSearchString> - The search string (query) being searched.
  • <MTSearchResults> - A container tag that displays search results. Arguments include (all are optional):
    • lastn - restricts the search to n results. (example <MTSearchResults lastn="10"> ) The lastn argument, like all arguments for MTSearchResults, can also be specified in the URL (...&lastn=10) or POSTed from a search form)
    • offset - used in coordination with lastn, starts M entries from the start of the list. (example <MTSearchResults lastn="10" offset="10"> will display results 11-20)
    • order - must be either 'date' or 'relevance', the default is 'relevance'. (example $lt;MTSearchResults order="date"> will provide similar results as the CGI search)
    • category - must be a valid category ID for the current blog - restricts the search results to entries from this category.
    • google_highlight - if specified, search words will be highlighted. (example <MTSearchResults google_highlight="1"> )
    • query - the search string (text) to be searched. In normal use, you would NOT include this argument as part of the <MTSearchResults> tag, rather, it would be specified as a URL paramter (example ...query=search+phrase) or POSTed from a search form.
    • new - tag - the tag to be searched. In normal use, you would NOT include this argument as part of the <MTSearchResults> tag, rather, it would be include as a URL parameter (example ...tag=books) as part of a Tag Search Link.
    • blogs - a comma-separated list of blog_ids if you want to search more than one blog. This argument is optional, if excluded, only the current blog will be searched. Example usage: <MTSearchResults blogs="1,3,8">new - Set blogs equal to "all" to search every blog on the sytem.
  • <MTBlogResultHeader> - this is container tag that displays content before the search results.
  • <MTBlogResultFooter> - this is container tag that displays content below the search results.
  • <MTNoSearchResults> - A container tag that displays its content only if zero results are found. Note that this tag must be used after a <MTSearchResults> container.
  • <MTNoSearch> - A container conditional tag that displays its content only if no search phrase was specified. new - Now supports the use of <MTElse> inside this container.
  • <MTSearchCount> - The number of search results displayed on the current search results page. This tag should be used with a <MTBlogResultHeader> or <MTBlogResultFooter> container.
  • <MTSearchFirst> - The number of the first search result on the current page. This tag should be used with a <MTBlogResultHeader> or <MTBlogResultFooter>container.
  • <MTSearchLast> - The number of the last search result on the current page. This tag should be used with a <MTBlogResultHeader> or <MTBlogResultFooter>container.
  • <MTSearchIfNextPage> - A conditional tag that displays its content if there is a subsequent page of search results. This tag should be used with a <MTBlogResultHeader> or <MTBlogResultFooter>container.
  • <MTSearchNextPageLink> - Output a URL to the next page of search results. This tag should be used within <MTSearchIfNextPage> tags.
  • new - <MTSearchIfPreviousPage> - A conditional tag that displays its content if there is a previous page of search results. This tag should be used with a <MTBlogResultHeader> or <MTBlogResultFooter>container.
  • new - <MTSearchPreviousPageLink> - Output a URL to the previous page of search results. This tag should be used within <MTSearchIfNextPage> tags.
  • <MTSearchTotalResults> - The total number of matching results in the database.
  • <MTSearchPages> - A container tag that can display links to multiple pages of search results. Optional arguments include:
    • max - the maximum number of page links to display on each page. Example: <MTSearchPages max="20">
    • glue - a text string that seperates each page. For example, if you wanted to display 1 - 2 - 3 - 4, you could use <MTSearchPages glue=" - ">
  • <MTSearchPageNumber> - Displays the page number of each search results page. This must be used within a <MTSearchPages> container.
  • <MTSearchPageLink> - Displays the URL to each search results page. This must be used within a <MTSearchPages> container.
  • <MTSearchIfCurrentPage> - A conditional tag that only displays its contents if the page number is the same as the current page - you would normally use this is you wanted to highlight the current page in the list of page numbers, etc. This must be used within a <MTSearchPages> container.
  • new - <MTIfStraightSearch> - A conditional tag that only displays its contents if the search is a normal search and not a tag search.
  • new - <MTIfTagSearch> - A conditional tag that only displays its contents if the search is a tag search and not a normal search.
  • new - <MTFastSearchScript> - This tag displays the filename of your Fast Search script. You can use this in your search forms as shown below. Note: for this tag to work, you should not rename your Fast Search template -- it should laways be named "Fast Search". This tag works in both static and dynamic templates.
  • replacement - <MTTagSearchLink> - This tag overrides the built-in tag of the same name (this automatic, not need to edit templates or anything). The new version of the tag is "smart" -- if Fast Search is enabled for a blog, it will link to the tag search results using the Fast Search script -- if not, it will use the built-in search script. This tag has the following optional argument:
    • tag_dir - Use this argument to specify a "directory" name for your tag search URLs. Note: This feature is only available to personal users who make a donation OR those who buy a commercial license.

Note: the new default Fast Search template includes pre-formatted template code that displays Google-style search results page links.

As you may have noticed, some of the tags above are identical to the ones used for the existing CGI-based search results. This is by design, so you will easily be able to cut-and-paste your existing search template code into the Fast Search template, though some minor modifications may be required.

Working Examples:

Here are some working examples you can try. Feel free to try additional search queries and note the speed that searches are performed.

  • Tag search results on MT Hacks. Example tags: spam cms.
  • Mars Rover Blog has over 5,000 entries. Example search: "water on mars". Note that this example shows the default FastSearch template, which is very similar to the default search results template in MT 3.2.
  • Seinfeld Blog has over 8,000 entries, 180 of which consist of the episode descriptions and scripts of all 180 episodes. Fast Search powers the Seinfeld Script Search, which is restricted to a single category containing the episodes. Example search: 'bubble boy'

Requirements:

  • Movable Type 3.2 or 3.3
  • mySQL

Instructions

  1. Download the plugin and expand the zip file.
  2. Upload the contents of the 'plugins' folder to the 'plugins' directory of your MT installation (usually something like /cgi-bin/mt/plugins).
  3. Upload the contents of the 'php' folder to the 'php' directory (usually something like /cgi-bin/mt/php)
  4. Login to the MT admin interface. If you already logged in, choose 'Main Menu'
  5. If your are running MT 3.3, you should be redirected to an 'Upgrade' screen at this point. The Fast Search upgrade process will update your database to add a fulltext index to the table in your database where entries are stored. Note that this may take some time if you have many entries, and this will add to the overall size of your database.
  6. If you are running MT 3.2, you will not see the upgrade screen (as it is a 3.3 feature), so you need to create the index by browsing to the 'Settings' of a blog where you want to use Fats Search. Choose the 'Plugins' tab then find 'Fast Search' and choose 'Settings'. Now click the link in bold that says "Click here to create or rebuild the FastSearch fulltext index". Again, this may take some time, please be patient. After the index has been created, hit the Back button.
  7. Now browse to the 'Publishing' settings tab for the blog, and scroll down to the Setting called "Dynamic Publishing". If the first option, "Build all templates statically", is selected, you should change this setting to "Set each template's Build Options separately" and click "Save Changes" at the bottom of the screen. Otherwise, you don't need to make any changes here.(Note that change this setting will create an .htaccess file in the root path of the blog. Normally you won't notice this and everything will work fine, but if you have an existing.htacces file, you may want to take a look at it to make sure everything looks okay)
  8. If you just changed your Dynamic Publishing settings in the previous step, you should now rebuild all files for this blog by choosing "Rebuild Site" from the left menu, then "Rebuild all Files". You should also ensure that you have a "Dynamic Site Bootstrapper" (mtview.php) index template and make sure that it gets built, if it hasn't been built previously.
  9. Now return to the Fast Search settings ('Plugins' tab within 'Settings') and check the box to enable Fast Search. You may also want to adjust the settings for Maximum Search Results and logging, then click "Save Changes".
  10. Open the Fast Search settings once again and choose "Click here to install the default Fast Search Template." The template will be created and then displayed. This is an dynamic Index template (which can be customized) used to display the search results. (If desired you can also skip this step and create the index template manually, use the template tags as desired, or by cutting and pasting your exisiting search template code)
  11. Upgrading Fast Search

    Follow steps 1 to 3 above, then adjust your Fast Search plugin settings and search template, if desired. If you using Tag Search, you probably want to update your Fast Search template. One way to do this is to rename or delete your existing template, then reinstall the new default template from the plugin settings area.

The Search Form

If you already have search forms on your blog pages, you need to update them to point to the new Fast Search template. For each template that contains a search form, look for the following (or similar):

<form method="post" action="<$MTCGIPath$><$MTSearchScript$>"

...and change it to:

<form method="post" action="<$MTBlogURL><$MTFastSearchScript>"

...save the template and repeat this step for every template that has a search form.

If you want to insert a new search form on your site, or completely replace existing forms, you can use the following:

<form method="get" action="<$MTBlogURL$><$MTFastSearchScript>">
    <label for="query" accesskey="4">Search this blog:</label><br />
    <input id="query" name="query" size="20" />
    <input type="submit" value="Search" />
</form>

Or better yet, install the new Fast Search Widget from the plugin settings area, and use WidgetManager to add the widget to your sidebar (you should also remove the existing search widget).

Of course you can also add optional fields to the form such as:

<input type="hidden" name="order" value="date" />

....to sort the results by date, or....

<input type="hidden" name="category" value="5" />

...to restrict the search to category_id = 5.

Once you have the search form(s) on you site, rebuild those pages and start searching. You should notice significant speed and resource improvement, especially on blogs with many entries.

Fast Search Settings

Fast Search settings are on a "per blog" basis. To access the settings, browse to the blog you want to use, then choose "Settings", then "Plugins". Look for Fast Search in the list and click the "Show Settings" button.

Download Fast Search

Non-commercial use - FREE ( although you must include a

Movable Type search results powered by 
<a href="http://mt-hacks.com/fastsearch.html">Fast Search</a>
link on your search results pages.

Also, donations are appreciated. Those who donate at least $33 will receive the BONUS "clean tag URLs" feature described above:

Commercial use - (up to 5 blogs) - $97.00

Blog Network License - (more than 5 blogs) - $249.00

Download Now

Download Now
Downloads: 4745 (since 3/6/07)

Membership required, please sign-in or register:

As always, suggestions and feedback are appreciated. Please reply to this entry.

Note: FastSearch v2.0 is a suitable replacement for most implementations of the built-in search function in Movable Type. However, there are a few features that Fast Search v2.0 does not include. Fast Search v2.0 does not support comment searches, regexp search, case-senstive search, the use of AND and OR operators, and Edit Entry Links). Some of these features may be supported in future versions -- please let me know what features you would like to see.

Comment Registration is a plugin for Movable Type that enables readers to register an account on your site and login to post comments. Commenters register and login directly with your site, not via an external authentication service (this plugin does not use TypeKey).

Movable Type supports comment registration (authentication), but commenters must register and sign via TypeKey, a centralized authentication service offered by Six Apart (the makers of MT). While this "remote authentication" approach has some key advantages, there are also reasons why you might prefer a "local authentication" system. The Comment Registration plugin provides this option.

Comment Registration works with the built-in Commenter system of MT (see the "Commenters" menu item on the left-hand navigation menu). When someone creates a commenter account on your site and posts a comment, they will appear on the Commenters screen, including their Nickname, username, URL, email, and a tally of their comments:

Note: Commenters must post at least one comment before they appear on the Commenters listing. If someone creates an account but does not post a comment, they will not appear in the listing.

Because the plugin uses the the built-in Commenters system, you can use all the MT commenter features, such as:

  • Trusting and Banning commenters:
  • Settings for accepting comments:
  • Settings for publishing comments:

Comment Registration comes with 4 default templates (based on the default MT3.3 templates):

Commenter Login - An index template that contains a login form for commenters.
Commenter Registration - And index template that contains a form for creating a commenter account on your system.
Site Javascript - This is a replacement index template for the existing Site Javascript (mt-site.js) template. (Your existing Site Javascript will be renamed as a backup during installation).
Widget: Commenter Login - A Widget Manager widget that you can add to your sidebar, containing a login form for commenters.

Test it Out Now

Head over to the MT Hacks Test Blog and register for an account and then submit a few comments. Start at this test entry by clicking here.

Installation:

  1. Extract the files from the zip file, and upload the contents of the 'plugins' directory to the 'plugins' directory of your MT installation.
  2. Change the permissions on the mt-login.cgi file to 755 (CHMOD 755).
  3. Browse to the blog you want, then go to Settings - Plugins, and then the Settings button for Comment Registration. You will notice that the plugin has no settings of its own, but you will find a link to install the default templates. Click that link. The default templates will be installed and rebuilt.
  4. You must have Authentication enabled for the default templates to work (if you currently allow TypeKey authentication, you can skip this step). Go Settings > Feedback and find the "Authentication status" setting. In field after "Or, manually enter token", enter some text (anything will do).
  5. (Optional) Adjust the Feedback settings for accepting and publishing comments (see images above) as desired.
  6. Save Feedback settings and then manually rebuild the Site Javascript (mt-site.js) index template.

Get Comment Registration

Comment Registration is free for personal use, but you must place a link on your site, such as:

Powered by the <a href="http://mt-hacks.com/commentregistration.html">Comment Registration</a> plugin for Movable Type.

Donations are appreciated:

Download

Download Now
Downloads: 295

Membership required, please sign-in or register:

Commercial License (up to 5 blogs) - $97

Blog Network License (unlimited blogs) - $249

Note for multi-blog installations / blog networks: commenters need only create one account and can use the same login for all of the sites on the same MT installation.

As always, comments and feedback are appreciated. Please reply to this entry.

Template Inheritance is a plugin for Movable Type that enables you to link templates together in a way that one template inherits its template code from another template. One example is when you have two or more blogs in your MT system, and you want to use the same design or template layout for each blog. Using the Template Inheritance plugin, you can effectively use one blog's templates as master templates that control the templates of the other blogs. So if you have 3 blogs on a company site with same look and feel, this can save you a lot of time manually updating the templates of each blog every time you make a change. Another way to think of it is sharing templates between several blogs. You can link all the templates in one blog to another, or selectively choose which templates should be inherited (including template modules).

I have wanted a plugin like this for years, the ability to share template code between multiple blogs. For a long time, MT has included a "Link this template to a file" feature in which you could link a template to an actual file on your server. I used to link multiple templates to the same file, effectively (and indirectly) sharing the template code between different blogs. While this works, it has its problems. At times in the past, there we MT bugs that prevented templates from being updated from the file - but I think those are fixed now. The other main problem is that you have to be very careful when editing a template, remembering that it may be shared with other blogs, etc. The Template Inheritance plugin is an improvement over the file linking method, addressing the key issues with file-based linking.

Features

For any specific template, you can assign another template on the system from which to inherit template code. For example you could decide that you want template "B" to inherits its template code from template "A".

It may be helpful to think of "A" as the parent template and "B" as the "child" template -- the child inherits its template code from its parent. When template becomes linked to parent template, the child's template code will immediately be replaced by the template code of the parent, and will be derive its template code from the parent from that point forward. You won't be able to edit the child template after the link is made (the template code is greyed-out and the field is disabled) -- instead, you will see a link to the parent template, and you can then edit the parent template.

Editing the parent template will automatically update all of its children templates. Of course, you need to rebuild the appropriate pages on each blog for template changes to be reflected on your blogs. You remove remove inheritance (break the link with the parent) at any time. When you remove inheritance from a child template, it becomes independent from that point forward, and you can now customize it independently of the parent template.

Notes:

  • Only system administrators (sometimes called superusers) can create inheritance links.

  • You must enable the plugin for each blog before you can create inheritance links (blogs to have "child" templates need to be enabled, not those containing the "parent" templates)

  • A template cannot be both a child and a parent. If you try to assign inheritance from a template that is a child of another template, it will work -- but the plugin will make the link directly the ultimate parent. This makes it easier to manage, as you won't have to trace template linkages through several generations to find the "master" template.

  • When a parent template is deleted, each of its children immediately become independent (orphaned, if you will).

  • When first assigning inheritance to a template, the child template's code is replaced by that of the new parent. BE CAREFUL, there is no undo, the child's former template code will be gone. Just to be safe, it may be a good idea to back up the old template code beforehand, in case you decide to revert back.

Requirements

  • MT 3.3+

Great for Blog Networks

While Template Inheritance can be used in many different scenarios, it is a great fit for blog networks. Networks of blogs on the same MT system often have similar (or identical) design or template code. Sometimes only certain things are the same, such as a common header / footer, stylesheet, sidebar, advertising blocks, etc. Using this plugin to link up those common template elements, you can save a lot time managing the templates of the network. If you have a blog network and this sounds interested, please contact me. I can help implement this for you, customize the plugin to meet your specific needs, etc.

Instructions

  1. Extract the contents of the zip file and upload the contents of the 'plugins' directory into the 'plugins' directory of your MT installation
  2. Login to MT (or hit Main Menu, if you are already logged in). You should now see and upgrade screen that will install a table for Template Inheritance.
  3. Browse to the blog you want, then go to the plugin settings to enable the plugin.
  4. Browse to the template you want, then click the "Click here to inherit code from another template" link.
  5. Enter the template ID of the desired parent in the prompt box, hit OK.
  6. The template is now linked to the parent. Rebuild to see the results on your site.

Get Template Inheritance

Template Inheritance is free for personal use on up to 3 blogs.

Donations are appreciated:

Download Now

Download Now
Downloads: 166

Membership required, please sign-in or register:

Commercial License (4-10 blogs): $97

Blog Network License (10+ blogs): $249

As always, feedback and suggestions are appreciated. Please reply to this entry.

Spam Firewall v1.2 is now available. Version 1.2 has two changes:

  • An updated "top 40" list of firewall rules
  • A bug fix that should address the "blank page" problem that some people experienced from time-to-time. If you still have this problem with version 1.2, please let me know.

Download Now

Download Now
Downloads: 266 (since 2/21/07)

Membership required, please sign-in or register:

About Spam Firewall

Spam Firewall is a plugin for Movable Type that can help reduce this load. The goal of Spam Firewall is to block 80% of spam attempts before they reach MT's comment and trackback scripts. As the name suggests, it acts like a firewall protecting your MT scripts.

How Spam Firewall Works

Spam Firewall creates a PHP script that acts as a firewall. Once installed, when comments or trackbacks are posted, they get posted to the PHP firewall script. The firewall script will then scan the the request against a "Top 40" list of common spam patterns. If the request matches, things stop right there. If the request passes the test, it gets forwarded to MT for processing in the normal manner. Most spam is blocked quickly, without consuming large amounts of CPU and memory.

The Top 40 List

The key to Spam Firewall is a "Top 40" list of common spam patterns. The 40 spam patterns (rules) released today represent 80% of the spam that I have received in the past 8 days. Of a total of 14,405 spam attempts, this Top 40 list matches 11,541 of them (80.1%). The list is based on real spam attempts from the past week. I plan on updating the Top 40 list regularly.

Requirements:

  • MT 3.2+
  • PHP (Note: you do not need to enable MT's dynamic publishing to use Spam Firewall, but your server must support PHP scripts -- most do)

Instructions:

  1. Download the zip file and extract its contents.
  2. Within the main 'Spam Firewall' directory, there are two folders, one names 'plugins' and one named 'php'. Upload both of these folders (including sub folders and files) into the same directory as Movable Type (often /cgi-bin/mt).
  3. Go to 'Settings' on the blog you want to setup, then choose 'Plugins', then choose the 'Settings' link under "Spam Firewall". Then click the "Click here to install the Spam Firewall Template for this blog" link. This will install the Spam Firewall index template and rebuild it. Advanced users can change the Output File name if desired, but you should not change the Name of the template.
  4. (Optional, but highly recommended) Rename your comment and trackback scripts [More Info]. Because Spam Firewall hides the name of these MT scripts, now is a very good time to rename them.
  5. To setup Spam Firewall for comments, you need to change the comments submission form to point to the firewall script. Go to your Individual Archive Template and look for the following:

    action="<$MTCGIPath$><$MTCommentScript$>"

    and replace it with:

    action="<$MTBlogURL$><$MTFirewallCommentScript$>"


  6. To setup Spam Firewall for trackbacks, look for the <$MTEntryTrackbackData$> and replace it with <$MTFirewallTrackbackData$>. Also, look for the <$MTEntryTrackbackLink$> and replace it with <$MTFirewallTrackbackLink$>.

  7. Rebuild all individual archives.

Download Spam Firewall

Non-commercial use - FREE ( In exchange for the free use of this plugin, I ask that you install the MT Plugin Network plugin. Plugin Network will help keep you up to date on the latest version (and rules) of Spam Firewall and other useful plugins. [more info])

Also, donations are appreciated:

Commercial use - $97.00

Download Now

Download Now
Downloads: 266 (since 2/21/07)

Membership required, please sign-in or register:

As always, suggestions and feedback are appreciated. Please reply to this entry.

Blog Janitor is a plugin for Movable Type that preforms various clean-up tasks. In version 1.0, Blog Janitor can perform the following tasks:

  • Close comments on old entries.
  • Delete duplicate comments and trackbacks

Blog Janitor does his work automatically, you don't need to edit your templates. Just tell Blog Janitor the tasks you want him to perform (by adjusting the plugin settings), and he will go to work periodically (using the scheduled tasks feature of MT 3.3+).

Here are some details on his current skills:

Close Comments and Trackbacks on Old Entries

One technique for reducing blog spam is to close comments (disable commenting) and trackbacks on entries that are older than a certain number of days. This can be a tedious process to do manually, if you remember to do it. Blog Janitor can take care of this job for you. Simply enable Close Comments in the plugin settings for a blog, and tell Blog Janitor the number of days he should wait before closing comments on an entry. That's all you have to do, Blog Janitor will routinely check for old entries and close comments on them for you.

Delete Duplicate Comments and Trackbacks

Duplicate comments and trackbacks can happen in a number of ways. For example, a commenter may hit the submit button twice, thinking that the comment did not get posted the first time. Another common occurence is duplicate junk comments and trackbacks -- since spammer often post identical spam messages, your Junk folders may be full of duplicates. Blog Janitor is skilled a scanning your recent comments and trackbacks for duplicates. If you give him the order (by enabling duplicate checking in plugin Settings), he look for recent duplicates and delete them. Just tell him how many recent items to scan, and he will go to work every hour looking for recent duplicates. (Note: there is no "undo" when Blog Janitor deletes items, but he does leave a message in the Activity Log notifying you of which items he has deleted).

Settings

The Settings is where you give Blog Janitor his orders. Go to the blog you want, then choose Settings, then the Plugins tab, and then click on Setting for Blog Janitor. The settings look like this:

Requirements

  • MT 3.3x

Instructions

  1. Download the zip file and expand it.
  2. Upload the contents of the 'plugins' directory in to the 'plugins' directory of you MT installation (usually /cgi-bin/mt/plugins/)
  3. Adjust the settings as described above

Notes:

  • If you have a large number if entries in your blog, Blog Janitor will not close comments on every old entry the first time he goes to work. He gets tired if he tries to close comments on too many entries at a time, and his union contract states that he doesn't have to close comments on more than 100 entries each hour. (Okay, the real reason is to save your MT from excess load that might slow things down) Since Blog Janitor works on up to 100 entries each hour, it may take some time before he gets 'caught up'. For example, if you have 2400 entries on your blog, it will take about 24 hours for Blog Janitor to go through all the old entries and close comments and trackbacks.
  • Blog Janitor punches his time clock when he starts and finishes a task. For each task, he posts a message to the Activity Log that explains what task was completed, and how many seconds it took him to complete. If you are concerned about system load, keep an eye on the Log to see how hard he is working.

Get Blog Janitor

Blog Janitor is free for personal use:

Download Now

Download Now (Blog Janitor for Personal Use)
Downloads: 751

Membership required, please sign-in or register:

Commercial Use: $97

If you buy a commercial license, you will get priority for future features, and an advanced version of Blog Janitor that enables you to give Blog Janitor orders on a system-wide basis (so you can adjust the settings in once place for all blogs on the system).

As always, comments and suggestions are welcome - please reply to this entry.

Add Category is a simple MT Plugin that enables you to select multiple entries and add them to one or more categories at the same time. This can be a timesaver if you want to add a bunch of entries to the same category -- using this plugin you can avoid opening up each entry, adding the category, saving the entry, etc.

This screen snap says it all:

Instructions:

  1. Download the zip file and expand it.
  2. Upload the content of the 'plugins' directory into the 'plugins' directory within your MT install.
  3. Go to an Entry Listing screen for the blog you want.
  4. Select one or more entries by checking the boxes on the left-hand side.
  5. Choose "Add to Categories..." from the drop-down box on the top-right of the entry listing.
  6. Enter the names or category IDs of one or more categories. If you enter more that one category, separate each with commas. Then hit the okay button.
  7. Rebuild the entries.

Notes:

  • If you have more than one category with the same name in the same blog (rare, but it does happen), then you should use category ID numbers to make sure the entries get added to the intended category.
  • If an entry is not assigned to any categories, the plugin will assign the first category you specify as the primary category.
  • If you specify a category that does not exist, the plugin will display an error message. You should create the categories first.
  • This plugin cannot be used to change the primary category.
  • This plugin cannot be used to remove categories from entries (perhaps in a future version).

Get Add Category

Add Category is not free, but you can try before you buy. The license cost is only $7.

Download Now

Download Now
Downloads: 233

Membership required, please sign-in or register:

The Ajax Rating Pro plugin enables you to setup comment threshold viewing for Movable Type powered sites. For more information about Ajax Rating Pro, click here.

This article focuses on ways that you can use Ajax Rating Pro to setup comment thresholds for Movable Type. The concept behind comment threshold is the ability to hide or collapse comments with rating score below a certain threshold. The result is collaborative filter, readers rate each others comments, and higher ranked comments are given more prominence, while lower ranked comments are given less prominence. Popular site such as Slashdot, Digg, and Scoop-powered sites use comment threshold filtering. It is a great tool for popular sites that attract a large number of comments.

Ajax Rating Pro is very flexible and customizable -- you can decide how you want to implement comment threshold filtering. Do you want to completely hide low ranked comments? Merely collapse them? Implement a default threshold score, or let readers choose their own? Something else in mind?

Ajax Rating Pro comes with a few built-in tools to help setup some of the more common approaches to comment thresholds. Let's walk through such an example. First take a look at the test entry here. Feel free to rate some comments and set a person comment threshold - notice how the display changes (refresh the page if needed). I am going go step-by-step to setup comment thresholds in this manner.

In this scenario, reader will rate comment with a vote up or a vote down. Votes are +1 point and votes down are -1 point. The default threshold is -3. In this scenario, comments with a total score of less than -3 will appear in a collapsed state. A single-click reveals the below threshold comment. Reader can optionally choose their own threshold using the form at the bottom of the comment listing.

Step 1 - After you have installed Ajax Rating Pro, go to the plugin settings for the blog you want. Choose Thumbs Up/Down for comment mode and choose 1 for Comment Max Points. Set the default threshold as desired (in this example, we will use -3).

Step 2 - Add a thumb rater to your Individual Archive template, between the <MTComments> and </MTComments> tags. In this example, I added it after the comment date on the default MT 3.3+ template:

<$MTAjaxThumbRater type="comment" report_icon="1"$> Score: <strong><span id="ajaxrating_comment_<MTCommentID>_ttl"><MTAjaxRating></span></strong> (<span id="ajaxrating_comment_<MTCommentID>_cnt"><MTAjaxRating show="vote_count"></span> votes cast)

Then rebuild your individual archives. (Tip: make sure you have the Ajax Rating lines in the <head> section of this template, as described in step 10 here. After rebuilding, each comment should have a thumb rater -- test to make sure the ratings are working.

Step 3 - Now that our readers can rate others' comments, now we can change the display for comments that fall below the threshold. In this example, we will do this using CSS styles to show or hide things. First we want to create add a section to the Individual Archive template, that will display only when comments fall below the threshold. In this example, immediately after </MTCommentsHeader>, enter the following:

<span class="below-threshold" id="threshold-<$MTCommentID$>">
<a href="#" id="c<$MTCommentID pad="1"$>" onclick="showComment(<$MTCommentID$>); return(false);"><$MTCommentBody trim_to="30" strip_linefeeds="1" remove_html="1"$>...</a> (Below threshold)
<p class="comment-footer">
Posted by <$MTCommentAuthorLink default_name="Anonymous"$> <$MTCommentAuthorIdentity$> |
<a href="#comment-<$MTCommentID$>"><$MTCommentDate$></a> | Score: <strong><$MTAjaxRatingTotalScore$></strong>
</p>
</span>

The first and last lines above are very important. This <span> encloses the stuff that we want to display when a comment is below the threshold. We will show and hide this span depending on the score and threshold. Both the class="below-threshold" and id="threshold-<$MTCommentID$>" are required for this purpose.

Inside the the span, you can customize what you want to display when a comment is below threshold. In this example, we have included a link that will display the comment. Notice the onclick argument in the link:

onclick="showComment(<$MTCommentID$>); return(false);"

This onclick section is important, as it will cause the link to run some javascript to display the comment in the browser.

Step 4 - The next step is to include a form that readers can use to set their own threshold. (If you don't want readers to be able to set their own threshold, you can skip this step). Below the </MTComments> tag, enter the following form code:

<form id="threshold-form" name="threshold_form" action="<$MTEntryLink$>#comments" onsubmit="setThreshold(this);">
<input type="text" name="threshold" size="3">
<input type="submit" name="submit" value="Set Comment Score Threshold">
</form>

The important part of this form is the onsubmit="setThreshold(this);" section as this will set the readers threshold by storing in a cookie in their browser.

Step 5 - By default, the section that we added in Step 3 above is hidden from view, and the full comment is displayed. At this point we need to compare the score to the threshold of each comment and decide which comments should be collapsed. Add the following below the form coded added in Step 4:

<script type="text/javascript">
<!--
var comments = new Array(<MTComments>'<$MTCommentID$>',</MTComments>'');
hideComments(comments);
//-->
</script>

The above javascript will check each of the comments. If a comment is below the threshold, the comment will be hidden and the section from Step 3 above will be displayed instead.

Step 6 - Rebuild your individual archives and test it!

The customized individual archive template used in this example on the test entry can be found here.

The above example is only one way to implement comment thresholds on your site using Ajax Rating Pro. You can customize the above to meet your needs. You can even edit the javascript and CSS elements to customize things further.

Another Built-in tool is the <MTIfAjaxRatingBelowThreshold> conditional tag. You can use this tag inside an <MTComments> container. Anything between <MTIfAjaxRatingBelowThreshold> and </MTIfAjaxRatingBelowThreshold> tags will not be inlcuded in the HTML of the page. (Note that the score is checked against the default threshold when the page is rebuilt, or if you are using PHP dynamic publishing, when the page is displayed). For example, if you wanted to completely hide comments below the default threshold, you could do something like this:

<MTComments>
<MTIfAjaxRatingBelowThreshold>

.....comment template code here......

</MTIfAjaxRatingBelowThreshold>
</MTComments>

Note that if you use this tag, you won't be able to provide a link to display the comment like in the example above.

Another way to use this tag might be to apply certain filters to comments below the default threshold. For example you might want to remove HTML from comments below threshold:

<MTIfAjaxRatingBelowThreshold>
<MTCommentBody remove_html="1">
<MTElse>
<MTCommentBody>
</MTIfAjaxRatingBelowThreshold>


I hope that the example above provide a few examples of how you can implement comment threshold viewing, and perhaps inspire a few ideas for unique ways to do so.

To get Ajax Rating Pro, or for more information, click here.

In this article I will cover some of the more advanced features of the Ajax Rating plugin. Ajax Rating is rating plugin for Movable Type that makes it easy for readers to rate entries, comments, and more. If you haven't read about Ajax Rating yet, you should read this first, and then come back to read this article afterwards.

Covered in this article:

Custom images for star and thumb raters
Using custom raters
Dynamically updating numeric ratings and vote counts
Setting up comment raters
Rating non-MT objects

Custom images for star and thumb raters

Whether you are using Ajax Rating or Ajax Rating Pro, you can use alternative images for rating items. For star/point raters, the image must be named "starrating.gif". The image should be a "three state" image. For example, here is the default image that comes with Ajax Rating (design credit to Ryan Masuga):

Note that the image has 3 stars, appearing one on top of the other. As such, the height of the image should be 3 times as long as the width. The default image, above, is 30 pixels wide by 90 pixels high. The star at the top is the "empty star", the star in the middle is the "hover star" (the color of the star when you hover your mouse over it), and the bottom star is the "current rating star". Of course, the images don't have to be "stars" at all -- you could use images of hearts, checkmarks, boxes, or bananas. As an example, Ajax Rating comes with an alternative star image called 'starrating16x16.gif' that looks like this:

Note that this image is 16 pixels wide and (16 times 3 equals) 48 pixels high. if you want to use this image, you can rename it 'starrating.gif'.

After you have the image you want, make sure it is named starrating.gif and then upload into the /mt-static/plugins/AjaxRating/images/ directory on your server.

The final (but important) step is to browse to the Ajax Rating settings for your blog and enter the width on your new image into the "Star Icon Width" field. Save your settings and then rebuild the Ajax Rating javascript and styles index templates. Finally rebuild all your pages with star raters.

To use custom image with Thumb Raters (Pro feature), the process is much easier. The only rule is that you have to name your images "up.gif" (+1 point) and "down.gif" (-1 point). You make them any size that suits your needs. Upload the new images to the /mt-static/plugins/AjaxRating/images/ directory and you are done (no need to rebuild any pages).

Creating Custom Raters

The previous section explains how to customize the look of the raters that appear when you use the convenient <MTAjaxStarRater> and <MTAjaxThumbRater> tags. You are not limited to those raters, however. You can create your own custom raters.

For example, here is a simple rater that consists of a "Vote For This Entry!" text link:

<a href="#" onclick="<$MTAjaxRaterOnclickJS points="1" type="entry"$>">Vote For This Entry!</a>

The above example illustrates the key elements of rating link. Set the href equal to "#" and include an onclick= argument. The special MTAjaxRaterOnclickJS tag helps you fill the javascript required to capture the vote. They key argument here is the "points" argument -- use this to specify how many points get assigned when someone clicks that link.

To expand the above example, here is a 5 point rater using text links instead of images:

<a href="#" onclick="<$MTAjaxRaterOnclickJS points="1" type="entry"$>">1</a> <a href="#" onclick="<$MTAjaxRaterOnclickJS points="2" type="entry"$>">2</a> <a href="#" onclick="<$MTAjaxRaterOnclickJS points="3" type="entry"$>">3</a> <a href="#" onclick="<$MTAjaxRaterOnclickJS points="4" type="entry"$>">4</a> <a href="#" onclick="<$MTAjaxRaterOnclickJS points="5" type="entry"$>">5</a>

Tip: if you want your customer rater to disappear after a vote, surround in a div or span element with an "id" in the following format "thumb{type}{id}", replacing {type} and {id} with the type and id of the object being rated. For example:

<span id="thumbentry105"> ...rater goes here </span>

Dynamically updating numeric ratings and vote counts

Often you will want to display numeric representations of ratings and vote counts on your pages. Consider the following example, which shows box a star rating and the average rating and vote count:

  • Currently 3.9/5
  • 1
  • 2
  • 3
  • 4
  • 5

Rating: 3.9/5 (1201 votes cast)

Notice when you make a rating with the above rater, the average rating and vote count numbers get updated dynamically. The trick to doing that is to surround those numbers in "span" tags. Here the template code for the above example:

<$MTAjaxStarRater type="entry"$>
Rating: <strong><span id="ajaxrating_entry_<$MTEntryID$>_avg"><$MTAjaxRatingAverageScore type="entry"$></span></strong>/<$MTAjaxRatingEntryMax$> (<span id="ajaxrating_entry_<$MTEntryID$>_cnt"><$MTAjaxRatingVoteCount type="entry"$></span> votes cast)

First looking at MTAjaxRatingAverageScore, the "id" of the span must be in the format id="ajaxrating_{type}_{id}_avg". For an entry with an id of 105, that would be id="ajaxrating_entry_105_avg". Using MT template tags in this example, you can do it as follows:

<span id="ajaxrating_entry_<$MTEntryID$>_avg"><$MTAjaxRatingAverageScore type="entry"$></span>

For MTAjaxratingVoteCount, the process is the same, but the id ends in "_cnt" instead of "_avg". So the template code becomes:

<span id="ajaxrating_entry_<$MTEntryID$>_cnt"><$MTAjaxRatingVoteCount type="entry"$></span>

If you wanted to dynamically update MTAjaxRatingTotalScore (not shown in above example), the id should end in "_ttl":

<span id="ajaxrating_entry_<$MTEntryID$>_ttl"><$MTAjaxRatingTotalScore type="entry"$></span>

Setting up comment raters

With Ajax Rating Pro you can rate comments and other objects. Setting up comment raters is similar to entry raters. While you can use star raters or thumb raters, many people will prefer to thumb raters for rating comments, so my example will focus on these.

To add a thumb comment rater, place the following in suitable place in a <MTComments> container:

<MTAjaxThumbRater type="comment">

(Optionally, you could include a report_icon="1" argument to display a third button, that will enable readers to report comments to entry authors)

Rating non-MT objects

With Ajax Rating Pro, you can even create raters for non-MT objects. For example, suppose I have five photos in my sidebar, and I want people to be able to rate them. The rules for rating non-MT objects are as follows:

  • choose a unique "type" of object (don't use the reserved names like 'entry', 'comment', etc.)
  • create a unique numeric id for each specific object you want to rate.

In the sidebar photo example, let's choose the type "sidebarphoto" and give each photo a numberic id from 1 to 5. For the first photo, I would use the following code to display a star rater:

<$MTAjaxStarRater type="sidebarphoto" id="1" max_points="5"$>

...and the second photo would be:

<$MTAjaxStarRater type="sidebarphoto" id="2" max_points="5"$>

... and so on.

Also note that the discussion above about dynamically updating ratings and vote counts also applies to non MT objects -- just be sure to use your chose "type" and "id" values in the span ids.


The features above are just a few advanced ways to use Ajax Rating. To get Ajax Rating, or to learn more, click here.

Look forward to the next article (soon) on Ajax Rating: Setting Comment Threshold Viewing.

Update 2/11/2007: Also see these new articles on Ajax Rating:

Ajax Rating is a plugin for Movable Type that enables visitors to rate your entries or your blog.

Try it now by rating this blog:

  • Currently 3.7/5
  • 1
  • 2
  • 3
  • 4
  • 5

The "Pro" version of Ajax Rating lets you rate comments, trackbacks, categories, authors, tags, and just about anything else. Added features include threshold viewing for comments based on rating, listing "hot" items, and comment reporting. More details on the Pro version below.

Ajax Rating is easy to setup and use. After downloading the plugin and installing the files, a few simple changes to your templates will enable you to adding Ajax Star Raters to your entries. For example, just add <MTAjaxStarRater type="entry"> to after the <MTEntryBody> tag and you are done - instant Ajax Star Ratings.

Download Now

Download Now (Ajax Rating for Personal Use)
Downloads: 6854

Membership required, please sign-in or register:

Ajax Rating Pro

Ajax Rating Pro has a lot more features:

  • Thumbs up /down (or plus/minus) rating modes
  • Display listings of top rated items
  • Rate comments and other objects
  • Hide comments below a certain rating threshold
  • Enable visitors to choose their own threshold
  • Include a button for reporting spam or inappropriate comments
  • Display "hot lists" based on recent voting activity

Digg-like Functionality

The "hot lists" feature mentioned above is one of the most powerful features of Ajax Rating. It can be used to enable Digg-like functionality, in which your home page can be set to display only the items that are "popular now". Used this way, the ratings become a filter for the content you feature on the home page. If you have a site or blog network with new entries be added frequently, this feature is especially useful. In a typical blog-format home page, entries get pushed lower down the page every time a new one is posted, so even popular entries can get pushed off the home page quickly on a busy site. Ajax Ratings gives you an alternative to this, displaying the hottest entries first, as determined by visitor rankings. This is automatic, and you can define the "hot" time frame (1 day, 3 days, 2 weeks, etc.). Ajax Rating hot lists can really change the dynamics of a site, and may inspire ideas for new ratings-driven sites.

Comment Viewing Threshold

Sites like Slashdot, Scoop-powered sites, and Digg have a similar feature, which hides comments if they are below a certain rating or score threshold. Referred to as a comment viewing threshold or a "collaborative filtering tool", the idea is to display top-rated comments prominently, while hiding or collapsing lower rated comments. With the Ajax Rating plugin, it is possible to do this with Movable Type comments. The plugin is very flexible in how you want to set this, but a common approach might be to enable readers to vote each comment "up" or "down" (plus or minus, thumbs up, thumbs down, etc.). A vote up would equal +1 point and a vote down would equal -1 point. You then set a default viewing threshold. For example, you might choose -10 as the default, meaning that comments with a total score of less than -10 will appear collapsed (or partially or completely hidden, you choose). Collapsed comments can be displayed with a single click. You can also include a form that enables readers to set their own threshold level. Again, this is very customizable, you decide how you want things to work on your site. Take a look at this test entry, which demonstrates both a Star Rater (for the entry) and Plus/Minus comment threshold viewing (for the comments). Set your own threshold using the form at the bottom of the comments and see how the display changes. Similar to the hot list described, above comment viewing thresholds are another way to transform the display of your content based on user ratings.

Rate Anything

Another advanced feature is the ability to rate anything at all. In addition to rating MT objects like entries, comments, categories, authors, and blogs, you can also use Ajax Ratings to rate other things. For example, if you want to create a rater for a movie or book, you can do that. (Example: <$MTAjaxStarRater type="movie" id="23" max_points="5$> -- just remember what movie you assigned the ID 23 to....)

One Vote per IP Address

To prevent people from voting multiple times on the same item, only one vote is accepted per IP address per item.

Template Tags

Template tags for Ajax Rating are available for both static and dynamic (php) publishing.

The following template tags are available in Ajax Rating (free version):

  • <MTAjaxStarRater> - This tag will output a star rater like the one shown above. To rate entries, it must be used in an Entry context (ie. between <MTEntries> and </MTEntries> tags or in the Individual Archive Template. A good spot is just after the <MTEntryBody> tag. The following arguments are supported:
    • type - Recommend (but not required) when rating entries and required when rating a blog. (Example: <MTAjaxStarRater type="entry"> or <MTAjaxStarRater type="blog"). With Ajax Rating Pro, you can also specify the following types: comment, category, author, tag, trackback, or anything else (see "rate anything" above).
    • max_points - Not required for entries and comments, but required for other types. This argument specifies the number of stars that will be displayed. (Example: <MTAjaxStarRater type="blog" max_points="5"> will create a rater with 5 stars)
    • id - For advanced use, the id argument enables you specify a specific object ID number that you want to rate. If you use the tag in the correct context, you don't need to include the 'id' argument. But if you want to place a rater outside of the relevant context, or if you want to rate a non-MT object (see "rate anything" above), then you must specify the id of the object. Normally, you don't want to use this, so forget I mentioned it. ;)
  • <MTAjaxRatingTotalScore> - This will display the total score for the item being rated (adding up the values of all of the ratings made).
  • <MTAjaxRatingAverageScore> - This will display the average score for the item being rated.
  • <MTAjaxRatingVoteCount> - This will display the number of votes or ratings that have been submitted for this item.
  • <MTAjaxRatingEntryMax> - This will display the maximum number of points (stars) for rating entries, as specified in the plugin settings for that blog.

With Ajax Rating Pro, the following tags are also available (in addition to those described above):

  • <MTAjaxRatingList> - A general purpose container tag for displaying listings of "top rated" items in the MT database. The following arguments are available:
    • type - Required. Allowed values are: entry, comment, trackback, category, blog, author, tag. Tip: do not pluralize these types.
    • sort_by - Determines which metric is use to rank the results. Allowed value are: average, votes, total. The default is sorting by total score.
    • sort_order - The sort_order defaults to 'descend' (highest rating first), but you could also specify 'ascend' to show the worst rated items first.
    • blogs - To display a list of items from all blogs on the system, specify blogs="all". Otherwise, leave this out and the list will be restricted to the current blog.
    • show_n - Use this argument to specify the number of items you want to list (the default is 10). (Example: <MTAjaxRatingList type="entry" show_n="15">)
    • hot - Set 'hot' equal to 1 to generate a list of recently "hot" items (this is the powerful feature discussed above). When the 'hot' argument is set to 0 or omitted, the listing will be based on "all time" ratings data. Adding hot="1" will based the listing on recent voting activity only.
  • <MTAjaxRatingEntries> - Same as <MTAjaxRatingList type="entry">. Same arguments as MTAjaxRatingList, but the 'type' argument is not required.
  • <MTAjaxRatingComments> - Same as <MTAjaxRatingList type="comment">. Same arguments as MTAjaxRatingList, but the 'type' argument is not required.
  • <MTAjaxRatingPings> - Same as <MTAjaxRatingList type="trackback">. Same arguments as MTAjaxRatingList, but the 'type' argument is not required.
  • <MTAjaxRatingCategories> - Same as <MTAjaxRatingList type="category">. Same arguments as MTAjaxRatingList, but the 'type' argument is not required.
  • <MTAjaxRatingBlogs> - Same as <MTAjaxRatingList type="blog">. Same arguments as MTAjaxRatingList, but the 'type' argument is not required.
  • <MTAjaxRatingAuthors> - Same as <MTAjaxRatingList type="author">. Same arguments as MTAjaxRatingList, but the 'type' argument is not required.
  • <MTAjaxRatingTags> - Same as <MTAjaxRatingList type="tag">. Same arguments as MTAjaxRatingList, but the 'type' argument is not required.
  • <MTAjaxThumbRater> - Instead of a star rater, this tag will display a thumbs up/down (or plus/minus, etc.) rater. With this type of rater, there are images for voting an item "up" or "down". A vote "up" is equal to 1 point, a vote "down" is equal -1 point. The following arguments are available:
    • type - Recommend (but not required when used in an entry or comment context). (Example: <MTAjaxThumbRater type="comment">). The same types can be used as described for <MTAjaxStarRater> above.
    • id - Same (advanced) usage as described for <MTAjaxStarRater> above.
    • report_icon - This optional argument will display a third button, a "report" button, when used with comment raters. Visitors to your site can click this button to report the comment (for abuse, spam, profanity, etc.). When a comment is reported, an email is sent to the author of that entry, along with a link to edit the comment in question.
  • <MTAjaxRaterOnclickJS> - In addition to the convenient star and thumb raters, you can create your own rater. This tag makes it easier. To enable a rating button (or text link), you need to specify a javascript onclick event. This tag fills in the details. For example suppose you wanted to create a single voting text link for each entry - you could do so as follows: <a href="#" onclick="<$MTAjaxRaterOnclickJS type="entry" points="1"$>">I like it!</a>). Arguments include:
    • type - Recommended (but not required when used in an entry or comment context).
    • id - Same (advanced) usage as described for <MTAjaxStarRater> above.
  • <MTAjaxRatingCommentMax> - This will display the maximum number of points for rating comments, as specified in the plugin settings for that blog.
  • <MTAjaxRatingDefaultThreshold> - This will display the default threshold for viewing comments, as specified in the plugin settings for that blog.
  • <MTIfAjaxRatingBelowThreshold> - This is conditional tag whose contents will be displayed if the comment is below the default threshold, as specified in the settings. Note that this tag does not apply to user-specified thresholds (more on those later).
  • <MTAjaxRatingRefreshHot> - WARNING: You should not use this tag if you have a busy site with high-volume voting activity. This a special tag, it displays no ouput. It simply triggers the process of calculating the list of "hot" items. Note that "hot" list are not tabulated when the listing tags are rebuilt. For performance reasons, this process happens separately, usually via an MT scheduled task that runs automatically (approx) once every hour. If, for some reason, you want to manually refresh to the "hot" list, you can place the <MTAjaxRatingRefreshHot> tag into an index template and rebuild it (be sure to uncheck the "rebuild this template with indexes" box!). Again, this should be used carefully on busy sites, and usually not at all. The "hot" list can also be refreshed via an included cron script (more on this later).
Ajax Rating Settings

The settings for Ajax Ratings looks like this:

The blog settings for Ajax rating Pro looks like this:

Ajax Rating Pro also has a setting that is set only at the system level (Go to System Overview > Plugins). The system setting looks like this:

One of the notable settings is the "Rebuild After a Vote" option. High traffic site with high-volume voting should be careful with this setting. Generally speaking rebuilds can consume a lot of processor cycles, and a significant rebuilding after votes could slow things down, depending on several factors. The best performance option is "No Rebuilds" -- if you choose this option, the page will get update with the reader's vote immediately, but if this refresh the page, their vote won't be reflected (because the page has not yet been rebuilt). In this mode, ratings and votes counts get recorded into the database, but are not reflected on your pages until those pages are rebuilt (such as after a comment is posted to the entry, or manually rebuilt). If you have a site with high volume voting, chances are that you also have high-volume commenting -- if this is true, use the "No Rebuilds" option here and your entries will still be rebuilt every time a comment is posted. The second option here is "Rebuild Entry Only" -- this will only rebuild the Individual Archive template(s) for that entry (or if the vote is for a category, it will only rebuild the relevant category archive page) -- performance-wise, this option is not too bad. The third option is "Rebuild Entry, Archives, Indexes" -- this is the same level of rebuilding that happens when a comment is posted. It is the worst option performance-wise, as many pages may be rebuilt (the individual archive page(s), each of the category pages for the entries categories, any date-based archives enabled, and every index template in your blog. Be careful with this one on high-traffic blogs. The final option is "Build Indexes Only", which will only rebuild your index templates. This option might be suitable if you are only using the "Rate This Blog" widget (more on this later) on your main index. Note that if you are using PHP Dynamic publishing, there is no issue with rebuilds, you can set this to "No Rebuilds" and ratings will always be reflected correctly each time the page is loaded.

Requirements

MT 3.2+

(Note: If you are running 3.3+, installation will be much easier, as the database tables will be automatically created for you. If you are running 3.2, you will need to create the tables manually - or via a utility like phpMyAdmin)

Installation Instructions

  1. Expand the zip file.
  2. Upload the contents of the 'plugins' directory to the 'plugins' directory of your MT install (usually /cgi-bin/mt/plugins)
  3. Upload the contents of the 'php' directory to the 'php' directory of your MT install (usually /cgi-bin/mt/php)
  4. Upload the contents of the 'mt-static' directory to the static directory created when you installed MT (usually called 'mt-static')
  5. Change the permissions on the mt-vote.cgi and mt-report.cgi (Pro only) files found within /plugins/AjaxRating/ to 755 (CHMOD 755)
  6. Login to Movable Type (or if already logged, click "Main Menu")
  7. If your are running MT 3.3+, you should now be redirected to an Upgrade screen that will install the tables for Ajax Rating. If you are running MT 3.2, then you need to create the tables manually, using the ajaxrating.sql file to create these tables.
  8. After the tables have been created, browse to the settings (Settings->Plugins) for the blog you want. Choose the settings that you want and then save.
  9. Return to the settings and click the "Click here to install the Ajax Rating templates for this blog" link. This will install the javascript and styles index templates and rebuild them automatically. (Note: if you change you settings in future, remember to manually rebuild this index templates afterwards)
  10. For every template for which you plan to place raters, add the following between the <head> and </head> tags:
  11. <script type="text/javascript" src="<MTStaticWebPath>prototype.lite.js"></script>
    <script type="text/javascript" src="<MTStaticWebPath>moo.ajax.js"></script>
    <script type="text/javascript" src="<MTBlogURL>ajaxrating.js"></script>
    <link rel="stylesheet" href="<$MTBlogURL$>ajaxrating.css" type="text/css" />

  12. Now you can place raters to meet your needs. Most people may want to add something like the following below the <MTEntryBody> tag:
  13. <$MTAjaxStarRater type="entry"$>
    Rating: <strong><span id="ajaxrating_entry_<$MTEntryID$>_avg"><$MTAjaxRatingAverageScore type="entry"$></span></strong>/<$MTAjaxRatingEntryMax$> (<span id="ajaxrating_entry_<$MTEntryID$>_cnt"><$MTAjaxRatingVoteCount type="entry"$></span> votes cast)

  14. Add the included Ajax Rating widget to your sidebar. This will display a "Rate this Blog" section that will enable people to rate your blog. (Optional)

  15. Test it out and tell people they can start submitting votes!

For more advanced usage, I am going to post a separate article soon, covering topics such as custom raters, comment threshold setup, customizing the star and plus/minus buttons, and more.

Get Ajax Rating

Ajax Rating is free for personal use, but you must include a link on your home page to http://mt-hacks.com/ajaxrating.html, such as:

Ratings on this site are powered by the <a href="http://mt-hacks.com/ajaxrating.html">Ajax Rating</a> plugin for Movable Type.

Download Now

Download Now (Ajax Rating for Personal Use)
Downloads: 6854

Membership required, please sign-in or register:

A lot of effort went into this plugin, donations are much appreciated. Suggested donation is $10:

If you wish to use Ajax Rating for commercial use, a commercial license must be purchased for $25:

Get Ajax Rating Pro

Ajax Rating Pro Regular License (1 to 10 blogs)

A regular license for Ajax Rating Pro enable you to use Ajax Rating Pro on up to 10 blogs on a single MT installation. The cost is $249:

Ajax Rating Pro Blog Network License (10+ blogs)

If you want to use Ajax Rating Pro on more than 10 blogs on a single MT installation, you can purchase a "Blog Network License". The blog network license is for unlimited blogs on the same install, and includes up to 2 hours of implementation consulting and a custom multi-blog installation script. The multi-blog installation script can be customized to meet your needs (subject to the 2 hours of consulting time) and includes setup of settings and installation of templates for each blog. The blog network license is $499.

Rater Images and CSS Styles

I did not design the default star graphic used with this plugin, and I did not craft the CSS styles that make it look and work so slick. Much credit for both of these elements goes to Ryan Masuga of Masuga Design. Ryan's Unobtrusive AJAX Star Rating Bar has been downloaded more than 12,000 times! Thank you Ryan.

The plus / minus images, on the other hand, I did design .... and it shows. Graphic design is not my forte. As mentioned above, you can swap out your own images for both types of raters (more on that soon). If anyone out there want to design some better button images, please do! Thumbs up and thumbs down images would be cool, and maybe a better plus/minus set as well. If you design some buttons you want to share, let me know I will post them here or include them with Ajax Rating (giving you credit of course).

Future Features

In the future Ajax Rating Pro will be enhanced even further. If you purchase a license for Ajax Rating Pro, you can help steer the development of new features. I see a lot of potential for this plugin with very active blog sites, and blog networks in particular -- and new features will likely be in this area. Here are a few ideas that may be worth adding if customers are interested:

  • more sophisticated "hot" list algorithms - making this more sophisticated and customizable, so you can fine tune everything to make sure that the popularity filter is promoting those items that help build community and create buzz
  • score summary for authors and commenters - look at which authors have the highest and lowesst rated entries (maybe offer prizes or compensation based on ratings), also look at summarized raters for each commenter, possibly triggering automatic or manual review when commenters have continually poor ratings (troll meter)
  • displaying rating and vote information on the MT admin screens
  • notification thresholds that will flag comments below thresholds, or even rules that automatically unpublish them pending review.

As always, comments, feedback, suggestions are welcome. Please reply to this entry.

Update 2/11/2007: Also see these new articles on Ajax Rating: