RNDTV
developer,
  1. $handle = new upload($_FILES['imagefile']);
  2. if ($handle->uploaded) {
  3. // Обрабатываем фото
  4. $handle->image_watermark = '../images/watermark.png';
  5. $handle->image_watermark_position = 'BR';
  6. $handle->file_new_name_body = 'img_' . time();
  7. $handle->allowed = array(
  8. 'image/jpeg',
  9. 'image/gif',
  10. 'image/png'
  11. );
  12. $handle->file_max_size = 1024 * $set['flsz'];
  13. $handle->image_resize = true;
  14. $handle->image_x = 1920;
  15. $handle->image_y = 1024;
  16. $handle->image_ratio_no_zoom_in = true;
  17. $handle->image_convert = 'jpg';
  18. $handle->process('../files/album/');
  19. $img_name = $handle->file_dst_name;
  20. if ($handle->processed) {
  21. // Обрабатываем превьюшку
  22. $handle->file_new_name_body = 'tmb_' . time();
  23. $handle->image_resize = true;
  24. $handle->image_x = 100;
  25. $handle->image_y = 100;
  26. $handle->image_ratio_no_zoom_in = true;
  27. $handle->image_convert = 'jpg';
  28. $handle->process('../files/album/');
  29. $tmb_name = $handle->file_dst_name;
  30. $cat_id = abs(intval($_POST['cat']));
  31. if ($handle->processed) {
  32. if ($rights == 9){
  33. mysql_query("INSERT INTO `album_files` SET
  34. `album_id` = '$cat_id',
  35. `img_name` = '" . mysql_real_escape_string($img_name) . "',
  36. `tmb_name` = '" . mysql_real_escape_string($tmb_name) . "',
  37. `time` = '" . time() . "'
  38. ");
  39.  
  40. }
  41. }

bu kod aka rasm qayga yuklanishi bn qanday pechat hamma razmerlari bor uzizga moslab joylaysizda