westdc-zf1/application/models/Avatar.php

19 lines
364 B
PHP

<?php
class Avatar{
public $def_img = "http://www.gravatar.com/avatar/";
function Get( $email, $size='' ) {
$default = $this->def_img;
if(empty($size))
{
$size = 40;
}
$url = "http://www.gravatar.com/avatar/" . md5( strtolower( trim( $email ) ) ) . "?d=" . urlencode( $default ) . "&s=" . $size;
return $url;
}
}