aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/includes/functions.php87
-rw-r--r--phpBB/includes/functions_compatibility.php2
-rw-r--r--phpBB/includes/functions_display.php86
-rw-r--r--phpBB/includes/mcp/mcp_notes.php2
-rw-r--r--phpBB/includes/mcp/mcp_warn.php4
-rw-r--r--phpBB/includes/ucp/ucp_pm_viewmessage.php2
-rw-r--r--phpBB/includes/ucp/ucp_profile.php2
-rw-r--r--phpBB/memberlist.php7
-rw-r--r--phpBB/styles/prosilver/template/overall_header.html2
-rw-r--r--phpBB/styles/prosilver/theme/common.css7
-rw-r--r--phpBB/viewtopic.php4
11 files changed, 111 insertions, 94 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 4d962db308..c6ae3828f5 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -4620,6 +4620,92 @@ function phpbb_build_hidden_fields_for_query_params($request, $exclude = null)
}
/**
+* Get user avatar
+*
+* @param array $user_row Row from the users table
+* @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 html
+*/
+function phpbb_get_user_avatar($user_row, $alt = 'USER_AVATAR', $ignore_config = false)
+{
+ $row = \phpbb\avatar\manager::clean_row($user_row, 'user');
+ return phpbb_get_avatar($row, $alt, $ignore_config);
+}
+
+/**
+* Get group avatar
+*
+* @param array $group_row Row from the groups table
+* @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 html
+*/
+function phpbb_get_group_avatar($user_row, $alt = 'GROUP_AVATAR', $ignore_config = false)
+{
+ $row = \phpbb\avatar\manager::clean_row($user_row, 'group');
+ return phpbb_get_avatar($row, $alt, $ignore_config);
+}
+
+/**
+* Get avatar
+*
+* @param array $row Row cleaned by \phpbb\avatar\driver\driver::clean_row
+* @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 html
+*/
+function phpbb_get_avatar($row, $alt, $ignore_config = false)
+{
+ global $user, $config, $cache, $phpbb_root_path, $phpEx;
+ global $request;
+ global $phpbb_container;
+
+ if (!$config['allow_avatar'] && !$ignore_config)
+ {
+ return '';
+ }
+
+ $avatar_data = array(
+ 'src' => $row['avatar'],
+ 'width' => $row['avatar_width'],
+ 'height' => $row['avatar_height'],
+ );
+
+ $phpbb_avatar_manager = $phpbb_container->get('avatar.manager');
+ $driver = $phpbb_avatar_manager->get_driver($row['avatar_type'], $ignore_config);
+ $html = '';
+
+ if ($driver)
+ {
+ $html = $driver->get_custom_html($user, $row, $alt);
+ if (!empty($html))
+ {
+ return $html;
+ }
+
+ $avatar_data = $driver->get_data($row, $ignore_config);
+ }
+ else
+ {
+ $avatar_data['src'] = '';
+ }
+
+ if (!empty($avatar_data['src']))
+ {
+ $html = '<img src="' . $avatar_data['src'] . '" ' .
+ ($avatar_data['width'] ? ('width="' . $avatar_data['width'] . '" ') : '') .
+ ($avatar_data['height'] ? ('height="' . $avatar_data['height'] . '" ') : '') .
+ 'alt="' . ((!empty($user->lang[$alt])) ? $user->lang[$alt] : $alt) . '" />';
+ }
+
+ return $html;
+}
+
+/**
* Generate page header
*/
function page_header($page_title = '', $display_online_list = false, $item_id = 0, $item = 'forum')
@@ -4830,6 +4916,7 @@ function page_header($page_title = '', $display_online_list = false, $item_id =
// The following assigns all _common_ variables that may be used at any point in a template.
$template->assign_vars(array(
+ 'CURRENT_USER_AVATAR' => phpbb_get_user_avatar($user->data),
'SITENAME' => $config['sitename'],
'SITE_DESCRIPTION' => $config['site_desc'],
'PAGE_TITLE' => $page_title,
diff --git a/phpBB/includes/functions_compatibility.php b/phpBB/includes/functions_compatibility.php
index 024c656267..e1539a5493 100644
--- a/phpBB/includes/functions_compatibility.php
+++ b/phpBB/includes/functions_compatibility.php
@@ -43,7 +43,7 @@ function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $
{
global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ include($phpbb_root_path . 'includes/functions.' . $phpEx);
}
return phpbb_get_avatar($row, $alt, $ignore_config);
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index cd2c9e5ae6..2b11d00f1e 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -1377,92 +1377,6 @@ function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank
}
/**
-* Get user avatar
-*
-* @param array $user_row Row from the users table
-* @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 html
-*/
-function phpbb_get_user_avatar($user_row, $alt = 'USER_AVATAR', $ignore_config = false)
-{
- $row = \phpbb\avatar\manager::clean_row($user_row, 'user');
- return phpbb_get_avatar($row, $alt, $ignore_config);
-}
-
-/**
-* Get group avatar
-*
-* @param array $group_row Row from the groups table
-* @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 html
-*/
-function phpbb_get_group_avatar($user_row, $alt = 'GROUP_AVATAR', $ignore_config = false)
-{
- $row = \phpbb\avatar\manager::clean_row($user_row, 'group');
- return phpbb_get_avatar($row, $alt, $ignore_config);
-}
-
-/**
-* Get avatar
-*
-* @param array $row Row cleaned by \phpbb\avatar\driver\driver::clean_row
-* @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 html
-*/
-function phpbb_get_avatar($row, $alt, $ignore_config = false)
-{
- global $user, $config, $cache, $phpbb_root_path, $phpEx;
- global $request;
- global $phpbb_container;
-
- if (!$config['allow_avatar'] && !$ignore_config)
- {
- return '';
- }
-
- $avatar_data = array(
- 'src' => $row['avatar'],
- 'width' => $row['avatar_width'],
- 'height' => $row['avatar_height'],
- );
-
- $phpbb_avatar_manager = $phpbb_container->get('avatar.manager');
- $driver = $phpbb_avatar_manager->get_driver($row['avatar_type'], $ignore_config);
- $html = '';
-
- if ($driver)
- {
- $html = $driver->get_custom_html($user, $row, $alt);
- if (!empty($html))
- {
- return $html;
- }
-
- $avatar_data = $driver->get_data($row, $ignore_config);
- }
- else
- {
- $avatar_data['src'] = '';
- }
-
- if (!empty($avatar_data['src']))
- {
- $html = '<img src="' . $avatar_data['src'] . '" ' .
- ($avatar_data['width'] ? ('width="' . $avatar_data['width'] . '" ') : '') .
- ($avatar_data['height'] ? ('height="' . $avatar_data['height'] . '" ') : '') .
- 'alt="' . ((!empty($user->lang[$alt])) ? $user->lang[$alt] : $alt) . '" />';
- }
-
- return $html;
-}
-
-/**
* Generate a list of archive types available for compressing attachments
*
* @param string $param_key Either topic_id or post_id
diff --git a/phpBB/includes/mcp/mcp_notes.php b/phpBB/includes/mcp/mcp_notes.php
index 28de8724be..9d32467f0f 100644
--- a/phpBB/includes/mcp/mcp_notes.php
+++ b/phpBB/includes/mcp/mcp_notes.php
@@ -176,7 +176,7 @@ class mcp_notes
// Generate the appropriate user information for the user we are looking at
if (!function_exists('phpbb_get_user_avatar'))
{
- include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ include($phpbb_root_path . 'includes/functions.' . $phpEx);
}
$rank_title = $rank_img = '';
diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php
index d396d004dc..1d6c71e4c6 100644
--- a/phpBB/includes/mcp/mcp_warn.php
+++ b/phpBB/includes/mcp/mcp_warn.php
@@ -295,7 +295,7 @@ class mcp_warn
// Generate the appropriate user information for the user we are looking at
if (!function_exists('phpbb_get_user_avatar'))
{
- include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ include($phpbb_root_path . 'includes/functions.' . $phpEx);
}
get_user_rank($user_row['user_rank'], $user_row['user_posts'], $rank_title, $rank_img, $rank_img_src);
@@ -400,7 +400,7 @@ class mcp_warn
// Generate the appropriate user information for the user we are looking at
if (!function_exists('phpbb_get_user_avatar'))
{
- include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ include($phpbb_root_path . 'includes/functions.' . $phpEx);
}
get_user_rank($user_row['user_rank'], $user_row['user_posts'], $rank_title, $rank_img, $rank_img_src);
diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php
index b68389cba7..0249eee6af 100644
--- a/phpBB/includes/ucp/ucp_pm_viewmessage.php
+++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php
@@ -340,7 +340,7 @@ function get_user_information($user_id, $user_row)
if (!function_exists('phpbb_get_user_avatar'))
{
- include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ include($phpbb_root_path . 'includes/functions.' . $phpEx);
}
$user_row['avatar'] = ($user->optionget('viewavatars')) ? phpbb_get_user_avatar($user_row) : '';
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index 3772d56e28..a9dec4e2da 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -517,7 +517,7 @@ class ucp_profile
case 'avatar':
if (!function_exists('phpbb_get_user_avatar'))
{
- include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ include($phpbb_root_path . 'includes/functions.' . $phpEx);
}
add_form_key('ucp_avatar');
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php
index ba4a4372a5..905509a7f4 100644
--- a/phpBB/memberlist.php
+++ b/phpBB/memberlist.php
@@ -547,7 +547,12 @@ switch ($mode)
$parse_flags = ($member['user_sig_bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES;
$member['user_sig'] = generate_text_for_display($member['user_sig'], $member['user_sig_bbcode_uid'], $member['user_sig_bbcode_bitfield'], $parse_flags, true);
}
-
+
+ if (!function_exists('phpbb_get_user_avatar'))
+ {
+ include($phpbb_root_path . 'includes/functions.' . $phpEx);
+ }
+
$poster_avatar = phpbb_get_user_avatar($member);
// We need to check if the modules 'zebra' ('friends' & 'foes' mode), 'notes' ('user_notes' mode) and 'warn' ('warn_user' mode) are accessible to decide if we can display appropriate links
diff --git a/phpBB/styles/prosilver/template/overall_header.html b/phpBB/styles/prosilver/template/overall_header.html
index df02963e3c..59bf72b2e1 100644
--- a/phpBB/styles/prosilver/template/overall_header.html
+++ b/phpBB/styles/prosilver/template/overall_header.html
@@ -163,7 +163,7 @@
<!-- EVENT overall_header_navigation_append -->
<!-- IF not S_IS_BOT -->
- <li class="small-icon icon-logout rightside no-bulletin"><a href="{U_LOGIN_LOGOUT}" title="{L_LOGIN_LOGOUT}" accesskey="x">{L_LOGIN_LOGOUT}</a></li>
+ <li class="small-icon icon-logout rightside no-bulletin"><a href="{U_LOGIN_LOGOUT}" title="{L_LOGIN_LOGOUT}" accesskey="x">{L_LOGIN_LOGOUT}</a> <span class="avatar-index">{CURRENT_USER_AVATAR}</span></li>
<!-- IF not S_USER_LOGGED_IN and S_REGISTER_ENABLED and not (S_SHOW_COPPA or S_REGISTRATION) --><li class="small-icon icon-register rightside no-bulletin"><a href="{U_REGISTER}">{L_REGISTER}</a></li><!-- ENDIF -->
<!-- IF S_DISPLAY_MEMBERLIST --><li class="small-icon icon-members rightside no-bulletin"><a href="{U_MEMBERLIST}" title="{L_MEMBERLIST_EXPLAIN}">{L_MEMBERLIST}</a></li><!-- ENDIF -->
<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css
index 50683c6808..f4a1ecb1e0 100644
--- a/phpBB/styles/prosilver/theme/common.css
+++ b/phpBB/styles/prosilver/theme/common.css
@@ -444,6 +444,13 @@ ul.linklist.bulletin li.no-bulletin:before {
display: none !important;
}
+/* Avatar in overall_header.html */
+span.avatar-index img {
+ max-height: 25px;
+ vertical-align: top;
+ width: auto;
+}
+
/* Dropdown menu
----------------------------------------*/
.dropdown-container {
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 61a28940b1..fe0b3dc384 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -16,6 +16,10 @@ $phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
+if (!function_exists('phpbb_get_user_avatar'))
+{
+ include($phpbb_root_path . 'includes/functions.' . $phpEx);
+}
// Start session management
$user->session_begin();