Get a users gravatar from their email address


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. /******************
  2. *@email - Email address to show gravatar for
  3. *@size - size of gravatar
  4. *@default - URL of default gravatar to use
  5. *@rating - rating of Gravatar(G, PG, R, X)
  6. */
  7. function show_gravatar($email, $size, $default, $rating)
  8. {
  9. echo '<img src="http://www.gravatar.com/avatar.php?gravatar_id='.md5($email).
  10. '&default='.$default.'&size='.$size.'&rating='.$rating.'" width="'.$size.'px"
  11. height="'.$size.'px" />';
  12. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.