Changeset 858 for trunk/admin/include
- Timestamp:
- Sep 3, 2005, 6:36:05 PM (19 years ago)
- Location:
- trunk/admin/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/include/functions.php
r833 r858 365 365 // deletion of calculated permissions linked to the user 366 366 $query = ' 367 DELETE FROM '.USER_ FORBIDDEN_TABLE.'367 DELETE FROM '.USER_CACHE_TABLE.' 368 368 WHERE user_id = '.$user_id.' 369 369 ;'; -
trunk/admin/include/functions_metadata.php
r825 r858 28 28 include_once(PHPWG_ROOT_PATH.'/include/functions_metadata.inc.php'); 29 29 30 $page['datefields'] = array('date_creation', 'date_available'); 31 30 32 function get_sync_iptc_data($file) 31 33 { 32 global $conf ;34 global $conf, $page; 33 35 34 36 $map = $conf['use_iptc_mapping']; 35 $datefields = array('date_creation', 'date_available');36 37 37 38 $iptc = get_iptc_data($file, $map); … … 39 40 foreach ($iptc as $pwg_key => $value) 40 41 { 41 if (in_array($pwg_key, $ datefields))42 if (in_array($pwg_key, $page['datefields'])) 42 43 { 43 44 if (preg_match('/(\d{4})(\d{2})(\d{2})/', $value, $matches)) … … 60 61 } 61 62 63 function get_sync_exif_data($file) 64 { 65 global $conf, $page; 66 67 $exif = get_exif_data($file, $conf['use_exif_mapping']); 68 69 foreach ($exif as $pwg_key => $value) 70 { 71 if (in_array($pwg_key, $page['datefields'])) 72 { 73 if (preg_match('/^(\d{4}).(\d{2}).(\d{2})/', $value, $matches)) 74 { 75 $exif[$pwg_key] = $matches[1].'-'.$matches[2].'-'.$matches[3]; 76 } 77 } 78 } 79 80 return $exif; 81 } 82 62 83 function update_metadata($files) 63 84 { … … 85 106 if ($conf['use_exif']) 86 107 { 87 if (!function_exists('read_exif_data')) 88 { 89 die('Exif extension not available, admin should disable exif use'); 90 } 91 92 if ($exif = @read_exif_data($file)) 93 { 94 if (isset($exif['DateTime'])) 108 $exif = get_sync_exif_data($file); 109 110 if (count($exif) > 0) 111 { 112 foreach (array_keys($exif) as $key) 95 113 { 96 preg_match('/^(\d{4}).(\d{2}).(\d{2})/',$exif['DateTime'],$matches); 97 $data['date_creation'] = $matches[1].'-'.$matches[2].'-'.$matches[3]; 114 $data[$key] = addslashes($exif[$key]); 98 115 } 99 116 } … … 129 146 array_keys($conf['use_iptc_mapping'])); 130 147 } 131 148 132 149 $fields = array('primary' => array('id'), 133 150 'update' => array_unique($update_fields));
Note: See TracChangeset
for help on using the changeset viewer.