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
Using Gravatars In Your Script
<?php
// source: http://www.apphp.com/index.php?snippet=php-using-gravatars-in-your-script
function show_my_gravatar($email, $size, $default, $rating)
{
$params = '?gravatar_id='.md5($email).'&default='.$default.'&size='.$size.'&rating='.$rating;
$output = '<img src="http://www.gravatar.com/avatar.php'.$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.






Comments
Michael Molo replied on Thu, 2013/02/21 - 1:34am
http://www.gather.com/viewArticle.action?articleId=281474978263030