Only 2 (!) simple lines of code to have avatar support for your Wordpress comments with gracefull fail-over from Gravatar.com to Mybloglog.com, all without plugins… just add to your comments.php in the comments loop wherever you would like to see the Avatars/commenter photos placed:

The code for gravatar image URL is taken from Tom Werner’s simple gravatar.php plugin, the failover to Mybloglog was my idea.

Check it out in action here.

Note that the commenter email address must be URL encoded twice, because the gravatar.com script otherwise strips out the @ symbol.

Plus this makes for minimal protection from email phishing bots. Better would be to have Mybloglog adopt Gravatar’s md5 encoding of the Email address.

If MyBlogLog also had the "&default=[url]" failover support, this could be chained to support further avatar service providers. Since it doesn’t, the chain stops with their somewhat ugly and small default (the grey square with the question mark).

And this also represents one fly in the ointment: MyBlogLog could at least make the size of that default the same size as the avatars their "coiserv.php" script serves - 48 x 48 pixels. I am going to talk to someone at Yahoo about this who might be able to pass it on to the right people.

To get the code, right-click and "Select All", then copy and paste to your theme’s comments.php template where you want the Avatar to appear.