diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-11-27 21:33:49 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-11-27 21:33:49 +0000 |
commit | 1f8818d85d8b95d95cb62967f171c99c0735af9e (patch) | |
tree | f504f608135ac242eacf0095f1573496674b2c76 | |
parent | f56c1a85d3582b7052bbbc7b8cca1425651b4933 (diff) | |
download | forums-1f8818d85d8b95d95cb62967f171c99c0735af9e.tar forums-1f8818d85d8b95d95cb62967f171c99c0735af9e.tar.gz forums-1f8818d85d8b95d95cb62967f171c99c0735af9e.tar.bz2 forums-1f8818d85d8b95d95cb62967f171c99c0735af9e.tar.xz forums-1f8818d85d8b95d95cb62967f171c99c0735af9e.zip |
better layed out...
git-svn-id: file:///svn/phpbb/trunk@6677 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r-- | phpBB/includes/functions.php | 23 |
1 files changed, 20 insertions, 3 deletions
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 = '<a href="' . $profile_url . '"' . (($username_colour) ? ' style="color: ' . $username_colour . '; font-weight: bold;"' : '') . '>' . $username . '</a>'; } else { $profile_url = ''; - $full_string = ($username_colour) ? '<span style="color: ' . $username_colour . '; font-weight: bold;">' . $username . '</span>' : $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 = '<span style="color: {USERNAME_COLOUR}; font-weight: bold;">{USERNAME}</span>'; + } + else if ($profile_url && !$username_colour) + { + $tpl = '<a href="{PROFILE_URL}">{USERNAME}</a>'; + } + else if ($profile_url && $username_colour) + { + $tpl = '<a href="{PROFILE_URL}" style="color: {USERNAME_COLOUR}; font-weight: bold;">{USERNAME}</a>'; + } + + return str_replace(array('{PROFILE_URL}', '{USERNAME_COLOUR}', '{USERNAME}'), array($profile_url, $username_colour, $username), $tpl); break; } } |