| @@ 1878-1891 (lines=14) @@ | ||
| 1875 | $old_file = $path_info['file']; |
|
| 1876 | ||
| 1877 | // Let us delete them. |
|
| 1878 | if ($old_file != 'unknown.jpg') { |
|
| 1879 | if (KEEP_THE_OLD_IMAGE_AFTER_CHANGE) { |
|
| 1880 | $prefix = 'saved_'.date('Y_m_d_H_i_s').'_'.uniqid('').'_'; |
|
| 1881 | @rename($path.'small_'.$old_file, $path.$prefix.'small_'.$old_file); |
|
| 1882 | @rename($path.'medium_'.$old_file, $path.$prefix.'medium_'.$old_file); |
|
| 1883 | @rename($path.'big_'.$old_file, $path.$prefix.'big_'.$old_file); |
|
| 1884 | @rename($path.$old_file, $path.$prefix.$old_file); |
|
| 1885 | } else { |
|
| 1886 | @unlink($path.'small_'.$old_file); |
|
| 1887 | @unlink($path.'medium_'.$old_file); |
|
| 1888 | @unlink($path.'big_'.$old_file); |
|
| 1889 | @unlink($path.$old_file); |
|
| 1890 | } |
|
| 1891 | } |
|
| 1892 | ||
| 1893 | // Exit if only deletion has been requested. Return an empty picture name. |
|
| 1894 | if ($delete) { |
|
| @@ 1140-1153 (lines=14) @@ | ||
| 1137 | $old_file = $path_info['file']; |
|
| 1138 | ||
| 1139 | // Let us delete them. |
|
| 1140 | if (!empty($old_file)) { |
|
| 1141 | if (KEEP_THE_OLD_IMAGE_AFTER_CHANGE) { |
|
| 1142 | $prefix = 'saved_'.date('Y_m_d_H_i_s').'_'.uniqid('').'_'; |
|
| 1143 | @rename($path.'small_'.$old_file, $path.$prefix.'small_'.$old_file); |
|
| 1144 | @rename($path.'medium_'.$old_file, $path.$prefix.'medium_'.$old_file); |
|
| 1145 | @rename($path.'big_'.$old_file, $path.$prefix.'big_'.$old_file); |
|
| 1146 | @rename($path.$old_file, $path.$prefix.$old_file); |
|
| 1147 | } else { |
|
| 1148 | @unlink($path.'small_'.$old_file); |
|
| 1149 | @unlink($path.'medium_'.$old_file); |
|
| 1150 | @unlink($path.'big_'.$old_file); |
|
| 1151 | @unlink($path.$old_file); |
|
| 1152 | } |
|
| 1153 | } |
|
| 1154 | ||
| 1155 | // Exit if only deletion has been requested. Return an empty picture name. |
|
| 1156 | if ($delete) { |
|