Avatar

eddy

Registered
Мерси искам да попитам и друго значи аз съм phpbb3 форум и когато някой потребител си качва аватар примерно качва снимка 100px на 100px как да направя системата ми да ги намали примерно на 10px и 2 те страни автоматично resize.
 
отваряш #
includes\functions_display.php намираш #-----[ BEFORE, ADD ]--------
Код:
#
#
#-----[ OPEN ]---------------
#
includes\functions_display.php

#
#-----[ FIND ]---------------
#
return '<img src="' . $avatar_img . '" width="' . $avatar_width . '" height="' . $avatar_height . '" alt="' . ((!empty($user->lang[$alt])) ? $user->lang[$alt] : $alt) . '" />';

#
#-----[ BEFORE, ADD ]--------
#
if($avatar_width > 100)
        $avatar_width = 100 ;
   
    if($avatar_height > 100)
        $avatar_height = 100 ;
Мисля че това е за аватара
if($avatar_width > 10)
$avatar_width = 10;

if($avatar_height > 10)
$avatar_height = 10 ;
 
Не става ... искам просто аватара да ми е фиксиран винаги на 70 x 90 , ако някои ъплоадва по голяма да се ресайзва на 70 x 90 .

Това е кода от function_display за аватара.

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) . '" />';
}
 

Back
Горе