aboutsummaryrefslogtreecommitdiffstats
path: root/include/network.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/network.php')
-rw-r--r--include/network.php27
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'];
}}