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