mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-27 04:18:55 +00:00
Update functions.php
Default avatar display
This commit is contained in:
parent
82db151303
commit
29b8e2d8f1
1 changed files with 14 additions and 0 deletions
|
@ -3620,6 +3620,20 @@ function phpbb_get_avatar($row, $alt, $ignore_config = false, $lazy = false)
|
||||||
$avatar_data['src'] = '';
|
$avatar_data['src'] = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Default avatar display
|
||||||
|
if (!$avatar_data['src'])
|
||||||
|
{
|
||||||
|
$phpbb_path_helper = $phpbb_container->get('path_helper');
|
||||||
|
$web_path = $phpbb_path_helper->get_web_root_path();
|
||||||
|
$theme = "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme';
|
||||||
|
$no_avatar = $theme . '/images/no_avatar.gif';
|
||||||
|
$src = 'src=' . $no_avatar . ' data-src=' . $no_avatar;
|
||||||
|
$html = '<img class="avatar" ' . $src . ' ' .
|
||||||
|
($avatar_data['width'] ? ('width="' . $avatar_data['width'] . '" ') : '') .
|
||||||
|
($avatar_data['height'] ? ('height="' . $avatar_data['height'] . '" ') : '') .
|
||||||
|
'alt="' . ((!empty($user->lang[$alt])) ? $user->lang[$alt] : $alt) . '" />';
|
||||||
|
}
|
||||||
|
|
||||||
if (empty($html) && !empty($avatar_data['src']))
|
if (empty($html) && !empty($avatar_data['src']))
|
||||||
{
|
{
|
||||||
if ($lazy)
|
if ($lazy)
|
||||||
|
|
Loading…
Add table
Reference in a new issue