I’ve written my first plugin in PHP for ExpressionEngine called EEGravatar. It’s basically a simple way of allowing for avatars in your entries or comments using a centralized avatar hosting service called, oddly enough, Gravatar. If you’d like an avatar image of your own for the comments, just go to the Gravatar site and register using the same email address you use to post comments here and upload an avatar no bigger than 80x80 pixels. Once it’s approved it’ll start showing up in your comments automatically.
If you’d like to use EEGravatar on your own ExpressionEngine blog you can download a copy by clicking here. There is also a plugin available for MovableType and WordPress. There’s also a hack for TextPattern.
Update: I’ve duplicated the docs included in the plugin in the extended entry.
Updated Update: Here’s a little Gravatar button I made if you want to use it: ![]()
Version Update: The plugin has been updated to EE Gravatar 1.2 for use with ExpressionEngine 1.1 and is now a single tag plugin. See the updated docs in the plugin or down below for examples.
Version Update: The plugin has been updated to EE Gravatar 1.3 (the Lisa-Jill version). Minor change to output for XHTML compliance.
Version Update 10/2/04: EEGavatar is now up to version 1.4. Can now use {name} in addition to email as the one required parameter for use in Member Profiles and other places where the email parameter breaks the plugin. See documentation below for more information.
Documentation
The EE Gravatar Plugin allows you to easily insert a “globally recognized avatar” image from Gravatar (http://www.gravatar.com/).
This plugin requires at a bare minimum one of two possible parameters depending on where you wish to use it. The first option is a user’s email address and the second option is a user’s screen name. The reason for this is so the plugin can be used in situations where one or the other parameter won’t return the proper result. It is recommended that you use email for comment and entry loops and name for display in member profile templates, but feel free to experiment. Here’s the two minimum required uses:
<img src="{exp:gravatar email="{email}"}" /> -- For use in comment or entry loops.
<img src="{exp:gravatar name="{name}"}" /> -- For use in templates such as Member Profiles where email won't work as expected.
== OPTIONAL PARAMETERS ==
default=“http://www.somesite.com/someimage.jpg”
Defines a default avatar if there isn’t one associated with the email address or if it exceeds the rating.
rating=“[G | PG | R | X]“
Allows you to limit gravatars to the appropriate rating. Anything exceeding the rating will use the default (if supplied) or not display.
size=“[1..80]“
Allows you to define how big the gravatar will be in pixels. Any size other than 80 will cause the original gravatar image to be downsampled using bicubic resampling before output
border=“[hex color]“
Puts a border of the specified color around the gravatar.
== POSSIBLE EXAMPLES ==
Here’s a few examples that you might use:
<img src="{exp:gravatar email="{email}" rating="PG"}" />
Only displays gravatars of PG rating or lower.
<img src="{exp:gravatar email="{email}" rating="R" size="40" border="FF0000"}" />
Displays 40x40 pixel gravatars of R rating or lower with a red border around them.
<img src="{exp:gravatar email="{email}" size="70" default="http://www.somesite.com/someimage.jpg"}" alt="Picture of {name}" title="{name}" class="avatar" />
Displays gravatars of 70x70 pixels or a default graphic for users without a gravatar. Puts the user’s name in the alt and title tags and styles the image using a class called “avatar.“
<div class='profileTitle'><img src="{exp:gravatar name="{name}" size="80" rating="R"}" border="0" style="float: left; margin: 0; padding: 6px;" alt="{name} pic" title="{name}" />{name}</div>
<p>{lang:member_group} <b>{member_group}</b></p>
The above is a snippet of code from my Public Member Profile template showing how to insert a gravatar into the member listings for your site.
== Change Log ==
V1.4 - Added {name} parameter as alternate to {email} for use in situations where {email} breaks the plugin such as Member Profiles.
V1.3 - Changed & to & for XHTML validation compliance.
v1.2 - Made {email} into a parameter along for single tag usage for EE 1.1 release.
v1.1 - Minor bug fix.
v1.0 - Initial Release



















Les,
I found out that there is a gravatar sign up plugin for wordpress.
I would love to port this to EE but since I no next to zero about php, that’s not really possible. Anyhow, if you have time and are inclined to do this I would be very grateful.
If you don’t have time, I understand and thank you for having already created the excellent EE gravatar plugin.