Merge pull request #57 from jaredkipe/master

FIX: Full Gravatar API implementation.
This commit is contained in:
Will Rossiter 2013-03-26 21:28:44 -07:00
commit 0711ce5913
2 changed files with 6 additions and 2 deletions

View File

@ -28,6 +28,8 @@ class Commenting {
'include_js' => true, // Enhance operation by ajax behaviour on moderation links
'use_gravatar' => false, // set to true to show gravatar icons,
'gravatar_size' => 80, // size of gravatar in pixels. This is the same as the standard default
'gravatar_default' => 'identicon', // theme for 'not found' gravatar (see http://gravatar.com/site/implement/images/)
'gravatar_rating' => 'g', // gravatar rating. This is the same as the standard default
'show_comments_when_disabled' => false, // when comments are disabled should we show older comments (if available)
'order_comments_by' => "\"Created\" DESC",
'comments_per_page' => 10,
@ -176,4 +178,4 @@ class Commenting {
return true;
}
}
}

View File

@ -404,7 +404,9 @@ class Comment extends DataObject {
if ($use_gravatar) {
$gravatar = "http://www.gravatar.com/avatar/" . md5( strtolower(trim($this->Email)));
$gravatarsize = Commenting::get_config_value($this->BaseClass, 'gravatar_size');
$gravatar.= "?s=".$gravatarsize."&d=mm";
$gravatardefault = Commenting::get_config_value($this->BaseClass, 'gravatar_default');
$gravatarrating = Commenting::get_config_value($this->BaseClass, 'gravatar_rating');
$gravatar.= "?s=".$gravatarsize."&d=".$gravatardefault."&r=".$gravatarrating;
}
return $gravatar;