diff options
author | David King <imkingdavid@gmail.com> | 2012-05-25 18:18:27 -0400 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2012-08-01 10:18:48 +0200 |
commit | 6059bc7b45a098e4bc846fe3704543137cc1aba1 (patch) | |
tree | c575eaf74c209e49012904b3f2e8472a7f475459 | |
parent | c51e8716c5a2d0f5efc02abb7de08cab087f9442 (diff) | |
download | forums-6059bc7b45a098e4bc846fe3704543137cc1aba1.tar forums-6059bc7b45a098e4bc846fe3704543137cc1aba1.tar.gz forums-6059bc7b45a098e4bc846fe3704543137cc1aba1.tar.bz2 forums-6059bc7b45a098e4bc846fe3704543137cc1aba1.tar.xz forums-6059bc7b45a098e4bc846fe3704543137cc1aba1.zip |
[feature/events] Added core.user_default_avatar event
This way, extension authors can overwrite the empty value returned
when a user does not have an avatar with a default value to display
instead of nothing in the avatar space.
PHPBB3-9550
-rw-r--r-- | phpBB/includes/functions_display.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 003724a8f5..53a07d5591 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -1267,10 +1267,19 @@ function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $alt = 'USER_AVATAR', $ignore_config = false) { global $user, $config, $phpbb_root_path, $phpEx; + global $phpbb_dispatcher; if (empty($avatar) || !$avatar_type || (!$config['allow_avatar'] && !$ignore_config)) { - return ''; + $empty_avatar = ''; + if ($config['allow_avatar'] || $ignore_config) + { + // This allows extensions to change the default return when no avatar is given + // Useful for default avatars + $vars = array('empty_avatar'); + extract($phpbb_dispatcher->trigger_event('core.user_default_avatar', compact($vars))); + } + return $empty_avatar; } $avatar_img = ''; |