Ignore:
Timestamp:
2009/03/30 21:06:36 (15 years ago)
Author:
kishida
Message:

リネームされない場合、自動生成される画像名に一意となるようにsuffixを付ける

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_4/data/class/pages/admin/products/LC_Page_Admin_Products_Product.php

    r17935 r17945  
    693693               empty($this->objUpFile->save_file[$arrImageKey[$to_key]])) { 
    694694 
    695                 $path = $this->objUpFile->makeThumb($from_path, $to_w, $to_h); 
     695                // リネームする際は、自動生成される画像名に一意となるように、Suffixを付ける 
     696                $dst_file = $this->objUpFile->lfGetTmpImageName(IMAGE_RENAME, "", $this->objUpFile->temp_file[$arrImageKey[$from_key]]) . $this->lfGetAddSuffix($to_key); 
     697                $path = $this->objUpFile->makeThumb($from_path, $to_w, $to_h, $dst_file); 
    696698                $this->objUpFile->temp_file[$arrImageKey[$to_key]] = basename($path); 
    697699            } 
     
    700702        } 
    701703    } 
     704 
     705    // リネームする際は、自動生成される画像名に一意となるように、Suffixを付ける 
     706    function lfGetAddSuffix($to_key){ 
     707        if( IMAGE_RENAME === true ){ return ; } 
     708 
     709        // 自動生成される画像名 
     710        $dist_name = ""; 
     711        switch($to_key){ 
     712            case "main_list_image": 
     713                $dist_name = '_s'; 
     714                break; 
     715            case "main_image": 
     716                $dist_name = '_m'; 
     717                break; 
     718            default; 
     719                $arrRet = explode('sub_image', $to_key); 
     720                $dist_name = '_sub' .$arrRet[1]; 
     721                break; 
     722        } 
     723        return $dist_name; 
     724    } 
    702725} 
    703726?> 
Note: See TracChangeset for help on using the changeset viewer.