Created
August 28, 2017 05:52
-
-
Save abedputra/094ca4fbe044a3425b28789da747613f to your computer and use it in GitHub Desktop.
Simple load a gravatar php
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 | |
//Simple load a gravatar php. | |
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