diff options
author | Michael <icarus@dabo.de> | 2012-04-11 18:48:58 +0200 |
---|---|---|
committer | Michael <icarus@dabo.de> | 2012-04-11 18:48:58 +0200 |
commit | 39405c8056b4a1d55c97fb2963d8776695dbeb30 (patch) | |
tree | c9f89ba0e9aacee343cf50b6b8a64468bb8db694 /include/network.php | |
parent | c3139fa0fd49b0b4de4568d46a6946c75ccb2a62 (diff) | |
parent | cdb6510b9f3007d2afd3081313caa7d045af1e7c (diff) | |
download | volse-hubzilla-39405c8056b4a1d55c97fb2963d8776695dbeb30.tar.gz volse-hubzilla-39405c8056b4a1d55c97fb2963d8776695dbeb30.tar.bz2 volse-hubzilla-39405c8056b4a1d55c97fb2963d8776695dbeb30.zip |
Merge remote branch 'upstream/master'
Diffstat (limited to 'include/network.php')
-rw-r--r-- | include/network.php | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/include/network.php b/include/network.php index 38d0980d5..23ef50b21 100644 --- a/include/network.php +++ b/include/network.php @@ -692,18 +692,23 @@ function allowed_email($email) { }} -if(! function_exists('gravatar_img')) { -function gravatar_img($email) { - $size = 175; - $opt = 'identicon'; // psuedo-random geometric pattern if not found - $rating = 'pg'; - $hash = md5(trim(strtolower($email))); - - $url = 'http://www.gravatar.com/avatar/' . $hash . '.jpg' - . '?s=' . $size . '&d=' . $opt . '&r=' . $rating; +if(! function_exists('avatar_img')) { +function avatar_img($email) { + + $a = get_app(); + + $avatar['size'] = 175; + $avatar['email'] = $email; + $avatar['url'] = ''; + $avatar['success'] = false; + + call_hooks('avatar_lookup', $avatar); + + if(! $avatar['success']) + $avatar['url'] = $a->get_baseurl() . '/images/person-175.jpg'; - logger('gravatar: ' . $email . ' ' . $url); - return $url; + logger('Avatar: ' . $avatar['email'] . ' ' . $avatar['url'], LOGGER_DEBUG); + return $avatar['url']; }} |