Changeset 2560


Ignore:
Timestamp:
Sep 21, 2008, 1:06:20 PM (16 years ago)
Author:
rvelices
Message:
  • fix function get_fulldirs - works correctly eent for wrong params (virtual cats)
  • fix functions_metadata.php - could not be included from inside another function
Location:
trunk/admin/include
Files:
2 edited

Legend:

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

    r2551 r2560  
    799799  WHERE dir IS NOT NULL
    800800;';
    801   $result = pwg_query($query);
    802   $cat_dirs = array();
    803   while ($row = mysql_fetch_array($result))
    804   {
    805     $cat_dirs[$row['id']] = $row['dir'];
    806   }
     801  $cat_dirs = simple_hash_from_query($query, 'id', 'dir');
    807802
    808803  // caching galleries_url
     
    811806  FROM '.SITES_TABLE.'
    812807;';
    813   $result = pwg_query($query);
    814   $galleries_url = array();
    815   while ($row = mysql_fetch_array($result))
    816   {
    817     $galleries_url[$row['id']] = $row['galleries_url'];
    818   }
     808  $galleries_url = simple_hash_from_query($query, 'id', 'galleries_url');
    819809
    820810  // categories : id, site_id, uppercats
     
    824814SELECT id, uppercats, site_id
    825815  FROM '.CATEGORIES_TABLE.'
    826   WHERE id IN (
     816  WHERE dir IS NOT NULL
     817    AND id IN (
    827818'.wordwrap(implode(', ', $cat_ids), 80, "\n").')
    828819;';
  • trunk/admin/include/functions_metadata.php

    r2521 r2560  
    2424include_once(PHPWG_ROOT_PATH.'/include/functions_metadata.inc.php');
    2525
    26 $page['datefields'] = array('date_creation', 'date_available');
    2726
    2827function get_sync_iptc_data($file)
    2928{
    30   global $conf, $page;
     29  global $conf;
    3130
    3231  $map = $conf['use_iptc_mapping'];
     
    3635  foreach ($iptc as $pwg_key => $value)
    3736  {
    38     if (in_array($pwg_key, $page['datefields']))
     37    if (in_array($pwg_key, array('date_creation', 'date_available')))
    3938    {
    4039      if (preg_match('/(\d{4})(\d{2})(\d{2})/', $value, $matches))
     
    7271function get_sync_exif_data($file)
    7372{
    74   global $conf, $page;
     73  global $conf;
    7574
    7675  $exif = get_exif_data($file, $conf['use_exif_mapping']);
     
    7877  foreach ($exif as $pwg_key => $value)
    7978  {
    80     if (in_array($pwg_key, $page['datefields']))
     79    if (in_array($pwg_key, array('date_creation', 'date_available')))
    8180    {
    8281      if (preg_match('/^(\d{4}).(\d{2}).(\d{2})/', $value, $matches))
Note: See TracChangeset for help on using the changeset viewer.