MovableType Image Requests

Plugin

A plugin is available for MovableType 2.6.x and 3.0 installations. The plugin makes available a tag called MTGravatar that, when used inside the MTComments tag, outputs the correct gravatar URL based on the commenters email address.

Installation: Download and extract the above file to your MovableType plugins directory, located at /plugins. Once the file is placed in the plugins directory, it is immediately available for use in your template files.

Usage:MTGravatar has the following syntax:

All attributes are optional. For example, the following will create a gravatar URL that allows all rating levels, is 80×80 pixels and uses no default image:

If you wish to restrict your gravatars to G rated only, you'd do this:

If you want the size of the image changed as well, supply the pixel dimension as an additional attribute:

If you want G rated gravatars only and you want to use your own "Big Bird" image as a default graphic (shows up when either no gravatar exists for a given user, or the given user's gravatar exceeds the specified rating), you'd do this:

Remember that this only generates the URL, so you have to place the tag inside the src attribute of an img tag like so:

<img src="<$MTGravatar$>" alt="" />

CommentBodyPlusGravatar Plugin

Also available for MovableType 2.6.x and 3.0 installations, this plugin makes available a tag called MTCommentBodyPlusGravatar that, when used inside the MTComments tag as a replacement for MTCommentBody, outputs the comment body and inserts the gravatar image code inside the opening <p> tag. This is important if you want to use CSS to float the image so that text will wrap around it.

Installation: Download and extract the above file to your MovableType plugins directory, located at /plugins. Once the file is placed in the plugins directory, it is immediately available for use in your template files.

Usage:MTCommentBodyPlusGravatar has the following syntax:

All attributes are optional. For example, the following will output the comment body and a gravatar image that allows all rating levels, is 80×80 pixels and uses no default image:

If you wish to restrict your gravatars to G rated only, you'd do this:

If you want the size of the image changed as well, supply the pixel dimension as an additional attribute:

If you want G rated gravatars only and you want to use your own "Big Bird" image as a default graphic (shows up when either no gravatar exists for a given user, or the given user's gravatar exceeds the specified rating), you'd do this:

By default, the gravatar image tag will have a class of "gravatar" specified. You can target it with the CSS selector img.gravatar. If you want to change the class name, use the class attribute like this:

The convert_breaks parameter acts exactly as it does in MTCommentBody

Dynamic PHP Plugin

A plugin written by Chris Romp is available for MT 3.0+ installations with dynamic PHP functionality. This plugin makes available a tag called MTPHPGravatar that, when used inside the MTComments tag, outputs the correct gravatar URL based on the commenter's email address.

Installation: Download and extract the above file to your MovableType plugins directory, located at /php/plugins. Once the file is placed in the plugins directory, it is immediately available for use in your template files.

Usage:MTPHPGravatar has the following syntax:

All attributes are optional. For example, the following will create a gravatar URL that allows all rating levels, is 80×80 pixels and uses no default image:

If you wish to restrict your gravatars to G rated only, you'd do this:

If you want the size of the image changed as well, supply the pixel dimension as an additional attribute:

If you want G rated gravatars only and you want to use your own "Big Bird" image as a default graphic (shows up when either no gravatar exists for a given user, or the given user's gravatar exceeds the specified rating), you'd do this:

Remember that this only generates the URL, so you have to place the tag inside the src attribute of an img tag like so: