Subscribe

175

Fans

ON FACEBOOK

Search

Email

  • Memphis, TN 38103 U.S.A. Otto 240cf86e-5cad-11dc-8314-0800200c9a66

Facebook

Amazon

Buy Otto a Beer

Currency:

Amount:

Website(Optional):

Get Otto a Gift

My Amazon.com Wish List
Text

Gravatar Box

Note: Plugin page has moved to here: http://ottopress.com/wordpress-plugins/gravatar-box/

Plugin: Gravatar Box
Version: 1.0.3
Last updated: 195 days ago.
Downloaded: 2,743 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

  1. Upload the files to the `/wp-content/plugins/gravbox/` directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Add this to your comments form somewhere:
    <?php if (function_exists('gravbox')) gravbox(); ?>
  4. 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.

Download Now

39 Comments »

39 Comments

  • [...] 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/ [...]

  • Epic Alex says:

    That’s really cool Otto, although it kind of makes a tutorial I was writing redundant!

  • Joe says:

    Excellent plugin. I like it :)

  • Frank says:

    Good one, just a short input: I think you forget to lowercase the email address before MD5ing it.

  • max says:

    this is incredibly awesome, otto! big thanks for creating this plugin, just installed it, works perfectly!

    keep up good work

  • john says:

    Incredibly awesome plug-in

  • amazing tool thanks!!!

  • Rolograaf says:

    Yes, finally got it working, very usefull plugin!

    Lawrence Rolograaf

  • baron says:

    Works great, thank you

  • [...] 当然也可以通过CSS使这个头像出现的更美观些,例如作者博客中的效果。地址在这里,在评论的电子邮件处输入你的电子邮箱看插件效果。 [...]

  • Tate says:

    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

    • Otto says:

      Unfortunately, Intense Debate works differently, in that your comments are controlled by a javascript code. So it won’t work there.

  • Tom Coburn says:

    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.

    • Otto says:

      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 и прочитать подробнее о его настройке вы можете на [...]

  • Ipstenu says:

    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?

    • Otto says:

      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.

      • Ipstenu says:

        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).

        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.

        • Otto says:

          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.

          • Ipstenu says:

            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.

          • NeutralX2 says:

            Is this still something you are considering?

            • Otto says:

              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 [...]

  • John Pope says:

    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.

  • JessaLu says:

    Testing to see what it looks like when it works… ;o)

  • iffi says:

    this plugin is great, thanks

  • WPKid says:

    just testing …

  • karsten says:

    Nice Job!

  • Wendy says:

    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. [...]

  • Vincent says:

    Hi otto, cool plugin,

    however it would be so userfriendly for non coders like me, if you would add a complete ‘out of the box wordpress install form code with gravbox’ because if I just add your plugin, add the code to the form and the to the stylesheet. It just doesn’t work. And being no good at this css stuff, it will take me an hour to make it look like what you have :(

    maybe for nono
    s like me a suggestion would be to add a basic code concept to the readme :D

    furthermore it is of course very neat and now I will fight with the css to get it fixed

    cheers

  • Vincent says:

    I give up on it and am so annoyed being to dumn to get this to work

    would have been nice to have, well maybe some day

  • Vincent says:

    Ok it was a cascading issue :S

    well that took me 45 minutes and some frustration to get going, but now it does

    don’t ask my what cascading made it not work, I am still a dumn in css :)

  • John says:

    Thanks for that plugin but there has to be a better description for noobs. I don’t know how to put that gravatar to the left side.

  • Otto says:

    Note to everybody following this:

    The plugin page for Gravatar Box has moved to here: http://ottopress.com/wordpress.....vatar-box/

    I’m closing comments on this post. Please take any comments to the new site.

Additional comments powered by BackType