4images Forum & Community

4images Issues / Ausgaben => Feedback & Suggestions => Topic started by: thunderstrike on October 08, 2007, 03:39:03 PM

Title: [FIX] - admin/checkimages.php file
Post by: thunderstrike on October 08, 2007, 03:39:03 PM
This check for all extension in mime type match of includes/upload_definitions.php file and some condition fix include.

Find:

Quote
$thumb_file = 0;
    if (file_exists(THUMB_PATH.$cat_path."/".$image_name.".jpg")) {
      $thumb_file = $image_name.".jpg";
    }
    elseif (file_exists(THUMB_PATH.$cat_path."/".$image_name.".JPG")) {
      $thumb_file = $image_name.".JPG";
    }
    elseif (file_exists(THUMB_PATH.$cat_path."/".$image_name.".jpeg")) {
      $thumb_file = $image_name.".jpeg";
    }
    elseif (file_exists(THUMB_PATH.$cat_path."/".$image_name.".JPEG")) {
      $thumb_file = $image_name.".JPEG";
    }
    elseif (file_exists(THUMB_PATH.$cat_path."/".$image_name.".gif")) {
      $thumb_file = $image_name.".gif";
    }
    elseif (file_exists(THUMB_PATH.$cat_path."/".$image_name.".GIF")) {
      $thumb_file = $image_name.".GIF";
    }
    elseif (file_exists(THUMB_PATH.$cat_path."/".$image_name.".png")) {
      $thumb_file = $image_name.".png";
    }
    elseif (file_exists(THUMB_PATH.$cat_path."/".$image_name.".PNG")) {
      $thumb_file = $image_name.".PNG";
    }

replace:

Code: [Select]
@include_once(ROOT_PATH . "includes/upload_definitions.php");
    if (isset($mime_type_match) && is_array($mime_type_match) && !empty($mime_type_match)) {
        foreach ($mime_type_match as $key) {
            if (strtolower($key) == $file_type || strtoupper($key) == $file_type && @file_exists(THUMB_PATH.$cat_path."/".$image_name.".".$file_type)) {
                $thumb_file = get_basefile(trim($image_name . "." . $file_type));
            }
        }
    }

Find (2 time):

Quote
if ($thumb_file) {

replace:

Code: [Select]
if (isset($thumb_file) && !empty($thumb_file)) {

Find:

Quote
show_form_footer($lang['add'], $lang['reset'], $colspan);
  }
  else {
    show_table_footer();
  }

add after:

Code: [Select]
unset ($thumb_file);
Title: Re: [FIX] - admin/checkimages.php file
Post by: vanish on January 21, 2008, 12:59:10 PM
After applying this FIX checkimages doin't working
Title: Re: [FIX] - admin/checkimages.php file
Post by: thunderstrike on January 21, 2008, 02:10:57 PM
And ... PHP and 4images version ?