My favorites | Sign in
Project Home Downloads Wiki Source
Search
for
Rych_Gravatar  
Description of the Rych_Gravatar component
Updated Aug 11, 2010 by rchouinard

Rych_Gravatar

Gravatar provides a simple service for cross-site avatars. The gravatar component is simply an interface for generating the proper URI for a gravatar image based on a user's email address.

<?php

$gravatar = new Rych_Gravatar;
$gravatar
  ->setDefault(Rych_Gravatar::DEFAULT_WAVATAR)
  ->setRating(Rych_Gravatar::RATING_G)
  ->setSize(80);

// Build a quick list of user avatars
echo '<ul>';
foreach ($users as $user) {
  echo '<li><img src="';
  echo $gravatar->getUri($user->emailAddress);
  echo '" width="80" height="80" alt="Profile pic"></li>';
}
echo '</ul>';

Sign in to add a comment
Powered by Google Project Hosting