Book Image

concrete5 Beginner's Guide

Book Image

concrete5 Beginner's Guide

Overview of this book

Table of Contents (19 chapters)
concrete5
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Gravatar picture in guestbook


Gravatar is a widely used service to include a thumbnail of a person. It's a feature often used in blogs to display a face next to a comment. Internet users upload their picture at http://en.gravatar.com/ and assign it to their e-mail address.

The application can then generate an md5 hash by using this e-mail address and can display an image of them, without exposing the actual mail address.

This procedure works with PHP like it does with any language where you can generate an md5 hash:

$gravatarHash = md5(strtolower(trim('[email protected]')));
echo "<img src=\"http://www.gravatar.com/avatar/{$gravatarHash}\" />";

Let's add that feature to the guestbook block.