Changeset 16319
- Timestamp:
- Jul 3, 2012, 3:49:46 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/virtualize/admin.php
r9562 r16319 77 77 secure_directory($upload_dir); 78 78 79 $newfilename = $year.$month.$day.$hour.$minute.$second.'-'.substr($md5sum, 0, 8).'.jpg'; 79 $extension = get_extension($row['oldpath']); 80 if (in_array($extension, array('vimeo', 'ytube', 'dm'))) 81 { 82 $newfilename = basename($row['oldpath']); 83 } 84 else 85 { 86 $newfilename = $year.$month.$day.$hour.$minute.$second.'-'.substr($md5sum, 0, 8).'.jpg'; 87 } 80 88 81 89 $newpath = $upload_dir.'/'.$newfilename; … … 114 122 115 123 # thumbnail 116 $tn_dir = $upload_dir.'/thumbnail'; 117 118 if (!is_dir($tn_dir)) 124 if (!empty($row['tn_ext'])) 119 125 { 120 umask(0000);121 $recursive = true;122 if (! @mkdir($tn_dir, 0777, $recursive))126 $tn_dir = $upload_dir.'/thumbnail'; 127 128 if (!is_dir($tn_dir)) 123 129 { 124 echo 'error during "'.$tn_dir.'" directory creation'; 125 exit(); 130 umask(0000); 131 $recursive = true; 132 if (!@mkdir($tn_dir, 0777, $recursive)) 133 { 134 echo 'error during "'.$tn_dir.'" directory creation'; 135 exit(); 136 } 126 137 } 138 139 $tn_oldname = $conf['prefix_thumbnail']; 140 $tn_oldname.= get_filename_wo_extension(basename($row['oldpath'])); 141 $tn_oldname.= '.'.$row['tn_ext']; 142 143 rename( 144 dirname($row['oldpath']).'/thumbnail/'.$tn_oldname, 145 $tn_dir.'/'.$conf['prefix_thumbnail'].get_filename_wo_extension(basename($newfilename)).'.jpg' 146 ); 127 147 } 128 129 $tn_oldname = $conf['prefix_thumbnail'];130 $tn_oldname.= get_filename_wo_extension(basename($row['oldpath']));131 $tn_oldname.= '.'.$row['tn_ext'];132 133 rename(134 dirname($row['oldpath']).'/thumbnail/'.$tn_oldname,135 $tn_dir.'/'.$conf['prefix_thumbnail'].$newfilename136 );137 138 148 // break; 139 149 }
Note: See TracChangeset
for help on using the changeset viewer.