Show
Ignore:
Timestamp:
06/05/10 20:05:38 (2 years ago)
Author:
ort
Message:

возможность в конфиге указывать размеры для ресайза аватаров юзера и блога

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/classes/modules/user/User.class.php

    r929 r931  
    10911091                $oImage->output(null,$sFileTmp); 
    10921092                 
    1093                 if ($sFileAvatar=$this->Image_Resize($sFileTmp,$sPath,'avatar_100x100',Config::Get('view.img_max_width'),Config::Get('view.img_max_height'),100,100,false,$aParams)) { 
    1094                         $this->Image_Resize($sFileTmp,$sPath,'avatar_64x64',Config::Get('view.img_max_width'),Config::Get('view.img_max_height'),64,64,false,$aParams); 
    1095                         $this->Image_Resize($sFileTmp,$sPath,'avatar_48x48',Config::Get('view.img_max_width'),Config::Get('view.img_max_height'),48,48,false,$aParams); 
    1096                         $this->Image_Resize($sFileTmp,$sPath,'avatar_24x24',Config::Get('view.img_max_width'),Config::Get('view.img_max_height'),24,24,false,$aParams); 
    1097                         $this->Image_Resize($sFileTmp,$sPath,'avatar',Config::Get('view.img_max_width'),Config::Get('view.img_max_height'),null,null,false,$aParams); 
     1093                if ($sFileAvatar=$this->Image_Resize($sFileTmp,$sPath,'avatar_100x100',Config::Get('view.img_max_width'),Config::Get('view.img_max_height'),100,100,false,$aParams)) {                   
     1094                        $aSize=Config::Get('module.user.avatar_size'); 
     1095                        foreach ($aSize as $iSize) { 
     1096                                if ($iSize==0) { 
     1097                                        $this->Image_Resize($sFileTmp,$sPath,'avatar',Config::Get('view.img_max_width'),Config::Get('view.img_max_height'),null,null,false,$aParams); 
     1098                                } else { 
     1099                                        $this->Image_Resize($sFileTmp,$sPath,"avatar_{$iSize}x{$iSize}",Config::Get('view.img_max_width'),Config::Get('view.img_max_height'),$iSize,$iSize,false,$aParams); 
     1100                                } 
     1101                        } 
    10981102                        @unlink($sFileTmp); 
    10991103                        /** 
     
    11181122                 */ 
    11191123                if($oUser->getProfileAvatar()) { 
    1120                         @unlink($this->Image_GetServerPath($oUser->getProfileAvatarPath(100))); 
    1121                         @unlink($this->Image_GetServerPath($oUser->getProfileAvatarPath(64))); 
    1122                         @unlink($this->Image_GetServerPath($oUser->getProfileAvatarPath(48))); 
    1123                         @unlink($this->Image_GetServerPath($oUser->getProfileAvatarPath(24))); 
    1124                         @unlink($this->Image_GetServerPath($oUser->getProfileAvatarPath(0))); 
     1124                        $aSize=array_merge(Config::Get('module.user.avatar_size'),array(100)); 
     1125                        foreach ($aSize as $iSize) { 
     1126                                @unlink($this->Image_GetServerPath($oUser->getProfileAvatarPath($iSize))); 
     1127                        } 
    11251128                } 
    11261129        }