aboutsummaryrefslogtreecommitdiffstats
path: root/admin/include
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2005-09-03 16:36:05 +0000
committerplegall <plg@piwigo.org>2005-09-03 16:36:05 +0000
commit7eae7595909a49d4355453c73638151097a53f20 (patch)
treeec20fce221086be1ece0f292a953264d90ec5360 /admin/include
parent857eec2218afe027b9d87f91aa7de144fc4e3111 (diff)
- modification : less configuration parameters in administration
screen. These parameters are move to include/config_default.inc.php. - new : ability to add a single picture to caddie from picture.php - new : contextual help, only a few pages are available. - new : ability to delete users from admin/user_list - modification : reorganization of configuration file - new : configuration parameter use_exif_mapping - improvement : MOD hidemail added to standard git-svn-id: http://piwigo.org/svn/trunk@858 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/include/functions.php2
-rw-r--r--admin/include/functions_metadata.php43
2 files changed, 31 insertions, 14 deletions
diff --git a/admin/include/functions.php b/admin/include/functions.php
index 2b7a9a5cc..78ec15a09 100644
--- a/admin/include/functions.php
+++ b/admin/include/functions.php
@@ -364,7 +364,7 @@ DELETE FROM '.SESSIONS_TABLE.'
// deletion of calculated permissions linked to the user
$query = '
-DELETE FROM '.USER_FORBIDDEN_TABLE.'
+DELETE FROM '.USER_CACHE_TABLE.'
WHERE user_id = '.$user_id.'
;';
pwg_query($query);
diff --git a/admin/include/functions_metadata.php b/admin/include/functions_metadata.php
index 23b04833c..4836f85a3 100644
--- a/admin/include/functions_metadata.php
+++ b/admin/include/functions_metadata.php
@@ -27,18 +27,19 @@
include_once(PHPWG_ROOT_PATH.'/include/functions_metadata.inc.php');
+$page['datefields'] = array('date_creation', 'date_available');
+
function get_sync_iptc_data($file)
{
- global $conf;
+ global $conf, $page;
$map = $conf['use_iptc_mapping'];
- $datefields = array('date_creation', 'date_available');
$iptc = get_iptc_data($file, $map);
foreach ($iptc as $pwg_key => $value)
{
- if (in_array($pwg_key, $datefields))
+ if (in_array($pwg_key, $page['datefields']))
{
if (preg_match('/(\d{4})(\d{2})(\d{2})/', $value, $matches))
{
@@ -59,6 +60,26 @@ function get_sync_iptc_data($file)
return $iptc;
}
+function get_sync_exif_data($file)
+{
+ global $conf, $page;
+
+ $exif = get_exif_data($file, $conf['use_exif_mapping']);
+
+ foreach ($exif as $pwg_key => $value)
+ {
+ if (in_array($pwg_key, $page['datefields']))
+ {
+ if (preg_match('/^(\d{4}).(\d{2}).(\d{2})/', $value, $matches))
+ {
+ $exif[$pwg_key] = $matches[1].'-'.$matches[2].'-'.$matches[3];
+ }
+ }
+ }
+
+ return $exif;
+}
+
function update_metadata($files)
{
global $conf;
@@ -84,17 +105,13 @@ function update_metadata($files)
if ($conf['use_exif'])
{
- if (!function_exists('read_exif_data'))
- {
- die('Exif extension not available, admin should disable exif use');
- }
-
- if ($exif = @read_exif_data($file))
+ $exif = get_sync_exif_data($file);
+
+ if (count($exif) > 0)
{
- if (isset($exif['DateTime']))
+ foreach (array_keys($exif) as $key)
{
- preg_match('/^(\d{4}).(\d{2}).(\d{2})/',$exif['DateTime'],$matches);
- $data['date_creation'] = $matches[1].'-'.$matches[2].'-'.$matches[3];
+ $data[$key] = addslashes($exif[$key]);
}
}
}
@@ -128,7 +145,7 @@ function update_metadata($files)
$update_fields = array_merge($update_fields,
array_keys($conf['use_iptc_mapping']));
}
-
+
$fields = array('primary' => array('id'),
'update' => array_unique($update_fields));
mass_updates(IMAGES_TABLE, $fields, $datas);