Created
March 31, 2015 16:00
-
-
Save unnikked/9c1c2fec57d219564208 to your computer and use it in GitHub Desktop.
Show gravatar from user email
This file contains 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