Ajax Comments is a plugin for Movable Type 4 that enables your commenters to post comments using Ajax, without the page refreshing.
Live Demo
The best way to describe Ajax Comments is to show you. Try it out right now on the MT Test Blog. Click here to post a comment on the test entry.
Template Sets
To make Ajax Rating easy to setup, 6 templates are included. The following templates are new ones:
Ajax Comments Javascript (index template) - Contains links to the Javascript needed to posta comment.
YUI Javascript (template module) - Contains references to YUI Javascript libraries hosted externally.
...and 4 templates that are replacements for MT4 default templates: (Note: if you already customized these templates, you may have to do some manual template customization here. The installer will back up your existiing versions of these template.)
- Comments (template module)
- Comment Form (template module)
- Comment Preview (system template)
- Comment Response (system template)
The above templates can be easily installed by clicking the "install templates" button in the plugin settings (requires the Template Installer plugin).
Spam Protect
Ajax Comments can also be used to reduce your spam load significantly with "Spam Protect". Spam Protect is enabled by default, but you can disable it in the plugin settings. Spam Protect tricks automated spambots by tricking them into posting comments to the wrong URL. I have used this technique for a few years, and it makes a big difference is spam volume as server load. The one drawback to using Spam Protect is that commenters must have Javascript enabled to successfully post comments -- the tiny percentage of people who have Javascript disbaled will be sent to the "fake" Spam Protect URL. To minimize the CPU load from spambots, I recommend setting the Spam Protect URL to a non-existant page, so the bots will get a 404 "page not found" error.
Requirements
- MT4
- Template Installer plugin
Installation
- Download and extract the zip file. Upload the contents of the 'plugins' folder to the 'plugins' directory of your Movable Type installation.
- Go the the plugin settings (Preferences > Plugins, then click Ajax Comments then Settings). Install the templates by clicking the button.
- (Optional) Return to the plugin settings and adjust the Spam Protect settings and save.
- Edit your "Header" template module. Go to Design > Templates then choose "Template Modules" from the right side of the page. Open the "Header" template. Look for a line that says:
<MTIf name="feedback_template">
After that line, add the following two lines:
<$MTInclude module="YUI Javascript"$>
<script type="text/javascript" src="<$MTLink template="ajax_comments_javascript"$>"></script> - Ensure that you have the "Use Comment Confirmation Page" setting checked under Preferences > Blog Settings > Comments. This is checked by default in new MT4 blogs. It must be checked for Ajax Comments to work.
- Rebuild your Entry Archives.
Get Ajax Comments
Commercial License - $97.00
Personal License - Free
Ajax Comments is free for personal, non-commercial use.
Download Now
As always, comments and suggestions are welcome.



