DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Chara has posted 50 posts at DZone. View Full User Profile

Using Gravatars In Your Script

  • submit to reddit
// source:
function show_my_gravatar($email, $size, $default, $rating)
  $params = '?gravatar_id='.md5($email).'&default='.$default.'&size='.$size.'&rating='.$rating;
  $output = '<img src="'.$params.'" width="'.$size.'px" height="'.$size.'px" />';
  echo $output;

  With increasing of popularity of WordPress script, Gravatars have become a rellay quite popular. Now you may easy integrate them into your own script as they provide a very easy to use API.


Michael Molo replied on Thu, 2013/02/21 - 1:34am