configurability for avatars
This commit is contained in:
parent
82bf804fad
commit
159a862c02
@ -131,9 +131,13 @@ class User {
|
||||
*/
|
||||
public function get_avatar_html() {
|
||||
// FIXME: configurable
|
||||
if(!empty($this->email)) {
|
||||
$hash = md5(strtolower($this->email));
|
||||
return "<img src=\"http://www.gravatar.com/avatar/$hash.jpg\">";
|
||||
global $config;
|
||||
if($config->get_string("avatar_host") == "gravatar") {
|
||||
if(!empty($this->email)) {
|
||||
$hash = md5(strtolower($this->email));
|
||||
$args = $config->get_string("avatar_gravatar_options");
|
||||
return "<img src=\"http://www.gravatar.com/avatar/$hash.jpg?$args\">";
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
@ -44,6 +44,8 @@ class UserPage extends SimpleExtension {
|
||||
global $config;
|
||||
$config->set_default_bool("login_signup_enabled", true);
|
||||
$config->set_default_int("login_memory", 365);
|
||||
$config->set_default_string("avatar_host", "gravatar");
|
||||
$config->set_default_string("avatar_gravatar_options", "");
|
||||
}
|
||||
|
||||
public function onPageRequest(Event $event) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user