Changeset 1523
- Timestamp:
- Aug 2, 2006, 8:14:53 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/branch-1_6/tools/create_listing_file.php
r1485 r1523 252 252 253 253 $thumbnails = array(); 254 if ($opendir = @opendir($dir.'/thumbnail')) 255 { 256 while ($file = readdir($opendir)) 257 { 258 if (in_array(get_extension($file), $conf['picture_ext']) 259 and substr($file,0,$prefix_length) == $conf['prefix_thumbnail']) 260 { 261 array_push($thumbnails, $file); 254 if (is_dir($dir.'/thumbnail')) 255 { 256 if ($opendir = opendir($dir.'/thumbnail')) 257 { 258 while ($file = readdir($opendir)) 259 { 260 if (in_array(get_extension($file), $conf['picture_ext']) 261 and substr($file,0,$prefix_length) == $conf['prefix_thumbnail']) 262 { 263 array_push($thumbnails, $file); 264 } 262 265 } 263 266 } … … 278 281 279 282 $pictures = array(); 280 if ($opendir = @opendir($dir.'/pwg_representative')) 281 { 282 while ($file = readdir($opendir)) 283 { 284 if (in_array(get_extension($file), $conf['picture_ext'])) 285 { 286 array_push($pictures, $file); 283 if (is_dir($dir.'/pwg_representative')) 284 { 285 if ($opendir = opendir($dir.'/pwg_representative')) 286 { 287 while ($file = readdir($opendir)) 288 { 289 if (in_array(get_extension($file), $conf['picture_ext'])) 290 { 291 array_push($pictures, $file); 292 } 287 293 } 288 294 } … … 303 309 304 310 $pictures = array(); 305 if ($opendir = @opendir($dir.'/pwg_high')) 306 { 307 while ($file = readdir($opendir)) 308 { 309 if (in_array(get_extension($file), $conf['picture_ext'])) 310 { 311 array_push($pictures, $file); 311 if (is_dir($dir.'/pwg_high')) 312 { 313 if ($opendir = opendir($dir.'/pwg_high')) 314 { 315 while ($file = readdir($opendir)) 316 { 317 if (in_array(get_extension($file), $conf['picture_ext'])) 318 { 319 array_push($pictures, $file); 320 } 312 321 } 313 322 } … … 325 334 $fs_dirs = array(); 326 335 $dirs = ""; 336 global $conf_safe_mode; 337 338 // Refresh the max_execution_time to avoid timout error 339 // By default time to scan a directory (without subdirs) is fixed to 30 seconds 340 if (!$conf_safe_mode) 341 { 342 set_time_limit(30); 343 } 327 344 328 345 if ($opendir = opendir($basedir)) … … 436 453 if ($conf['use_exif']) 437 454 { 438 if ($exif = @read_exif_data($dir.'/'.$fs_file)) 455 // Verify activation of exif module 456 if (extension_loaded('exif')) 439 457 { 440 foreach ($conf['use_exif_mapping'] as $pwg_key => $exif_key)458 if ($exif = read_exif_data($dir.'/'.$fs_file)) 441 459 { 442 if (isset($exif[$exif_key]))460 foreach ($conf['use_exif_mapping'] as $pwg_key => $exif_key ) 443 461 { 444 if ( in_array($pwg_key, array('date_creation','date_available') ))462 if (isset($exif[$exif_key])) 445 463 { 446 if (preg_match('/^(\d{4}):(\d{2}):(\d{2})/' 447 ,$exif[$exif_key] 448 ,$matches)) 449 { 450 $element[$pwg_key] = 451 $matches[1].'-'.$matches[2].'-'.$matches[3]; 452 } 453 } 454 else 455 { 456 $element[$pwg_key] = $exif[$exif_key]; 464 if ( in_array($pwg_key, array('date_creation','date_available') ) ) 465 { 466 if (preg_match('/^(\d{4}):(\d{2}):(\d{2})/' 467 ,$exif[$exif_key] 468 ,$matches)) 469 { 470 $element[$pwg_key] = 471 $matches[1].'-'.$matches[2].'-'.$matches[3]; 472 } 473 } 474 else 475 { 476 $element[$pwg_key] = $exif[$exif_key]; 477 } 457 478 } 458 479 } … … 539 560 } 540 561 562 // Looking at the safe_mode configuration for execution time 563 $conf_safe_mode = TRUE; 564 if (ini_get('safe_mode') == 0) 565 { 566 $conf_safe_mode = FALSE; 567 } 568 541 569 echo '<pre>'; 542 570 switch ($page['action'])
Note: See TracChangeset
for help on using the changeset viewer.