aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_display.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2007-04-12 16:20:39 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2007-04-12 16:20:39 +0000
commitb63745fdb3b775d7505f38ed03a8bb39907a825c (patch)
tree3c2bc96535a30d66df3fdf6b3307be469d4362bd /phpBB/includes/functions_display.php
parentf0868d37dfd73df6c2dfd76362af6c09b6b49a5f (diff)
downloadforums-b63745fdb3b775d7505f38ed03a8bb39907a825c.tar
forums-b63745fdb3b775d7505f38ed03a8bb39907a825c.tar.gz
forums-b63745fdb3b775d7505f38ed03a8bb39907a825c.tar.bz2
forums-b63745fdb3b775d7505f38ed03a8bb39907a825c.tar.xz
forums-b63745fdb3b775d7505f38ed03a8bb39907a825c.zip
my take on getting the bugs down... thanks to those also providing (usable) solutions to the problem. ;) Of course also to those reporting generally...
git-svn-id: file:///svn/phpbb/trunk@7330 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_display.php')
-rw-r--r--phpBB/includes/functions_display.php39
1 files changed, 38 insertions, 1 deletions
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index 23e2cd4106..01f694afd1 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -706,7 +706,7 @@ function topic_status(&$topic_row, $replies, $unread_topic, &$folder_img, &$fold
{
$topic_type = $user->lang['VIEW_TOPIC_MOVED'];
$folder_img = 'topic_moved';
- $folder_alt = 'VIEW_TOPIC_MOVED';
+ $folder_alt = 'TOPIC_MOVED';
}
else
{
@@ -1096,4 +1096,41 @@ function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank
}
}
+/**
+* Get user avatar
+*
+* @param string $avatar Users assigned avatar name
+* @param int $avatar_type Type of avatar
+* @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
+*
+* @return string Avatar image
+*/
+function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $alt = 'USER_AVATAR')
+{
+ global $user, $config, $phpbb_root_path;
+
+ if (empty($avatar) || !$avatar_type)
+ {
+ return '';
+ }
+
+ $avatar_img = '';
+
+ switch ($avatar_type)
+ {
+ case AVATAR_UPLOAD:
+ $avatar_img = $phpbb_root_path . $config['avatar_path'] . '/';
+ break;
+
+ case AVATAR_GALLERY:
+ $avatar_img = $phpbb_root_path . $config['avatar_gallery_path'] . '/';
+ break;
+ }
+
+ $avatar_img .= $avatar;
+ return '<img src="' . $avatar_img . '" width="' . $avatar_width . '" height="' . $avatar_height . '" alt="' . ((!empty($user->lang[$alt])) ? $user->lang[$alt] : $alt) . '" />';
+}
+
?> \ No newline at end of file