Very nice, sketchMedia!
You need to place the code in a file that ends in the extension
.php to begin with. After that, include the main file like so:
php Code:
include_once('./TalkPHP_Gravatar.php');
Then set the details for the avatar you wish to bring back using the following code:
php Code:
$pAvatar = new TalkPHP_Gravatar();
$pAvatar->setEmail('adam@talkphp.com')->setSize(80);
Where the email address (
adam@talkphp.com) is the email address of the user corresponding to their Gravatar account, and size is the pixels square. Finally, still in a file ending in
.php add an image to the page which will use the information set above to display the correct image:
php Code:
<img src="<?php echo $pAvatar->getAvatar(); ?>" />
I hope this helps you. If not, please do keep asking questions!