Avatar Everywhereopenincludes/functions.php
findCode:
$template->assign_vars(array(
after add Code:
'USER_AVATAR' => get_user_avatar($user->data['user_avatar'], $user->data['user_avatar_type'], $user->data['user_avatar_width'], $user->data['user_avatar_height']),
findCode:
?>
before add
Code:
if (!function_exists('get_user_avatar')){
function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $alt = 'USER_AVATAR', $ignore_config = false)
{
global $user, $config, $phpbb_root_path, $phpEx;
if (empty($avatar) || !$avatar_type || (!$config['allow_avatar'] && !$ignore_config))
{
return '';
}
$avatar_img = '';
switch ($avatar_type)
{
case AVATAR_UPLOAD:
if (!$config['allow_avatar_upload'] && !$ignore_config)
{
return '';
}
$avatar_img = $phpbb_root_path . "download/file.$phpEx?avatar=";
break;
case AVATAR_GALLERY:
if (!$config['allow_avatar_local'] && !$ignore_config)
{
return '';
}
$avatar_img = $phpbb_root_path . $config['avatar_gallery_path'] . '/';
break;
case AVATAR_REMOTE:
if (!$config['allow_avatar_remote'] && !$ignore_config)
{
return '';
}
break;
}
$avatar_img .= $avatar;
return '<img src="' . (str_replace(' ', '%20', $avatar_img)) . '" width="' . $avatar_width . '" height="' . $avatar_height . '" alt="' . ((!empty($user->lang[$alt])) ? $user->lang[$alt] : $alt) . '" />';
}}
openincludes/functions_display.php
findCode:
function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $alt = 'USER_AVATAR', $ignore_config = false)
{
global $user, $config, $phpbb_root_path, $phpEx;
if (empty($avatar) || !$avatar_type || (!$config['allow_avatar'] && !$ignore_config))
{
return '';
}
$avatar_img = '';
switch ($avatar_type)
{
case AVATAR_UPLOAD:
if (!$config['allow_avatar_upload'] && !$ignore_config)
{
return '';
}
$avatar_img = $phpbb_root_path . "download/file.$phpEx?avatar=";
break;
case AVATAR_GALLERY:
if (!$config['allow_avatar_local'] && !$ignore_config)
{
return '';
}
$avatar_img = $phpbb_root_path . $config['avatar_gallery_path'] . '/';
break;
case AVATAR_REMOTE:
if (!$config['allow_avatar_remote'] && !$ignore_config)
{
return '';
}
break;
}
$avatar_img .= $avatar;
return '<img src="' . (str_replace(' ', '%20', $avatar_img)) . '" width="' . $avatar_width . '" height="' . $avatar_height . '" alt="' . ((!empty($user->lang[$alt])) ? $user->lang[$alt] : $alt) . '" />';
}
replace withCode:
if (!function_exists('get_user_avatar')){
function get_user_avatar($avatar, $avatar_type, $avatar_width, $avatar_height, $alt = 'USER_AVATAR', $ignore_config = false)
{
global $user, $config, $phpbb_root_path, $phpEx;
if (empty($avatar) || !$avatar_type || (!$config['allow_avatar'] && !$ignore_config))
{
return '';
}
$avatar_img = '';
switch ($avatar_type)
{
case AVATAR_UPLOAD:
if (!$config['allow_avatar_upload'] && !$ignore_config)
{
return '';
}
$avatar_img = $phpbb_root_path . "download/file.$phpEx?avatar=";
break;
case AVATAR_GALLERY:
if (!$config['allow_avatar_local'] && !$ignore_config)
{
return '';
}
$avatar_img = $phpbb_root_path . $config['avatar_gallery_path'] . '/';
break;
case AVATAR_REMOTE:
if (!$config['allow_avatar_remote'] && !$ignore_config)
{
return '';
}
break;
}
$avatar_img .= $avatar;
return '<img src="' . (str_replace(' ', '%20', $avatar_img)) . '" width="' . $avatar_width . '" height="' . $avatar_height . '" alt="' . ((!empty($user->lang[$alt])) ? $user->lang[$alt] : $alt) . '" />';
}}
openincludes/ucp/ucp_pm_viewmessage.php
findCode:
if (!function_exists('get_user_avatar'))
{
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
}
replace withCode:
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
Clear all Board-, Style- and Browsercaches
Now u can put the Avatar everywhere in Forum-Templates via
{USER_AVATAR}