bludit/kernel/helpers/image.class.php
Diego Najar 29d06b62a3 mac
2015-03-08 14:02:59 -03:00

36 lines
905 B
PHP

<?php
/*
* Nibbleblog -
* http://www.nibbleblog.com
* Author Diego Najar
* All Nibbleblog code is released under the GNU General Public License.
* See COPYRIGHT.txt and LICENSE.txt.
*/
class Image {
/**
* Get either a Gravatar URL or complete image tag for a specified email address.
*
* @param string $email The email address
* @param string $s Size in pixels, defaults to 80px [ 1 - 2048 ]
* @param string $d Default imageset to use [ 404 | mm | identicon | monsterid | wavatar ]
* @param string $r Maximum rating (inclusive) [ g | pg | r | x ]
* @return String containing either just a URL
* @source http://gravatar.com/site/implement/images/php/
*/
public static function get_gravatar($email, $s = 80, $d = 'mm', $r = 'g')
{
$url = 'http://www.gravatar.com/avatar/';
$url .= md5( strtolower( trim( $email ) ) );
$url .= "?s=$s&d=$d&r=$r";
return $url;
}
}
?>