aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_display.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2009-06-19 22:03:19 +0000
committerJoas Schilling <nickvergessen@gmx.de>2009-06-19 22:03:19 +0000
commitd85a5ad036b2088fe742de29d9464678d2e19e23 (patch)
tree9bbd990b2baea05723f64cbcc26ecd39669bf464 /phpBB/includes/functions_display.php
parent6e884de00060c3632e1e7fa25c84c4e602fd46e8 (diff)
downloadforums-d85a5ad036b2088fe742de29d9464678d2e19e23.tar
forums-d85a5ad036b2088fe742de29d9464678d2e19e23.tar.gz
forums-d85a5ad036b2088fe742de29d9464678d2e19e23.tar.bz2
forums-d85a5ad036b2088fe742de29d9464678d2e19e23.tar.xz
forums-d85a5ad036b2088fe742de29d9464678d2e19e23.zip
Fix bug #46785 - Hide avatars if type disabled and give global option to turn on/off
Authorised by: acydburn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9632 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_display.php')
-rw-r--r--phpBB/includes/functions_display.php20
1 files changed, 18 insertions, 2 deletions
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index fdcc118269..8fa9a5677f 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -1200,14 +1200,15 @@ function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank
* @param string $avatar_width Width of users avatar
* @param string $avatar_height Height of users avatar
* @param string $alt Optional language string for alt tag within image, can be a language key or text
+* @param bool $ignore_config Ignores the config-setting, to be still able to view the avatar in the UCP
*
* @return string Avatar image
*/
-function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $alt = 'USER_AVATAR')
+function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $alt = 'USER_AVATAR', $ignore_config = false)
{
global $user, $config, $phpbb_root_path, $phpEx;
- if (empty($avatar) || !$avatar_type)
+ if (empty($avatar) || !$avatar_type || (!$config['allow_avatar'] && !$ignore_config))
{
return '';
}
@@ -1217,12 +1218,27 @@ function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $
switch ($avatar_type)
{
case AVATAR_UPLOAD:
+ if (!$config['allow_avatar_upload'] && !$ignore_config)
+ {
+ return '';
+ }
$avatar_img = $phpbb_root_path . "download/file.$phpEx?avatar=";
break;
case AVATAR_GALLERY:
+ if (!$config['allow_avatar_local'] && !$ignore_config)
+ {
+ return '';
+ }
$avatar_img = $phpbb_root_path . $config['avatar_gallery_path'] . '/';
break;
+
+ case AVATAR_REMOTE:
+ if (!$config['allow_avatar_remote'] && !$ignore_config)
+ {
+ return '';
+ }
+ break;
}
$avatar_img .= $avatar;