Created
March 26, 2013 05:04
-
-
Save cherifgx/5243268 to your computer and use it in GitHub Desktop.
With ever increasing popularity of WordPress, Gravatars have become quite popular. It is very easy to integrate them into your application as they provide a very easy to use API.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/****************** | |
*@email - Email address to show gravatar for | |
*@size - size of gravatar | |
*@default - URL of default gravatar to use | |
*@rating - rating of Gravatar(G, PG, R, X) | |
*/ | |
function show_gravatar($email, $size, $default, $rating) | |
{ | |
echo '<img src="http://www.gravatar.com/avatar.php?gravatar_id='.md5($email). | |
'&default='.$default.'&size='.$size.'&rating='.$rating.'" width="'.$size.'px" | |
height="'.$size.'px" />'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment