From 4d86bb2234af3939f1e8add3633deaa425fe526e Mon Sep 17 00:00:00 2001 From: rvelices Date: Fri, 12 Sep 2008 02:17:35 +0000 Subject: - images.file categories.permalink old_permalinks.permalink - become binary - session security improvement: now the sessions are valid only for originating ip addr (with mask 255.255.0.0 to allow users behind load balancing proxies) -> stealing the session cookie is almost a non issue (with the exception of the 65536 machines in range) - metadata sync from the sync button does not overwrite valid data with empty metadata - other small fixes/enhancements: - added event get_category_image_orders - fix display issue with redirect.tpl (h1/h2 within h1) - fix known_script smarty function registration - query search form not submitted if q is empty - better admin css rules - some other minor changes (ws_core, rest_handler, functions_search...) git-svn-id: http://piwigo.org/svn/trunk@2521 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/include/functions_metadata.php | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) (limited to 'admin/include/functions_metadata.php') diff --git a/admin/include/functions_metadata.php b/admin/include/functions_metadata.php index e805aeba6..51867b448 100644 --- a/admin/include/functions_metadata.php +++ b/admin/include/functions_metadata.php @@ -28,9 +28,9 @@ $page['datefields'] = array('date_creation', 'date_available'); function get_sync_iptc_data($file) { global $conf, $page; - + $map = $conf['use_iptc_mapping']; - + $iptc = get_iptc_data($file, $map); foreach ($iptc as $pwg_key => $value) @@ -108,7 +108,7 @@ function update_metadata($files) { array_push($image_ids, $id); } - + $query = ' SELECT id FROM '.IMAGES_TABLE.' @@ -118,18 +118,14 @@ SELECT id ) ;'; - $result = pwg_query($query); - while ($row = mysql_fetch_array($result)) - { - array_push($has_high_images, $row['id']); - } + $has_high_images = array_from_query($query, 'id'); foreach ($files as $id => $file) { $data = array(); $data['id'] = $id; $data['filesize'] = floor(filesize($file)/1024); - + if ($image_size = @getimagesize($file)) { $data['width'] = $image_size[0]; @@ -142,7 +138,7 @@ SELECT id $data['high_filesize'] = floor(filesize($high_file)/1024); } - + if ($conf['use_exif']) { $exif = get_sync_exif_data($file); @@ -161,7 +157,7 @@ SELECT id { $tags_of[$id] = array(); } - + foreach (explode(',', $iptc[$key]) as $tag_name) { array_push( @@ -178,7 +174,7 @@ SELECT id array_push($datas, $data); } - + if (count($datas) > 0) { $update_fields = @@ -189,7 +185,7 @@ SELECT id 'high_filesize', 'date_metadata_update' ); - + if ($conf['use_exif']) { $update_fields = @@ -198,7 +194,7 @@ SELECT id array_keys($conf['use_exif_mapping']) ); } - + if ($conf['use_iptc']) { $update_fields = @@ -217,7 +213,8 @@ SELECT id 'primary' => array('id'), 'update' => array_unique($update_fields) ), - $datas + $datas, + MASS_UPDATES_SKIP_EMPTY ); } @@ -234,12 +231,12 @@ SELECT id * @param boolean only newly added files ? * @return array */ -function get_filelist($category_id = '', $site_id=1, $recursive = false, +function get_filelist($category_id = '', $site_id=1, $recursive = false, $only_new = false) { // filling $cat_ids : all categories required $cat_ids = array(); - + $query = ' SELECT id FROM '.CATEGORIES_TABLE.' @@ -292,7 +289,7 @@ SELECT id, path { $files[$row['id']] = $row['path']; } - + return $files; } ?> \ No newline at end of file -- cgit v1.2.3