The power of Globally Recognized Avatar (aka Gravatar)

How to, PHP, Resources, Reviews, Tips and Tricks, Tutorials
Gravatar has a very sleak concept but not many people know and understand it. It is one place for your display pictures and you can use the same at any Gravatar enabled website / application. Gravatar is currently used in Wordpress, Movable Type, Drupal, Joomla and Mac OS X Addressbook. Advantages are mainly on the user end where he/she can change one photo and reflect it in multiple places. It includes support for content-rating etc. Here, I will show how it is implemented in PHP [php] $email = "my-email@hotmail.com"; $default = "http://www.somewhere.com/homestar.jpg"; $size = 100; $grav_url = "http://www.gravatar.com/avatar.php?gravatar_id=".md5(strtolower($email)). "&default=".urlencode($default). "&size=".$size; [/php] Now use it in your HTML as [sourcecode language="xml"]<img src="<?php echo $grav_url; ?/>" width="< ?php echo $size; ?>" alt="Gravatar" />[/sourcecode] Simple!! More info at the URLs below http://en.gravatar.com/site/implement/ http://en.gravatar.com/site/implement/php…
Read More