Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
Static Public Member Functions | List of all members
Gravatar Class Reference

Static Public Member Functions

static getImage ($email, $schema= 'http', $s=80, $d= 'mm', $r= 'g', $img=false, $atts=array())

Detailed Description

Created by JetBrains PhpStorm. User: andrew Date: 6/26/12 Time: 11:29 AM To change this template use File | Settings | File Templates.

Definition at line 9 of file Gravatar.php.

Member Function Documentation

static Gravatar::getImage (   $email,
  $schema = 'http',
  $s = 80,
  $d = 'mm',
  $r = 'g',
  $img = false,
  $atts = array() 
)
static

Get either a Gravatar URL or complete image tag for a specified email address.

Parameters
string$emailThe email address
int | string$sSize in pixels, defaults to 80px [ 1 - 512 ]
string$dDefault imageset to use [ 404 | mm | identicon | monsterid | wavatar ]
string$rMaximum rating (inclusive) [ g | pg | r | x ]
bool$imgTrue to return a complete IMG tag False for just the URL
array$attsOptional, additional key/value attributes to include in the IMG tag
string$schema
Returns
String containing either just a URL or a complete image tag http://gravatar.com/site/implement/images/php/

Definition at line 24 of file Gravatar.php.

Referenced by CommentsListWidget\getAvatar().

{
$url = "$schema://www.gravatar.com/avatar/";
$url .= md5(strtolower(trim($email)));
$url .= "?s=$s&d=$d&r=$r";
if ($img) {
$url = '<img src="' . $url . '"';
foreach ($atts as $key => $val)
$url .= ' ' . $key . '="' . $val . '"';
$url .= ' />';
}
return $url;
}

The documentation for this class was generated from the following file: