diff --git a/library/config.php b/library/config.php
index f4a1c54b2..b9ee94631 100644
--- a/library/config.php
+++ b/library/config.php
@@ -388,6 +388,7 @@ $bb_cfg['avatars'] = [
'max_height' => 100, // высота аватара в px
'max_width' => 100, // ширина аватара в px
'no_avatar' => '/gallery/noavatar.png', // дефолтная аватара
+ 'display_path' => '/data/avatars', // путь к директории с аватарами
'upload_path' => BB_PATH . '/data/avatars/', // путь к директории с аватарами
'up_allowed' => true, // разрешить загрузку аватар
];
@@ -399,6 +400,7 @@ $bb_cfg['group_avatars'] = [
'max_height' => 300, // высота аватара в px
'max_width' => 300, // ширина аватара в px
'no_avatar' => '/gallery/noavatar.png', // дефолтная аватара
+ 'display_path' => '/data/avatars', // путь к директории с аватарами
'upload_path' => BB_PATH . '/data/avatars/', // путь к директории с аватарами
'up_allowed' => true, // разрешить загрузку аватар
];
diff --git a/library/includes/functions.php b/library/includes/functions.php
index ef7dc9d77..9861f98a8 100644
--- a/library/includes/functions.php
+++ b/library/includes/functions.php
@@ -50,7 +50,7 @@ function get_attach_path($id, $ext_id = '', $base_path = null, $first_div = 1000
function delete_avatar($user_id, $avatar_ext_id)
{
- $avatar_file = ($avatar_ext_id) ? get_avatar_path($user_id, $avatar_ext_id) : '';
+ $avatar_file = $avatar_ext_id ? get_avatar_path($user_id, $avatar_ext_id) : '';
return ($avatar_file && file_exists($avatar_file)) ? @unlink($avatar_file) : false;
}
@@ -72,7 +72,7 @@ function get_tracks($type)
trigger_error(__FUNCTION__ . ": invalid type '$type'", E_USER_ERROR);
}
$tracks = !empty($_COOKIE[$c_name]) ? @unserialize($_COOKIE[$c_name]) : false;
- return ($tracks) ?: array();
+ return $tracks ?: [];
}
function set_tracks($cookie_name, &$tracking_ary, $tracks = null, $val = TIMENOW)
@@ -2032,13 +2032,13 @@ function get_avatar($user_id, $ext_id, $allow_avatar = true, $size = true, $heig
$height = !$height ? 'height="' . $height . '"' : '';
$width = !$width ? 'width="' . $width . '"' : '';
- $user_avatar = '';
+ $user_avatar = '
';
if ($user_id == BOT_UID && $bb_cfg['avatars']['bot_avatar']) {
- $user_avatar = '
';
+ $user_avatar = '
';
} elseif ($allow_avatar && $ext_id) {
if (file_exists(get_avatar_path($user_id, $ext_id))) {
- $user_avatar = '
';
+ $user_avatar = '
';
}
}
diff --git a/styles/templates/default/group_edit.tpl b/styles/templates/default/group_edit.tpl
index e66ce14ac..d6b687eb8 100644
--- a/styles/templates/default/group_edit.tpl
+++ b/styles/templates/default/group_edit.tpl
@@ -80,11 +80,11 @@ function manage_group(mode, value) {