diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 5c2b524fcf..9c8163bd14 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2810,12 +2810,10 @@ function get_username_string($mode, $user_id, $username, $username_colour = '', { $profile_url = ($custom_profile_url !== false) ? $custom_profile_url : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile'); $profile_url .= '&u=' . (int) $user_id; - $full_string = '' . $username . ''; } else { $profile_url = ''; - $full_string = ($username_colour) ? '' . $username . '' : $username; } switch ($mode) @@ -2834,7 +2832,26 @@ function get_username_string($mode, $user_id, $username, $username_colour = '', case 'full': default: - return $full_string; + + $tpl = ''; + if (!$profile_url && !$username_colour) + { + $tpl = '{USERNAME}'; + } + else if (!$profile_url && $username_colour) + { + $tpl = '{USERNAME}'; + } + else if ($profile_url && !$username_colour) + { + $tpl = '{USERNAME}'; + } + else if ($profile_url && $username_colour) + { + $tpl = '{USERNAME}'; + } + + return str_replace(array('{PROFILE_URL}', '{USERNAME_COLOUR}', '{USERNAME}'), array($profile_url, $username_colour, $username), $tpl); break; } }