Some problems aren’t easily solved
Jan 6th, 2006 by Karen
So I’ve been working to get my comment form templates in Movable Type to look and work like the rest of my templates. The problem is that these templates are governed in part by the mt-comment.cgi file which is written and Perl. As a result, you can’t insert PHP code into these templates or include modules that have PHP in them. For me this is a major inconvience. I want all our blog pages to look the same, but I can’t find a workaround for the comment CGI pages. The search CGI problem can be solved by following the procedure described on MezzoBlue or Shaun Inman’s blog. I tried the same technique on the mt-comment.cgi file and the associated templates (Comment Preview and Comment Pending) and encountered a myriad of problems.
First, it seems from testing that the mt-comment.cgi will only take information sent from a POST rather than a GET or at least when I try the MezzoBlue technique or just send things in the query string ie. go to http://myblog.com/mt-comment.cgi?static=1&entry_id=12&author=me&email=something&post=Post , I always end up at the comment preview screen and my comment never gets posted.
Based on the theory that I needed to send a POST to mt-comments.cgi rather than a GET request. I wrote a PHP page which uses Curl to send a POST to mt-comment.cgi and retrieve the data returned. This didn’t work either. My POST with the comment information was successfully sent to mt-comment.cgi and my comment went into the moderated comments. However, I ended up at the Comment Error screen seeing the error “An error occurred: In an effort to curb malicious comment posting by abusive users, I’ve enabled a feature that requires a weblog commenter to wait a short amount of time before being able to post again. Please try to post your comment again in a short while. Thanks for your patience.”. I haven’t the faintest idea why this is. I can’t even find the error message anywhere in the Movable Type code so I can really figure out why it is I’m ending up here.
The upside is that I’ve learn a lot more PHP the last week and CURL is pretty darn cool. The downside is my comment forms still don’t look right and I’m probably going to decide soon that I need to move on to other things and remove the sidebar from those pages.

