View Single Post
Old 01-08-2009, 02:36 AM   #28 (permalink)
Wildhoney
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,258
Thanks: 90
Wildhoney is on a distinguished road
Default

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!
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote