Gravatar support added

After reading about it all around the web, especially on Chu Yeow’s blog I thought maybe I should support this, too. So I downloaded the WordPress plugin and followed the instructions. It was up and running in no time. Nontheless I still had some problems due to the fact that as soon as you enter one no-default parameter it starts to mess up the validation of your document (or at least of my document).

So I went on and hacked a little:

Original version:

[php]

if($rating && $rating != ”)
$out .= “&rating=”.$rating;
if($size && $size != ”)
$out .=”&size=”.$size;
if($default && $default != ”)
$out .= “&default=”.urlencode($default);
if($border && $border != ”)
$out .= “&border=”.$border;

[/php]

Version with correction:

[php] …
if($rating && $rating != ”)
$out .= “&rating=”.$rating;
if($size && $size != ”)
$out .=”&size=”.$size;
if($default && $default != ”)
$out .= “&default=”.urlencode($default);
if($border && $border != ”)
$out .= “&border=”.$border;

[/php]

As those arguments weren’t escaped properly I had 20 errors – now 0

So, check out the comment of any post now and you will find the gravatar of the comment author if (s)he has got one or the standard gravatar I created (will maybe be replaced later on with something “cooler”).
standard gravatar I created

If you don’t know what a Gravatar is yet check out gravatar.com and get yours ;-)

3 thoughts on “Gravatar support added

  1. Pingback: marc's weblog » Jetzt Gravatare für Comments!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.