Announcing EEGravatar.

Posted by Les on Tuesday, July 27, 2004 at 10:35 PM. Read 12069 times. Tags: ,
{name} pic

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}&nbsp; <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

Comments:

Page 3 of 4 pages « First  <  1 2 3 4 >

PZ Myers United States Posted on 08/04/2004 at 12:19 PM

PZ Myers pic

Thanks for the nifty tool. I’ve put it on my site, but I don’t know that I get the population of geeky computer nerds who would trouble themselves to register with gravatar.

Les United States Posted on 08/04/2004 at 04:59 PM

Les pic

Look at it this way: Even if no one who visits your site regularly bothers to sign up you’ll still see mine if I should happen by. grin

 Signature 

All I know is the wine lasts longer when you don’t gotta share it with someone
All I know is my steak tastes better when I take my steak tastes better pill
-- I Feel Fantastic, Jonathan Coulton

DJ Europe Posted on 08/19/2004 at 05:15 AM

DJ pic

Cheers for the update Les… As always its sweet… Makes the “hack” a little easier to remember now wink

Vik Rubenfeld United States Posted on 01/23/2005 at 10:52 PM

Vik Rubenfeld pic

Thanks for the great plugin!

abe Indonesia Posted on 08/21/2005 at 08:09 AM

abe pic

I’ve tried it, kewl ^_^

emptyspace Malaysia Posted on 08/26/2005 at 01:19 PM

emptyspace pic

Hm.. Nice plugin.. but I have a problem with it

alamanda Malaysia Posted on 08/27/2005 at 06:53 PM

alamanda pic

It`s not working, gravatar wont showed

Martin Sweden Posted on 09/06/2005 at 01:15 PM

Martin pic

Hi
I have a gravatar and now i want to install that plugin in my wordpress blog. But where should i put: this???  Should i put that in my comments.php? And where exactly in comments.php? Or am i wrong???

The plugin is active in wordpress and i tried to comment my own post but no gravatar shows up.

Martin

Martin Sweden Posted on 09/06/2005 at 01:17 PM

Martin pic

Shouldnt my gravatar show up here in this comment? I know the gravatar works ‘cause i saw it on another blog when i comment…

Les United States Posted on 09/06/2005 at 01:23 PM

Les pic

Martin, EEGravatar is a plugin for users of ExpressionEngine and it won’t work in your WordPress blog. Instead you should make use of the WordPress Gravatar Plugin. The instructions on how to use it with WordPress are included at that link I provided.

If you have a working Gravatar then it should be showing up here, though I must admit that I’ve stopped development of EEGravatar now that ExpressionEngine has a built-in Avatar function. It’s possible my plugin isn’t working correctly at the moment and I’ve just not noticed.

 Signature 

All I know is the wine lasts longer when you don’t gotta share it with someone
All I know is my steak tastes better when I take my steak tastes better pill
-- I Feel Fantastic, Jonathan Coulton

Martin Sweden Posted on 09/06/2005 at 02:03 PM

Martin pic

Ok thank you smile

zulfan Indonesia Posted on 04/19/2006 at 08:46 AM

zulfan pic

thx

Cecília Brazil Posted on 06/22/2006 at 08:13 PM

Cecília pic

I Wish I could change avatar for the same e-mail address.

How can I do it?

I am from Brazil!!

please helpe me
http://www.rafaelvalente.blogger.com.br/index.html

3dsl Eugen Germany Posted on 11/23/2006 at 02:07 PM

3dsl Eugen pic

Thanks Les, that was the solution of my problem smile

misu Germany Posted on 02/13/2007 at 08:06 AM

misu pic

hello

today gravatar starts new. is the plugin working with the new gravatar?

http://site.gravatar.com/

Les United States Posted on 02/13/2007 at 03:01 PM

Les pic

Misu, I’ll be honest and admit that I’ve not kept up with Gravatar since EE added Avatar support right in the program. I still have my plugin running on this site, though, and it still appears to be working for the moment.

I’ll check out what’s new with Gravatar and if any changes are needed to the plugin then I’ll see if I can’t hack something together.

 Signature 

All I know is the wine lasts longer when you don’t gotta share it with someone
All I know is my steak tastes better when I take my steak tastes better pill
-- I Feel Fantastic, Jonathan Coulton

Bahamat Great Britain (UK) Posted on 02/13/2007 at 03:08 PM

Bahamat pic

V1.4 - Added {name} parameter as alternate to for use in situations where breaks the plugin such as Member Profiles.

V1.3 - Changed & to & for XHTML validation compliance.

v1.2 - Made into a parameter along for single tag usage for EE 1.1 release.

I know that guy smile

 Signature 

You don’t need to end all existence to end all suffering

davor Mexico Posted on 05/02/2008 at 12:57 PM

davor pic

Gravatar changed the way how to receive paramets, now size is only “s”, more: http://en.gravatar.com/site/implement/url

so, this plugin is working, but it’s not sendind default and size paramets, I hardcoded my size and default image, so now is working, but sending directly from EE template is not workin, I have version 1.6.1

beside, great work!!

Les United States Posted on 05/02/2008 at 01:13 PM

Les pic

Davor, thanks for the heads up on the change. I’ll modify the plugin and get a new version out. I’ve not messed with it in awhile seeing as EE now supports native avatars, but I’ll be sure to get this change worked in as soon as I can.

 Signature 

All I know is the wine lasts longer when you don’t gotta share it with someone
All I know is my steak tastes better when I take my steak tastes better pill
-- I Feel Fantastic, Jonathan Coulton

davor Mexico Posted on 05/02/2008 at 01:20 PM

davor pic

Great.. usually I dont like to change originally made code, even is very easy to do it, most for the right of the author,, so.. when you make new version,, post a comment to notify all users :D

thanx Les

misu Germany Posted on 05/07/2008 at 12:42 PM

misu pic

news about a new or updated version?

Les United States Posted on 05/07/2008 at 12:46 PM

Les pic

I haven’t had a chance to work on it yet as I just started a new job, but I should be able to get to it within the next day or so. I’ll post an announcement here when it’s done.

 Signature 

All I know is the wine lasts longer when you don’t gotta share it with someone
All I know is my steak tastes better when I take my steak tastes better pill
-- I Feel Fantastic, Jonathan Coulton

misu Germany Posted on 05/07/2008 at 12:51 PM

misu pic

thxs for the info grin

EFL Geek Korea (South) Posted on 06/04/2008 at 07:57 PM

EFL Geek pic

I just implemented this plugin into the redesign of my blog. One of the blogs I read has a checkbox at the bottom of the comment form “sign me up for a free gravatar” link. Is this something the plug in can do?

Les United States Posted on 06/04/2008 at 09:19 PM

Les pic

Not at this time. I’m not entirely sure if that’s a function of the Wordpress plugin that blogger is using or if it’s a custom script he came up with himself. I’m guessing it’s the latter, but you’d probably do better to write him and ask how he manages it.

 Signature 

All I know is the wine lasts longer when you don’t gotta share it with someone
All I know is my steak tastes better when I take my steak tastes better pill
-- I Feel Fantastic, Jonathan Coulton

Page 3 of 4 pages « First  <  1 2 3 4 >

Name:

Email:

Location:

URL:

Smileys


Remember my personal information

Notify me of follow-up comments?

Submit the word you see below:


<< Back to main