Thanks lefty74, great work
Much appreciated
Default avatar thumb in viewforum - Avatar of poster on Index and Viewforum
-
- Registered User
- Posts: 1245
- Joined: Fri Jun 05, 2009 8:12 pm
- Location: Ireland
- Name: Colette
Re: Default avatar thumb in viewforum
sory poor english , tested problem Avatar of poster on Index and Viewforum & random avatar"no_avatar" in localhost fixing this bug.
open incudes/function_display.php
find
Code: Select all
//-- mod : apiv ----------------------------------------------------------------
//-- add
function user_display_avatar($row, $prefix = '', $tpl_switch, $display)
{
if ( !$display || empty($row[$prefix . '_poster_avatar']) )
{
return;
}
global $config, $template;
$avatar = unserialize($row[$prefix . '_poster_avatar']);
if ( $avatar['width'] >= $avatar['height'] )
{
$avatar_width = ($avatar['width'] > $config['avatar_max_dimensions']) ? $config['avatar_max_dimensions'] : $avatar['width'];
$avatar_height = ($avatar_width == $config['avatar_max_dimensions']) ? round($config['avatar_max_dimensions'] / $avatar['width'] * $avatar['height']) : $avatar['height'];
}
else
{
$avatar_height = ($avatar['height'] > $config['avatar_max_dimensions']) ? $config['avatar_max_dimensions'] : $avatar['height'];
$avatar_width = ($avatar_height == $config['avatar_max_dimensions']) ? round($config['avatar_max_dimensions'] / $avatar['height'] * $avatar['width']) : $avatar['width'];
}
$template->alter_block_array($tpl_switch, array(
strtoupper($prefix) . '_POSTER_AVATAR' => get_user_avatar($avatar['avatar'], $avatar['type'], $avatar_width, $avatar_height),
strtoupper($prefix) . '_POSTER_AVATAR_MARGIN' => ($avatar_width == $config['avatar_max_dimensions']) ? 5 : ($config['avatar_max_dimensions'] - $avatar_width + 5),
), true, 'change');
}
//-- fin mod : apiv ------------------------------------------------------------
and replace with
Code: Select all
//-- mod : apiv ----------------------------------------------------------------
//-- add
function user_display_avatar($row, $prefix = '', $tpl_switch, $display)
{
if ( !$display || empty($row[$prefix . '_poster_avatar']) )
{
return;
}
global $config, $template;
$avatar = unserialize($row[$prefix . '_poster_avatar']);
if ( $avatar['width'] >= $avatar['height'] )
{
$avatar_width = ($avatar['width'] > $config['avatar_max_dimensions']) ? $config['avatar_max_dimensions'] : $avatar['width'];
$avatar_height = ($avatar_width == $config['avatar_max_dimensions']) ? round($config['avatar_max_dimensions'] / $avatar['width'] * $avatar['height']) : $avatar['height'];
$avatar_max_dimensions = $avatar_width = $avatar_height = 40;
}
else
{
$avatar_height = ($avatar['height'] > $config['avatar_max_dimensions']) ? $config['avatar_max_dimensions'] : $avatar['height'];
$avatar_width = ($avatar_height == $config['avatar_max_dimensions']) ? round($config['avatar_max_dimensions'] / $avatar['height'] * $avatar['width']) : $avatar['width'];
$avatar_max_dimensions = $avatar_width = $avatar_height = 40;
}
$template->alter_block_array($tpl_switch, array(
strtoupper($prefix) . '_POSTER_AVATAR' => get_user_avatar($avatar['avatar'], $avatar['type'], $avatar_width, $avatar_height),
strtoupper($prefix) . '_POSTER_AVATAR_MARGIN' => ($avatar_width == $config['avatar_max_dimensions']) ? 5 : ($config['avatar_max_dimensions'] - $avatar_width + 5),
), true, 'change');
}
//-- fin mod : apiv ------------------------------------------------------------
thanks for mod lefty
-
- Registered User
- Posts: 1
- Joined: Mon Dec 24, 2012 1:54 am
Re: Default avatar thumb in viewforum
This right here IS the fix for this, after 1 hour of googling, this fixed the oversized avatar and the weird space on the side !!! Thank you soooo much herz
-
- Registered User
- Posts: 39
- Joined: Fri Dec 28, 2012 6:05 am
Re: Default avatar thumb in viewforum
thanks , this fix works cool with Avatar of poster on Index and Viewforum 1.3.0 & defaut ramdom "No Avatar"
GREATTTTTTTTTTTTTTTTTTT !!!!!!
GREATTTTTTTTTTTTTTTTTTT !!!!!!
-
- Registered User
- Posts: 136
- Joined: Thu Apr 04, 2013 11:12 pm
- Location: PuErTo RiCo
- Name: Harold