diff options
author | Igor Wiedler <igor@wiedler.ch> | 2012-04-08 21:45:51 +0200 |
---|---|---|
committer | Igor Wiedler <igor@wiedler.ch> | 2012-04-08 21:45:51 +0200 |
commit | a1132fc5c7e990d73cbc8ac7abf4502a1bbe7216 (patch) | |
tree | 1a095e1fe8155adfc572d411cbe74639274c3d6f /phpBB/includes/functions_display.php | |
parent | 3b71e81cfba726043063b05cb793e18186143252 (diff) | |
download | forums-a1132fc5c7e990d73cbc8ac7abf4502a1bbe7216.tar forums-a1132fc5c7e990d73cbc8ac7abf4502a1bbe7216.tar.gz forums-a1132fc5c7e990d73cbc8ac7abf4502a1bbe7216.tar.bz2 forums-a1132fc5c7e990d73cbc8ac7abf4502a1bbe7216.tar.xz forums-a1132fc5c7e990d73cbc8ac7abf4502a1bbe7216.zip |
[feature/avatars] Update avatars in database_update
PHPBB3-10018
Diffstat (limited to 'phpBB/includes/functions_display.php')
-rw-r--r-- | phpBB/includes/functions_display.php | 70 |
1 files changed, 13 insertions, 57 deletions
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 619c30ada5..291d92387f 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -1325,72 +1325,28 @@ function get_avatar($row, $alt, $ignore_config = false) 'width' => $row['avatar_width'], 'height' => $row['avatar_height'], ); - - switch ($row['avatar_type']) - { - case AVATAR_UPLOAD: - // Compatibility with old avatars - if (!$config['allow_avatar_upload'] && !$ignore_config) - { - $avatar_data['src'] = ''; - } - else - { - $avatar_data['src'] = $phpbb_root_path . "download/file.$phpEx?avatar=" . $avatar_data['src']; - $avatar_data['src'] = str_replace(' ', '%20', $avatar_data['src']); - } - break; - case AVATAR_GALLERY: - // Compatibility with old avatars - if (!$config['allow_avatar_local'] && !$ignore_config) - { - $avatar_data['src'] = ''; - } - else - { - $avatar_data['src'] = $phpbb_root_path . $config['avatar_gallery_path'] . '/' . $avatar_data['src']; - $avatar_data['src'] = str_replace(' ', '%20', $avatar_data['src']); - } - break; - - case AVATAR_REMOTE: - // Compatibility with old avatars - if (!$config['allow_avatar_remote'] && !$ignore_config) - { - $avatar_data['src'] = ''; - } - else - { - $avatar_data['src'] = str_replace(' ', '%20', $avatar_data['src']); - } - break; + $avatar = $phpbb_avatar_manager->get_driver($row['avatar_type']); - default: - $avatar = $phpbb_avatar_manager->get_driver($row['avatar_type']); - - if ($avatar) - { - if ($avatar->custom_html) - { - return $avatar->get_html($row, $ignore_config); - } - - $avatar_data = $avatar->get_data($row, $ignore_config); - } - else - { - $avatar_data['src'] = ''; - } + if ($avatar) + { + if ($avatar->custom_html) + { + return $avatar->get_html($row, $ignore_config); + } - break; + $avatar_data = $avatar->get_data($row, $ignore_config); + } + else + { + $avatar_data['src'] = ''; } $html = ''; if (!empty($avatar_data['src'])) { - $html = '<img src="' . $avatar_data['src'] . '" ' . + $html = '<img src="' . $avatar_data['src'] . '" ' . ($avatar_data['width'] ? ('width="' . $avatar_data['width'] . '" ') : '') . ($avatar_data['height'] ? ('height="' . $avatar_data['height'] . '" ') : '') . 'alt="' . ((!empty($user->lang[$alt])) ? $user->lang[$alt] : $alt) . '" />'; |