Plugin: Gravatar Box
Version: 1.0.3
Last updated: 162 days ago.
Downloaded: 2,418 times.
Overview
Gravatars are great. But many people don’t have them.
Wouldn’t it be nice if, when a user was filling in the comments form, the page could automatically detect and show a users gravatar, if they have one? Or even better, show a sign up link if they don’t have one?
Well, here you go.
Download Now
Requirements
WordPress 2.8 or higher.
Features
- Easy to install and use.
- Integrates easily into any theme, with only one line of code.
- Easily customizable through CSS styling.
- No complex interface or options to mess with, just works.
Installation Instructions
- Upload the files to the `/wp-content/plugins/gravbox/` directory
- Activate the plugin through the ‘Plugins’ menu in WordPress
- Add this to your comments form somewhere:
<?php if (function_exists('gravbox')) gravbox(); ?> - Add styling for it into your style.css.
The gravbox() code adds a div with id of “gravbox”.
The image has the “gravatar” class, and is wrapped inside another div with a class of “gravatar_frame”.
The no-gravatar link is inside a p with a class of “nogravatar”.
This should be enough for any styling needs. If you wish to further alter the result or the size of the gravatar, edit the gravbox.js file.
Licensing
This plugin is licensed under the GPL Version 2 only.
Method to get support
You are free to email me, however I am also a moderator at the WordPress.org support forums, so you’ll find me there as well.

[...] Huh. Once I actually sat down and did it, converting it to a portable plugin actually took half an hour. I'm getting rusty.
http://ottodestruct.com/blog/w.....vatar-box/ [...]
That’s really cool Otto, although it kind of makes a tutorial I was writing redundant!
Excellent plugin. I like it
Good one, just a short input: I think you forget to lowercase the email address before MD5ing it.
Hey, good call. Added that to 1.0.2. It now runs the email address through toLowerCase().
this is incredibly awesome, otto! big thanks for creating this plugin, just installed it, works perfectly!
keep up good work
Incredibly awesome plug-in
amazing tool thanks!!!
Yes, finally got it working, very usefull plugin!
Lawrence Rolograaf
Works great, thank you
[...] 当然也可以通过CSS使这个头像出现的更美观些,例如作者博客中的效果。地址在这里,在评论的电子邮件处输入你的电子邮箱看插件效果。 [...]
I want to use the plugin but I use intensedebate for comments on my site. Would it work if I insert the code into the intensedate comments.php page? Thanks
Unfortunately, Intense Debate works differently, in that your comments are controlled by a javascript code. So it won’t work there.
I’m a blind blog owner. I like this plugin,
but I’m having trouble getting gravatars to show up on my blog
for some reason using the i2theme I got, made by mangoOrange.
To get the gravatar to show up to the left of the name, email, website
form fields like that, what xhtml form code do you use?
do you use ol, li or ul li? or do you use tables?
I’m not good at all with setting up a table structure like that
using CSS, I don’t know how.
Neither, actually. What I did was to put the call to the gravbox function just before the inputs that accept the name, email, website, and then used CSS code in my theme to move it to the left. The specific code I used can be found in the plugin’s readme.txt file. It’s basically just making the gravbox div float left, which puts it to the left of the form fields.
[...] Wordpress версии 2.8 и выше и легко интегрируется в шаблон. Скачать плагин Gravatar Box и прочитать подробнее о его настройке вы можете на [...]
The only ‘bug’(?) I can see is that if you’re logged in, it seems to default to the no-gravatar, rather than pulling your email from the logged in value… Should there be an if logged in check in there to get that?
Well, you could write a bit of code to pull the gravatar information for the logged in user and display the proper image there.
I didn’t really see the point in doing that for this plugin, the goal is more to get users to sign up for gravatars if they don’t have them already, thus the sign up link (which you’ll notice has the person’s email pre-filled in).
Also, most themes use separate sections for logged-in and non-logged-in user form fields. I only put the gravbox code on the non-logged-in user section.
What about users who are signed in and DON’T have a gravatar yet?
I have a healthy mix of registered and not registered users (bbPress integration – forums users have to register), so I’d like them to feel loved too
I’ll have to play with this. My js isn’t as good as it used to be.
Fair enough. I added support for logged in users. Download 1.0.3 when it gets updated.
Note that it won’t display the “get one” link for logged in users, just the default gravatar (according to the blog setting) when they don’t have one. This is because I’m not too comfortable with putting their email into the site in plaintext and I need to think of a better way first. I’m considering an md5 hidden field, allowing the javascript to work that way and allowing a 404 response to succeed.
Hey, cool, I was on the right track for my hack of that
The one catch with that is the get_avatar code pulls in your css settings for .avatar, so if you’ve set that to something like, say, 60px, you get a fun box-in-a-box
But that’s easy as π to fix.
I think the md5 hidden field would work.
Is this still something you are considering?
There hasn’t been a need so far, for logged in users, they probably already know to get a gravatar from their use of WordPress.
[...] Gravatar Box is a perfect solution if you don’t want to get your hands at all dirty with jQuery. All you [...]
Fantastic. It’s one of those things that I never realised I wanted to do until someone wrote a plugin for it.
Now, I had to post a comment here just to test it.
Testing to see what it looks like when it works… ;o)
testing to
this plugin is great, thanks
just testing …
Testing..
Nice Job!
cool plugin
Got it working on my website. Thanks so much for that.
I did not know about gravatars but I think I’m starting to love it.
For those of you newbies like me, you will probably want to go to http://www.Gravatar.com to create your picture. This is actually what immediately recognizces which image to place once you have added an email. Go to the website and you will understand.
On the actual folder on your PLUGINS -> GRAVATAR BOX, you will find a READ ME file which has the code you can copy and paste for your CSS.
All you have to do is replace the link of the gravatar for yours.
[...] Deze plugin voorziet in een simpele voorbeeld weergave van de profielfoto zodra iemand zijn mailadres invoert. Heeft iemand nog geen GRAvatar, dan geeft de plugin dat ook aan en voorziet een link waar de commentator een GRAvatar kan aanvragen. [...]