make default profile photo configurable - should be functional but needs admin ui

This commit is contained in:
friendica
2013-12-19 16:33:36 -08:00
parent f8042cc467
commit 7c81889b33
12 changed files with 31 additions and 120 deletions

View File

@@ -1109,3 +1109,24 @@ function get_theme_uid() {
}
return $uid;
}
/**
* @function get_default_profile_photo($size = 175)
* Retrieves the path of the default_profile_photo for this system
* with the specified size.
* @param int $size
* one of (175, 80, 48)
* @returns string
*
*/
function get_default_profile_photo($size = 175) {
$scheme = get_config('system','default_profile_photo');
if(! $scheme)
$scheme = 'rainbow_man';
return 'images/default_profile_photos/' . $scheme . '/' . $size . 'jpg';
}

View File

@@ -548,7 +548,7 @@ function avatar_img($email) {
call_hooks('avatar_lookup', $avatar);
if(! $avatar['success'])
$avatar['url'] = $a->get_baseurl() . '/images/default_profile_photos/rainbow_man/175.jpg';
$avatar['url'] = $a->get_baseurl() . '/' . get_default_profile_photo();
logger('Avatar: ' . $avatar['email'] . ' ' . $avatar['url'], LOGGER_DEBUG);
return $avatar['url'];

View File

@@ -576,9 +576,9 @@ function import_profile_photo($photo,$xchan) {
$photo_failure = true;
}
if($photo_failure) {
$photo = $a->get_baseurl() . '/images/default_profile_photos/rainbow_man/175.jpg';
$thumb = $a->get_baseurl() . '/images/default_profile_photos/rainbow_man/80.jpg';
$micro = $a->get_baseurl() . '/images/default_profile_photos/rainbow_man/48.jpg';
$photo = $a->get_baseurl() . '/' . get_default_profile_photo();
$thumb = $a->get_baseurl() . '/' . get_default_profile_photo(80);
$micro = $a->get_baseurl() . '/' . get_default_profile_photo(48);
$type = 'image/jpeg';
}