Created
November 27, 2012 07:08
-
-
Save itsbalamurali/4152871 to your computer and use it in GitHub Desktop.
Simple PHP Gravatar Function
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 | |
/** | |
Load a gravatar. | |
*/ | |
function gravatar($email = '', $rating = 'pg') { | |
$default = "path/to/defava.png"; // Set a Default Avatar | |
$email = md5(strtolower(trim($email))); | |
$gravurl = "http://www.gravatar.com/avatar/$email?d=$default&s=60&r=$rating"; | |
return '<img src="'.$gravurl.'" width="60" height="60" border="0" alt="Avatar">'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment