Default User Avatar
Posted January 19th 2014, 11:38am
Here is a modification I've provided to clients via InstallDD™. I had planned to post it here months ago but never got around to converting it. Now that InstallDD™ is available to you...

default_avatar.zip
5.31 KiB  |  Downloaded 320 times

To install, upload the ZIP file through InstallDD™ and then click the Default Avatar block on the Install a Modification page.

You should then go to the ACP Avatar Settings page. There will be a new option at the bottom that lets you define a default avatar. Conveniently, one has already been defined for you. If you like the default choice, great! If not, upload a new image and add the path to that image in the appropriate location.

The image you set will be the displayed avatar for all users who have not defined an avatar, and for those people who have had their permission to use avatars removed. Enjoy!
φ
Posts: 1600
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357
Default User Avatar
Posted March 17th 2014, 9:37am
This is you function?
function not_used_anymore($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) . '" />';
}
φ
Posts: 16
Joined: September 28th 2013, 10:09am
Likes Given: 27
Default User Avatar
Posted March 17th 2014, 1:32pm
That is the original get_user_avatar() function in includes/functions_display.php. The Default Avatar modification moves this function to includes/functions_content.php to make it available on every page, and renames the original function to disable it. This insures the modification can be safely uninstalled.
φ
Posts: 1600
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357

Who is online

Users browsing this forum: No registered users and 1 guest