Changeset 17679 for extensions/virtualize/admin.php
- Timestamp:
- Aug 31, 2012, 3:34:16 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/virtualize/admin.php
r16319 r17679 46 46 path AS oldpath, 47 47 date_available, 48 has_high,49 tn_ext,50 48 id 51 49 FROM '.IMAGES_TABLE.' … … 56 54 { 57 55 $file_for_md5sum = $row['oldpath']; 58 if ('true' == $row['has_high'])59 {60 $file_for_md5sum = dirname($row['oldpath']).'/pwg_high/'.basename($row['oldpath']);61 }62 56 $md5sum = md5_file($file_for_md5sum); 63 57 … … 78 72 79 73 $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 } 74 $newfilename = $year.$month.$day.$hour.$minute.$second.'-'.substr($md5sum, 0, 8).'.jpg'; 88 75 89 76 $newpath = $upload_dir.'/'.$newfilename; … … 98 85 99 86 rename($row['oldpath'], $newpath); 100 101 # high definition 102 if ('true' == $row['has_high']) 103 { 104 $high_dir = $upload_dir.'/pwg_high'; 105 106 if (!is_dir($high_dir)) 107 { 108 umask(0000); 109 $recursive = true; 110 if (!@mkdir($high_dir, 0777, $recursive)) 111 { 112 echo 'error during "'.$high_dir.'" directory creation'; 113 exit(); 114 } 115 } 116 117 rename( 118 dirname($row['oldpath']).'/pwg_high/'.basename($row['oldpath']), 119 $high_dir.'/'.$newfilename 120 ); 121 } 122 123 # thumbnail 124 if (!empty($row['tn_ext'])) 125 { 126 $tn_dir = $upload_dir.'/thumbnail'; 127 128 if (!is_dir($tn_dir)) 129 { 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 } 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 ); 147 } 148 // break; 87 delete_element_derivatives(array('path' => $row['oldpath'])); 149 88 } 150 89 … … 154 93 ;'; 155 94 pwg_query($query); 95 96 array_push($page['infos'], l10n('Information data registered in database')); 156 97 } 157 98
Note: See TracChangeset
for help on using the changeset viewer.