mirror of
https://github.com/silverstripe/silverstripe-comments
synced 2024-10-22 11:05:49 +02:00
ENHANCEMENT: Added gravatar method to get the URL for the gravatar from the email address submitted with the comment
This commit is contained in:
parent
652ddb938f
commit
d4cc737878
@ -394,4 +394,17 @@ class Comment extends DataObject {
|
|||||||
$config->set('URI.DisableExternalResources', true);
|
$config->set('URI.DisableExternalResources', true);
|
||||||
return new HTMLPurifier($config);
|
return new HTMLPurifier($config);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Calcualate the gravatar link from the email address
|
||||||
|
*/
|
||||||
|
public function Gravatar() {
|
||||||
|
$gravatar = '';
|
||||||
|
$use_gravatar = Commenting::get_config_value($this->BaseClass, 'use_gravatar');
|
||||||
|
if ($use_gravatar) {
|
||||||
|
$gravatar = "http://www.gravatar.com/avatar/" . md5( strtolower(trim($this->Email)));
|
||||||
|
}
|
||||||
|
|
||||||
|
return $gravatar;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user