mirror of
https://github.com/friendica/friendica
synced 2025-04-25 10:30:12 +00:00
Remove Gravatar from core and add new hook avatar_lookup.
This patch removes all occurances of Gravatar from friendica's core and adds a new hook "avatar_lookup" inside the function avatar_img($email) where the new *avatar-plugins should hook in. I haven't touched the language files yet. Are they updated automatically somehow?
This commit is contained in:
parent
93ffba58cc
commit
1f9fe8b5ee
6 changed files with 18 additions and 34 deletions
|
@ -694,16 +694,14 @@ function allowed_email($email) {
|
|||
|
||||
if(! function_exists('avatar_img')) {
|
||||
function avatar_img($email) {
|
||||
$size = 175;
|
||||
$opt = 'identicon'; // psuedo-random geometric pattern if not found
|
||||
$rating = 'pg';
|
||||
$hash = md5(trim(strtolower($email)));
|
||||
$avatar['size'] = 175;
|
||||
$avatar['email'] = $email;
|
||||
$avatar['url'] = '';
|
||||
|
||||
$url = 'http://www.gravatar.com/avatar/' . $hash . '.jpg'
|
||||
. '?s=' . $size . '&d=' . $opt . '&r=' . $rating;
|
||||
call_hooks('avatar_lookup', $avatar);
|
||||
|
||||
logger('gravatar: ' . $email . ' ' . $url);
|
||||
return $url;
|
||||
logger('Avatar: ' . $avatar['email'] . ' ' . $avatar['url']);
|
||||
return $avatar['url'];
|
||||
}}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue