" /> markpasc.org: November 2005 Archives

Main | January 2006 »

November 14, 2005

TypeKISS

TypeKISS, to replace the JavaScript for commenter greeting with Server Side Includes

Download TypeKISS 1.1 (14 November 2005)

TypeKISS provides template tags to replace the JavaScript code for greeting authenticated commenters with Apache Server Side Includes (SSI) code. ("TypeKISS" is "TypeKey Included Server Side.")

If you use PHP instead, try Neil Turner's PHP-TypeKey.

Changes since 1.0

1.1: use correct display name when previewing by using MTCommentAuthor instead of MTCommenterName. This was especially obnoxious when used with OpenID Comments for MT.

Using TypeKISS

To install, drop the above file as typekiss.pl into your plugins directory, then modify your template to call it. For example:

<MTIfSignedIn>
    <p>Thanks for signing in, <MTSignedInName>.
    (<a href="<MTRemoteSignOutLink static="1">">sign out</a>)</p>
<MTElse>
    <p><a href="<MTRemoteSignInLink static="1">">Sign in with TypeKey.</a></p>
    <!-- name and email form fields -->
</MTElse></MTIfSignedIn>

Note that your web server must be configured to run SSI in your published blog pages.

The provided tags are:

MTIfSignedIn
A conditional container tag, this includes the contained template code if the viewer has signed in to comment.
MTSignedInName
Shows the name of the signed-in commenter.

Known issues

  • Special characters in names, including spaces, are not correctly shown when displayed with SSI (ie, on the published pages). The characters are correctly shown when previewing.

November 1, 2005

CatEntries

CatEntries, for including and excluding categories

Download CatEntries 3.0 (19 July 2004)

CatEntries displays entries including or excluding categories you specify. In addition to allowing you to exclude categories, CatEntries correctly displays N entries when given a lastn="N" attribute.

Changes since 2.5

3.0: Updated for Movable Type 3.0D.

2.8: Using offset with days works. If you specify both days and lastn, you get the last lastn entries in the specified days range.

2.7: Using days="3" on, say, 2 January didn't work. I thought it had been working across month boundaries, but apparently years gave it trouble.

2.6: Honors lastn and offset even on pages with natural entry contexts, like category pages.

Using CatEntries

To install, drop the above file as catentries.pl into your plugins directory, then modify your template to call it, e.g.:

<MTCatEntries lastn="4" exclude="Threads,Enjoying">
<i>your entry display code here</i>
</MTCatEntries>

This, for example, will show all entries that are not in the Threads or Enjoying categories, including entries in no categories. The options CatEntries supports are:

include="cat,cat,cat"
Show only entries from the given categories; entries posted to no categories will not be shown. Separate category names with commas.
exclude="cat,cat,cat"
Don't show any entries from the given categories. Excludes override includes, so include="Cat" exclude="Mouse" will not show any entries posted to both Cat and Mouse.
lastn="N"
Show the N most recently posted entries, as in MTEntries.
offset="N"
Make lastn show the most recent posts starting N posts ago, as in MTEntries.
days="N"
Show the posts made during the last 24 × N hours, as in MTEntries.

Future enhancements

  • Recognize the empty string as the no-category category. (You can only include entries in no category by excluding all the other categories.)
  • Honor offset with day. Or not.

OpenID Comments

OpenID Comments for Movable Type

Download OpenID Comments 1.7 (14 November 2006)

Changes since 1.5

  • Finds userpic/avatar images in commenters' FOAF profiles, and provides them with the MTCommentAuthorPictureURL tag.
  • Properly handles cancelled signins.
  • Signing out of the blog no longer signs commenters out of TypeKey.
  • Per-blog option to disable inline styles in the SignOnThunk tags.

Using OpenID Comments

To install, unzip the archive to your MT directory. (If you run MT in a cgi-bin or aren't using the standard location for mt-static for some other reason, move the mt-static/openid-comment directory into your static web path.)

The plugin is now installed, so you can configure the individual blogs that should accept OpenID sign-ins. On the weblogs that should accept OpenID sign-ins, if you don't already accept TypeKey sign-ins, go to Settings → Feedback and set up authentication with the "Setup Authentication" button.

Note: you must have the "Require E-Mail Addresses" option off to accept OpenID sign-ins. OpenID does not provide you with email addresses like TypeKey does.

After enabling authentication, edit your templates to add this template code before the comment form HTML:

<MTOpenIDSignOnThunk>

Now you're all set! Try signing in with your LiveJournal or TypeKey account to test it out.

Form configuration

Using the <MTOpenIDSignOnThunk> tag is intended to be the easy, quick way to add the sign-in form to your site. However, you can customize the form if you wish. As of OpenID Comments 1.7, this is the HTML for the sign-in form:

<div id="openid">
    <form method="post" action="<MTOpenIDSignOnURL>">
        <input type="hidden" name="entry_id" value="<MTEntryID>" />
        <input type="hidden" name="__mode" value="signon" />
        <p>
            <label>Your blog URL:</label>
            <input name="openid_url" size="35" value="" />
            <input type="submit" value="Sign in" />
        </p>
    </form>
</div>

This plugin provides several tags for use in publishing or composing this form:

<MTOpenIDSignOnThunk>
The entire form as above, with special styling to show the OpenID logo.
<MTLiveJournalSignOnThunk>
A special version of the form above, prompting the user to enter a LiveJournal username instead of a full OpenID URL. The plugin will authenticate LiveJournal users by converting the username into a http://www.livejournal.com/users/username/ OpenID.
<MTOpenIDSignOnURL>
The URL to the sign-in form, for use in the HTML form tag.
<MTStaticWebPath>openid-comment/openid.gif
The URL to the OpenID logo, as used in MTOpenIDSignOnThunk and comments left by OpenID users.
<MTStaticWebPath>openid-comment/livejournal.gif
The URL to the LiveJournal logo, as used in MTLiveJournalSignOnThunk and comments left by LiveJournal users.

Future enhancements

See my todo list in Backpack for possible future enhancements.