By furley
This is a package for FuelPHP that makes gravatar retrieval easier. Essentially this allows you to build the url of a gravatar based solely on an email address.
-
drop the gravatar folder into your packages folder
-
add gravatar to your config file
fuel/app/config/config.php
'packages' => array( 'gravatar' ),
-
???
-
Profit
Pass in an email address and this method will return the url of a gravatar if there is a gravatar associated with email address. Otherwise, it will return the url of the default gravatar.
echo get_gravatar('[email protected]');
There is also an optional second parameter for modifying the defaults of this package. Options include the following:
$options = array();
$options['rating'] = 'X'; // maximum allowed rating. accepts: G | PG | R | X
$options['size'] = 80; // size of image
$options['image'] = 'http://www.gravatar.com/avatar/00000000000000000000000000000000'; // url of default image
echo get_gravatar('[email protected]', $options);
Cheers.