Changeset 1204 for trunk/admin/site_reader_local.php
- Timestamp:
- Apr 19, 2006, 1:46:53 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/site_reader_local.php
r1064 r1204 45 45 { 46 46 global $errors; 47 47 48 48 if (!is_dir($this->site_url)) 49 49 { … … 55 55 ) 56 56 ); 57 57 58 58 return false; 59 59 } 60 60 61 61 return true; 62 62 } … … 78 78 { 79 79 global $conf; 80 if (!isset($conf['flip_picture_ext']))81 {82 $conf['flip_picture_ext'] = array_flip($conf['picture_ext']);83 }84 80 if (!isset($conf['flip_file_ext'])) 85 81 { … … 98 94 $filename_wo_ext = get_filename_wo_extension($node); 99 95 100 // searching the thumbnail 101 $tn_ext = $this->get_tn_ext($path, $filename_wo_ext); 102 103 if (isset($conf['flip_picture_ext'][$extension])) 96 if ( isset($conf['flip_file_ext'][$extension]) ) 104 97 { 98 $tn_ext = $this->get_tn_ext($path, $filename_wo_ext); 105 99 $fs[ $path.'/'.$node ] = array( 106 100 'tn_ext' => $tn_ext, 107 'has_high' => $this->get_has_high($path, $node)108 101 ); 109 102 } 110 else if (isset($conf['flip_file_ext'][$extension]))111 { // file not a picture112 $representative_ext = $this->get_representative_ext($path, $filename_wo_ext);113 114 $fs[ $path.'/'.$node ] = array(115 'tn_ext' => $tn_ext,116 'representative_ext' => $representative_ext117 );118 }119 120 103 } 121 104 elseif (is_dir($path.'/'.$node) … … 141 124 142 125 // returns the name of the attributes that are supported for 143 // update/synchronization according to configuration126 // files update/synchronization 144 127 function get_update_attributes() 145 128 { 146 global $conf; 147 148 $update_fields = array( 149 'has_high', 'representative_ext', 'filesize', 'width', 'height' 150 ); 151 129 return array('tn_ext', 'has_high', 'representative_ext'); 130 } 131 132 function get_element_update_attributes($file) 133 { 134 global $conf; 135 $data = array(); 136 137 $filename = basename($file); 138 $dirname = dirname($file); 139 $filename_wo_ext = get_filename_wo_extension($filename); 140 $extension = get_extension($filename); 141 142 $data['tn_ext'] = $this->get_tn_ext($dirname, $filename_wo_ext); 143 $data['has_high'] = $this->get_has_high($dirname, $filename); 144 145 if ( !isset($conf['flip_picture_ext'][$extension]) ) 146 { 147 $data['representative_ext'] = $this->get_representative_ext( 148 $dirname, $filename_wo_ext 149 ); 150 } 151 return $data; 152 } 153 154 // returns the name of the attributes that are supported for 155 // metadata update/synchronization according to configuration 156 function get_metadata_attributes() 157 { 158 global $conf; 159 160 $update_fields = array('filesize', 'width', 'height'); 161 152 162 if ($conf['use_exif']) 153 163 { … … 167 177 ); 168 178 } 169 179 170 180 return $update_fields; 171 181 } 172 182 173 183 // returns a hash of attributes (metadata+filesize+width,...) for file 174 function get_element_ update_attributes($file)184 function get_element_metadata($file) 175 185 { 176 186 global $conf; … … 182 192 $data = array(); 183 193 184 $filename = basename($file);185 186 $data['has_high'] = $this->get_has_high(dirname($file), $filename);187 188 $data['representative_ext'] = $this->get_representative_ext(189 dirname($file),190 get_filename_wo_extension($filename)191 );192 193 194 $data['filesize'] = floor(filesize($file)/1024); 195 194 196 if ($image_size = @getimagesize($file)) 195 197 { … … 222 224 } 223 225 } 224 226 225 227 return $data; 226 228 } … … 246 248 { 247 249 global $conf; 248 250 249 251 $base_test = 250 252 $path.'/thumbnail/'.$conf['prefix_thumbnail'].$filename_wo_ext.'.'; 251 253 252 254 foreach ($conf['picture_ext'] as $ext) 253 255 { … … 258 260 } 259 261 } 260 262 261 263 return null; 262 264 } … … 268 270 return 'true'; 269 271 } 270 272 271 273 return null; 272 274 }
Note: See TracChangeset
for help on using the changeset viewer.