Changeset 858 for trunk/admin/include


Ignore:
Timestamp:
Sep 3, 2005, 6:36:05 PM (19 years ago)
Author:
plg
Message:
  • 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
Location:
trunk/admin/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/functions.php

    r833 r858  
    365365  // deletion of calculated permissions linked to the user
    366366  $query = '
    367 DELETE FROM '.USER_FORBIDDEN_TABLE.'
     367DELETE FROM '.USER_CACHE_TABLE.'
    368368  WHERE user_id = '.$user_id.'
    369369;';
  • trunk/admin/include/functions_metadata.php

    r825 r858  
    2828include_once(PHPWG_ROOT_PATH.'/include/functions_metadata.inc.php');
    2929
     30$page['datefields'] = array('date_creation', 'date_available');
     31
    3032function get_sync_iptc_data($file)
    3133{
    32   global $conf;
     34  global $conf, $page;
    3335 
    3436  $map = $conf['use_iptc_mapping'];
    35   $datefields = array('date_creation', 'date_available');
    3637 
    3738  $iptc = get_iptc_data($file, $map);
     
    3940  foreach ($iptc as $pwg_key => $value)
    4041  {
    41     if (in_array($pwg_key, $datefields))
     42    if (in_array($pwg_key, $page['datefields']))
    4243    {
    4344      if (preg_match('/(\d{4})(\d{2})(\d{2})/', $value, $matches))
     
    6061}
    6162
     63function 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
    6283function update_metadata($files)
    6384{
     
    85106    if ($conf['use_exif'])
    86107    {
    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)
    95113        {
    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]);
    98115        }
    99116      }
     
    129146                                   array_keys($conf['use_iptc_mapping']));
    130147    }
    131    
     148
    132149    $fields = array('primary' => array('id'),
    133150                    'update'  => array_unique($update_fields));
Note: See TracChangeset for help on using the changeset viewer.