MainDoctor WhoMusicSoftware
Main Page

Alden Bates' Weblog

Feigning normality since 1973

Movable Type commenting tweaks

Filed in: Movable Type.

After my post about Blogger supporting OpenID for commenting, I decided I should enable OpenID on here as well. This lead to me having to overhaul the comment form (bringing it into line with the comment form in the default MT4 templates) so that everything would actually work. Unfortunately doing this had the side effect that any comments I made appeared as "Anonymous"

Why? Because I don't have MT Native authentication turned on (I don't see the point in getting people to register on my site just to comment on my entries). However the comment form javascript happily detected my MT login cookies and assumed I was a registered commenter, which caused the "Anonymous" effect. The simple solution was to turn on MT Native authentication, or so I thought...

Of course, this produced another side effect: the default login method for commenting became the MT native form. Since I have registration turned off, this form is 100% useless to anyone but me, and I'm always logged in.

It seems like the only way to turn that form off (but keep MT Native authentication on) is to modify Movable Type's source code. In this case /lib/MT/App/Comments.pm, which has the code for constructing the comment login page. The trick is to add a "next;" at the appropriate place so it skips adding the MT login form:

158: foreach my $key (@auths) { 159: if ( $key eq 'MovableType' ) { 160: next; 161: $param->{enabled_MovableType} = 1;

With that disabled, the login form gives options of OpenID, LiveJournal and Typekey, with the default being OpenID - much more useful. Blogger isn't an OpenID provider yet (it's in the works), but once they have that working I should be able to add a login option for Blogger users.

I also tweaked the site javascript so it wouldn't hide the comment form for people who weren't logged in. They probably did that to encourage people to log in, but I suspect it's more likely to discourage people from commenting.

Posted December 20, 2007 11:32 PM

Comments

In MT 4.1 the code mentioned above's been moved to App.pm

Posted by: Alden | February 14, 2008 8:35 PM

Post a comment





Tetrap.com Site Map