2

I have been looking arund at implementing Gravatar for all my users profile pictures but I am a little confused about one or two things.

Imagine, like this site, I have a current user who is not registered with gravatar. In order to give them a gravatar, do I have to tell them to register with gravatar separately or is there a API function that will register them if they do not yet exist?

Also I only ever see getting information from gravatar but I do not very often see putting information to their services, like a new avatar. Is there functions for putting data to their servers?

Rod
  • 52,748
  • 3
  • 38
  • 55
Sammaye
  • 43,242
  • 7
  • 104
  • 146

2 Answers2

2

Normally, you'd use one of the default image options (see http://en.gravatar.com/site/implement/images/). If a gravatar doesn't exist one will be provided based on your settings (until the user actually selects / creates a gravatar). I'd keep the uploading of images on their site, but you could use their xml-rpc api

Wrikken
  • 69,272
  • 8
  • 97
  • 136
  • Ok kool that's cleared that up. I also realised wordpress redirects you to gravatar if you wish to edit your avatar. thanks :) – Sammaye Nov 04 '10 at 12:49
  • Is there any option you've found to not have to force the users to Gravatar for signing up? Is there an API for that? I wouldn't want the extra step of pushing to their signup site. – Daniel Trimble Mar 11 '16 at 13:20
0

Put an image tag use the source similar to these

<img src="http://www.gravatar.com/avatar/<?php echo md5($_POST['email']);?>
Rod
  • 52,748
  • 3
  • 38
  • 55
dhruba
  • 1
  • @Rod Even though it is unclear what he is saying I do understand because I have done this myself. You can access the gravatar url via a md5 hash of the email you are looking for. Though yes, the answer needs cleaning up – Sammaye Feb 07 '13 at 14:47
  • @Sammaye, I have corrected the answer to show the html code that was hidden. Forget my first comment. – Rod Feb 07 '13 at 14:52
  • @Rod Ah ok kool I see it now :) – Sammaye Feb 07 '13 at 14:59