Вход Регистрация
Файл: modules/user/load_avatar.php
Строк: 26
<?
import_lib
('upload.class');
if(
file_exists(ROOT.'/files/avatars/'.cyrlat($user['nick']).'.png')) { 
    
unlink(ROOT.'/files/avatars/'. cyrlat($user['nick']) .'.png');
}
$handle = new upload($_FILES['avatar']);
  if (
$handle->uploaded) {
      
$handle->allowed = array('image/*');
      
$handle->file_new_name_body     = cyrlat($user['nick']);
      
$handle->image_convert         = 'png';
      
$handle->image_resize            = true;
$handle->image_x                = 120;
$handle->image_y                = 120;
      
$handle->process(ROOT. '/files/avatars/');
      if (
$handle->processed) {
          
// echo 'image resized';
          
$handle->clean();
          
go('/user/avatar/');
      } else {
          
// echo 'error : ' . $handle->error;
          
go('/user/avatar/');
      }
  }
?>
Онлайн: 2
Реклама