Changeset 1029 for trunk/tools


Ignore:
Timestamp:
Feb 8, 2006, 2:17:07 AM (18 years ago)
Author:
rvelices
Message:
  • remake of Remote sites and Synchronize:
    • synchronization for remote and local sites are done by the same code
    • remote sites can update metadata now (not before) - bug 279
    • fixes bug 82: has_high column
  • improve feature 280: user sort by filename
  • fix path to template mimetypes icons
  • bug 284: session cookie lifetime, deletion on logout and corrected issue

when db upgrades were missing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/create_listing_file.php

    r1020 r1029  
    4545$conf['version'] = '%PWGVERSION%';
    4646
    47 // $conf['use_exif'] set to true if you want to use Exif Date as "creation
    48 // date" for the element, otherwise, set to false
     47// $conf['use_exif'] set to true if you want to use Exif information
    4948$conf['use_exif'] = true;
     49
     50// use_exif_mapping: same behaviour as use_iptc_mapping
     51$conf['use_exif_mapping'] = array(
     52  'date_creation' => 'DateTimeOriginal'
     53  );
    5054
    5155// $conf['use_iptc'] set to true if you want to use IPTC informations of the
     
    321325      if ($file != '.'
    322326          and $file != '..'
     327          and $file != '.svn'
    323328          and $file != 'thumbnail'
    324329          and $file != 'pwg_high'
     
    345350    $dirs.= "\n".$indent.'</dir'.$level.'>';
    346351  }
    347   return $dirs;         
     352  return $dirs;   
    348353}
    349354
     
    426431          if ($exif = @read_exif_data($dir.'/'.$fs_file))
    427432          {
    428             if (isset($exif['DateTime']))
     433            foreach ($conf['use_exif_mapping'] as $pwg_key => $exif_key )
    429434            {
    430               preg_match('/^(\d{4}):(\d{2}):(\d{2})/'
    431                          ,$exif['DateTime']
    432                          ,$matches);
    433               $element['date_creation'] =
    434                 $matches[1].'-'.$matches[2].'-'.$matches[3];
     435              if (isset($exif[$exif_key]))
     436              {
     437                if ( in_array($pwg_key, array('date_creation','date_available') ) )
     438                {
     439                   if (preg_match('/^(\d{4}):(\d{2}):(\d{2})/'
     440                         ,$exif[$exif_key]
     441                         ,$matches))
     442                   {
     443                     $element[$pwg_key] =
     444                        $matches[1].'-'.$matches[2].'-'.$matches[3];
     445                   }
     446                }
     447                else
     448                {
     449                  $element[$pwg_key] = $exif[$exif_key];
     450                }
     451              }
    435452            }
    436453          }
     
    525542    $listing.= ' generation_date="'.date('Y-m-d').'"';
    526543    $listing.= ' phpwg_version="'.$conf{'version'}.'"';
     544   
     545    $attrs=array();
     546    if ($conf['use_iptc'])
     547    {
     548      $attrs = array_merge($attrs, array_keys($conf['use_iptc_mapping']) );
     549    }
     550    if ($conf['use_exif'])
     551    {
     552      $attrs = array_merge($attrs, array_keys($conf['use_exif_mapping']) );
     553    }
     554    $listing.= ' metadata="'.implode(',',array_unique($attrs)).'"';
    527555   
    528556    $end = strrpos($_SERVER['PHP_SELF'], '/') + 1;
Note: See TracChangeset for help on using the changeset viewer.