After a lot of staring at it, seems this is the best way to handle the gravatar code in your template: chunk.comment.inc.html
This fixes problems with either the Guest EMail works or the Registered User EMail works but not both by checking to see if the comment was left by a Registered User and providing the correct gravatar ’call’ based on that (works great on my site).
Place this code where you want the gravatar to appear (Jot Call)...
[+comment.createdby:isnt=`0`:then=`<img src="[+comment.createdby:userinfo=`email`:gravatar+]" alt="gravatar" />`:else=`<br /><img src="[+comment.custom.email:gravatar+]" alt="gravatar" />`+]
Use the phx:gravatar snippet from these posts as shown here...
$size = 80;
$rating = R;
$email = '[email protected]';
$newvalue= "http://www.gravatar.com/avatar.php?
gravatar_id=".md5(strtolower($output)).
"&default=".urlencode($default).
"&size=".$size.
"&rating=".$rating;
return $newvalue;
Notice I left the $default variable out, at least on my setup I get a ’red-x’ when I try to pass a default image, not sure why because if I copy the image properties (URL) to a new window it does show the default image I am passing. In any case, by removing it you simply get the default gravatar ’G’ for users without a gravatar, which is better than the ’red-x’.
If anyone has/had the same problem passing the default image and figured out how to fix it PLEASE let me know how...
You can see the gravatar code working here:
South Florida StormWatch