Comments (51)
I can't post any comments on the test blog. I'm logged in but it asks me for name and email address. Otherwise.. the error handling and preview is amazing!
Posted by Carlo
|
September 12, 2007 2:32 PM
Posted on September 12, 2007 14:32
Carlo, thanks for reporting this. If you are logged in to MT Hacks, you will likely have to "sign out" first before the demo will work. This not a bug in the plugin, its just that the test blog is on a different MT installation than MT Hacks.
Posted by Mark Carey
|
September 12, 2007 2:44 PM
Posted on September 12, 2007 14:44
You're right Mark. After I posted my comment here I logged out on the other blog and logged back in and was able to post. It all makes sense now.
Posted by Carlo
|
September 12, 2007 7:44 PM
Posted on September 12, 2007 19:44
The tag is not displaying dynamic content when I put it in my templates. I suspect this is because the when install the templates from plugin settings page, no YUI Javascript template module is created (it is not listed in my templates modules page). Any suggestions? Thanks!
Posted by Chris | September 12, 2007 8:21 PM
Posted on September 12, 2007 20:21
I installed it on my personal blog and it works fine, but i'm having trouble installing it on my public site since I'm using my own templates. Could you post a small manual on the templates and all? I'm trying to figure out everything but i'm a bit confused on what is absolutely necesary for the ajaxcomments to work.
Posted by Carlo
|
September 12, 2007 8:34 PM
Posted on September 12, 2007 20:34
Carlo, I do plan on writing a manual howto article on this. You should be able to glean the key points from the included templates, but here are some quick highlights:
The comment form needs a few changes. First, onclick argument to the open <form tag needs to be amended to include "postComment();". Second, a hidden field should be added named "ajax", set to a value of 1. Finally, each of the submit buttons need a new onclick argument, setting the "Action" variable (ie. onlick="Action='preview'" and onlick="Action='post'")
The "Comments" template needs <div id="ajax-comment"> to be added in two places. First right after the <MTCommentsFooter> tag. Secondly, right before the </MTComments> tag, add <MTElse><div id="ajax-comment"> (this deals with the case when an entry has no comments).
The "Comment Response" template needs a few edits. Looking at the included template should help here, but the key part to notice is that a large part of the template needs to be enclosed in the conditional <MTIfAjaxComments> tag. Inside that tag, is the output to be placed inline via AJAX. In the <MTElse> container goes the non-AJAX page content that is the page displayed when comment is not posted via AJAX.
The "Comment Preview" template works similar to the Comment Response template.
That's basically it, apart from the "Header" changes noted in the instructions above. I will try to expand this into a more detailed article in future.
(Another route to consider is to start with templates include with the plugin, then add back your own customizations. This may be quicker, depending on how much customization you have done.)
Posted by Mark Carey
|
September 12, 2007 8:59 PM
Posted on September 12, 2007 20:59
Thanks Mark, these keys points should really help me out. I'll get to work on my templates and let you know how it goes. Great work!
Posted by Carlo
|
September 12, 2007 9:15 PM
Posted on September 12, 2007 21:15
On a side comment.. how can I let users register system-wide? I want to use ajaxcomments on my whole site and each section is a different blog. Can you actually do that? (let users register on all blogs at once?)
Posted by Carlo
|
September 13, 2007 6:25 AM
Posted on September 13, 2007 06:25
Carlo, that issue is separate from the Ajax Comments plugin. This plugin uses the built-in registration/login tools that come with MT4, it doesn't modify them at all.
In MT4, I have heard that there is no easy way for users to register for all blogs on a system, but I haven't played with that yet. It might require another plugin to enable this.
Posted by Mark Carey
|
September 13, 2007 6:52 AM
Posted on September 13, 2007 06:52
Ajax comments will fit in nicely on my site. I have my main index set to show comments under each entry, hidden by default. How difficult would it be for me to have a small comment form pop up when the comments link is clicked, and use ajax for it to display right there on the main page without refreshing?
I would prefer to use a pop-up, although I suppose I could also hide the comment form under each entry and just have it expand along with the comments.
Posted by rm_blogger | September 15, 2007 9:58 PM
Posted on September 15, 2007 21:58
I have the plugin setup on one of my sites and when the entry page loads where the comments normally are I get a page not found and the error:
Smarty error: [in evaluated template line 16]: syntax error: mismatched tag {/if}. expected {/mtcomments} (opened line 6). (Smarty_Compiler.class.php, line 2286)
Posted by rm_blogger
|
September 17, 2007 6:38 AM
Posted on September 17, 2007 06:38
gdfgdg
Posted by qwe | October 4, 2007 5:04 AM
Posted on October 4, 2007 05:04
test
Posted by sevitzdotcom
|
October 30, 2007 6:25 AM
Posted on October 30, 2007 06:25
sevitzdotcom, not that this entry does not have Ajax Comments enabled. You need to click here to go to the live demo entry.
Posted by Mark Carey
|
October 30, 2007 8:45 AM
Posted on October 30, 2007 08:45
trst
Posted by kodie
|
November 7, 2007 8:05 AM
Posted on November 7, 2007 08:05
Is there a way to change the "processing image" you can see on submitting the comments?
I can't find it within the plugin folders...
Posted by intervisual
|
November 8, 2007 2:51 AM
Posted on November 8, 2007 02:51
intervisual, that image comes with the MT4 application, and it is also used in the admin area. It can be found in your "static web path", such as
yoursite.com/mt-static/images/indicator.gif
If you want to show a different image, it may be best to edit the Ajax Comments Javascript template. Near the very bottom, you will see a line that references this image. Simply change the URL in the <img src="" to point to the image of your choice.
Posted by Mark Carey
|
November 8, 2007 12:18 PM
Posted on November 8, 2007 12:18
Thanks Mark! Regards Steffen
Posted by intervisual
|
November 8, 2007 1:25 PM
Posted on November 8, 2007 13:25
you guys always got great idea. thanks for all
Posted by shoes seller | November 10, 2007 7:22 PM
Posted on November 10, 2007 19:22
The part of the comments template seems to generate an error on dynamic entries. It has trouble with the part... not sure how to fix that.
Posted by justinmc
|
November 28, 2007 4:54 PM
Posted on November 28, 2007 16:54
I am receiving the error message after I have installed this plugin:
Smarty error: [in evaluated template line 16]: syntax error: mismatched tag {/if}. expected {/mtcomments} (opened line 6). (Smarty_Compiler.class.php, line 2286)
What am I missing?
Posted by cruv | December 12, 2007 9:49 AM
Posted on December 12, 2007 09:49
I installed the plugin and it works great expect i cannot get the comments to appear on the main home page. They do show up when you click on the main entry. What do I need to change on my templates to have the comments appear wit the entry on the home page? I followed the documentation exactly.
Thanks!
http://blog.fredsommer.com/fredsblog/
Posted by fred | January 10, 2008 8:50 PM
Posted on January 10, 2008 20:50
Hi,
Quite keen to implement this, but all my pages are dynamic expect the home page.
It seems from the comments above that this doesn't work so well with dynamic pages. Can I check if this works with dynamic pages and also there is a way to trigger rebuilds of index pages (like the home page) which may a Recent comments section.
Adrian
Posted by sevitzdotcom
|
February 6, 2008 9:51 AM
Posted on February 6, 2008 09:51
sevitzdotcom,
When posting comments using this plugin, it does trigger index rebuilds in the normal way.
The current version does not include PHP-dynamic versions of the template tags, but you could probably get it to work without them with a little template creativity. A future version may include dynamic versions of the tags, but you are the first to request that feature.
Posted by Mark Carey
|
February 6, 2008 12:17 PM
Posted on February 6, 2008 12:17
Mark,
All my entries are on dynamic pages and I don't want want to switch to static pages (for a variety of reasons)
I'll wait for the plugin that works with dynamic publishing. Pity as it's a great plug in.
Adrian
Posted by sevitzdotcom
|
February 6, 2008 4:09 PM
Posted on February 6, 2008 16:09
Very nice,
I got a javascript message on IE, 'Action' is not defined. I don´t know what can do this
Posted by Anonymous | February 19, 2008 8:47 PM
Posted on February 19, 2008 20:47
Hi!I installed the Ajax Comments on my personal chinese blog.and there is no error when I was installing it ,but I can't find in my header template,and I just copy it and the codes below that you ask to add to my header template.but I find the ajax comments doesn't work!Why?Can you help me?
my URL is http://www.youweilin.com
Posted by blog2n
|
February 25, 2008 1:05 AM
Posted on February 25, 2008 01:05
thank you for the script!
it is working just fine but there is the question of encoding.
My blog uses windows-1251, and with this plugin i get abracadabra.
how does it send comments to mt-comments?
where can i find the point it converts the encoding?
Posted by irina | February 29, 2008 1:19 AM
Posted on February 29, 2008 01:19
I'm getting this error:
Error
# Transaction id: 0
# HTTP status: 404
# Status code message: Not Found
Using version 4.1
Posted by wordup
|
March 24, 2008 3:10 PM
Posted on March 24, 2008 15:10
I set up Movable Type 4.1 but the comments were not working. I thought I needed an additional plug in so I installed Ajax Comments. I followed the directions loading the .pl file into an Ajax Comments directory under the plugin directory. I also set up the Template Installer.
The only thing I did not do was add the following lines in the header template because there was no line with in it.
">
Both plugins appear to be set up properly from the Movable Type administration plugin screens. My archives are set to Entry.
However, when I go to submit or preview a comment I get a "Page Cannot be Found" and it showed the url "www.crossfitpei.ca/mt-comment.cgi".
I would greatly appreciate your thoughts on this.
Thanks,
Mike
Posted by Mike | April 11, 2008 1:45 PM
Posted on April 11, 2008 13:45
It looks like the app parsed my tags that I added. I was referring to the lines to be added to the header template and the tag that was not in it to begin with was MTIf name="feedback_template".
Posted by Mike | April 11, 2008 1:47 PM
Posted on April 11, 2008 13:47
tnx for your useful plug in, but i have a problem that i can't use it in ajax mode, when i submit the form it goes to mt-comment.cgi and shows what we have predict for ajax action.
how can i fix it?
Posted by Ehsan | August 12, 2008 5:10 PM
Posted on August 12, 2008 17:10
i think it cause because the comment detail isn't in the plugin sets
Posted by Ehsan | August 12, 2008 5:18 PM
Posted on August 12, 2008 17:18
hello, is this system obsolet? i´m trying it in a 4.2 installation without luck, the comments template has an error.
Posted by Pixelmod
|
September 22, 2008 7:36 PM
Posted on September 22, 2008 19:36
Mark: Your instructions state: Open the "Header" template. Look for a line that says: After that line...
I am trying to set-up Ajax Comments on MT 4.2. I do not see a "Header" template. I do see 'Banner Header' and 'HTML Head' but neither one contains
Please assist.
Posted by keeptry8 | September 24, 2008 4:27 PM
Posted on September 24, 2008 16:27
the error was mine > regards
Posted by Pixelmod
|
September 28, 2008 5:49 PM
Posted on September 28, 2008 17:49
same problem as seke. Has anyone gotten this to work on a template designed for 4.2? I had this working fine on a older style. When I upgraded styles/templates to 4.2 that is when the fun began.
Posted by boywaja
|
January 27, 2009 9:09 PM
Posted on January 27, 2009 21:09
I can't post any comments on the test blog. I'm logged in but it asks me for name and email address. Otherwise.. the error handling and preview is amazing!http://popeo.net/saishunkan/index.html
Posted by saishunkan | February 28, 2009 3:36 AM
Posted on February 28, 2009 03:36
same problem as seke. Has anyone gotten this to work on a template designed for 4.2? I had this working fine on a older style. When I upgraded styles/templates to 4.2 that is when the fun began.
国内格安航空券
Posted by 国内格安航空券 | February 28, 2009 3:37 AM
Posted on February 28, 2009 03:37
I am trying to set-up Ajax Comments on MT 4.2. I do not see a "Header" template. I do see 'Banner Header' and 'HTML Head' but neither one contains
Please assist.個別指導塾
Posted by 個別指導塾 | February 28, 2009 3:40 AM
Posted on February 28, 2009 03:40
I had this working fine on a older style. When I upgraded styles/templates to 4.2 that is when the fun began.多重債務 葬儀 千葉
Posted by 多重債務 | February 28, 2009 3:41 AM
Posted on February 28, 2009 03:41
I'll wait for the plugin that works with dynamic publishing. Pity as it's a great plug in.
Adrian
Posted by sevitzdotcom Author Profile Page | February 6, 2008 4:09 PM
国際協力
人権問題
Posted by 人権問題 | February 28, 2009 3:43 AM
Posted on February 28, 2009 03:43
very nice artical.
Posted by おまとめローン | March 12, 2009 4:48 AM
Posted on March 12, 2009 04:48
I set up Movable Type 4.1 but the comments were not working. I thought I needed an additional plug in so I installed Ajax Comments. I followed the directions loading the .pl file into an Ajax Comments directory under the plugin directory. I also set up the Template Installer.
The only thing I did not do was add the following lines in the header template because there was no line with in it.
Posted by شات صوتي | March 30, 2009 8:36 PM
Posted on March 30, 2009 20:36
sdfgsd sdfg dsfg
Posted by asdf | July 1, 2009 11:29 PM
Posted on July 1, 2009 23:29
Hi is this plugin working between 2 domains? MT is on another domain as my blog. Ajax commenting was a problem so I disabled it. Should this plugin work?
Posted by Hans
|
July 24, 2009 7:01 AM
Posted on July 24, 2009 07:01
Me ubiqué en las otras antenas, me fijé en el material que usaban, me salió la idea y la fabriqué”, dijo Jean Carlos a LISTÍN DIARIO, que llegó hasta su casa para conocer su trabajo. En unas cuantas horas lograron la conexión. Sólo necesitaron un cable coaxial, un pedazo de cobre yuna olla vieja.
Posted by お見合い | August 3, 2009 2:05 AM
Posted on August 3, 2009 02:05
I set up Movable
Posted by شات صوتي | November 30, 2009 10:46 AM
Posted on November 30, 2009 10:46
thanks mark
Posted by chatmax | February 7, 2010 5:54 PM
Posted on February 7, 2010 17:54
Very nice,
I got a javascript message on IE, 'Action' is not defined. I don´t know what can do this
Posted by resimler | February 7, 2010 5:57 PM
Posted on February 7, 2010 17:57
you guys always got great idea. thanks for all
Posted by celebritygirls | February 7, 2010 6:01 PM
Posted on February 7, 2010 18:01