Exemplo n.º 1
0
 function upload_thumb($array)
 {
     global $file_name, $LANG;
     //Get File Name
     $file = $array['name'];
     $ext = getExt($file);
     $image = new ResizeImage();
     if (!empty($file) && file_exists($array['tmp_name']) && !error()) {
         if ($image->ValidateImage($array['tmp_name'], $ext)) {
             $file = BASEDIR . '/files/thumbs/' . $_POST['file_name'] . '.' . $ext;
             $bfile = BASEDIR . '/files/thumbs/' . $_POST['file_name'] . '.-big.' . $ext;
             if (!file_exists($file)) {
                 move_uploaded_file($array['tmp_name'], $file);
                 $image->CreateThumb($file, $bfile, config('big_thumb_width'), $ext, config('big_thumb_height'), false);
                 $image->CreateThumb($file, $file, THUMB_WIDTH, $ext, THUMB_HEIGHT, false);
             }
         } else {
             e(lang('vdo_thumb_up_err'));
         }
     } else {
         return true;
     }
 }
Exemplo n.º 2
0
 function UploadThumb($flv, $thumbid)
 {
     $file = $_FILES["upload_thumb_{$thumbid}"]['tmp_name'];
     $ext = GetExt($_FILES["upload_thumb_{$thumbid}"]['name']);
     if (!empty($file) && $ext == 'jpg') {
         $image = new ResizeImage();
         if ($image->ValidateImage($file, $ext)) {
             $thumb = BASEDIR . '/files/thumbs/' . GetThumb($flv, $thumbid);
             move_uploaded_file($file, $thumb);
             $image->CreateThumb($thumb, $thumb, THUMB_WIDTH, $ext, THUMB_HEIGHT, false);
             return true;
         } else {
             return false;
         }
     } else {
         return false;
     }
 }