Ignore:
Timestamp:
May 27, 2012, 1:31:32 PM (12 years ago)
Author:
grum
Message:

feature:2637 - Compatibility with Piwigo 2.4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/AMetaData/amd_pip.class.inc.php

    r12226 r15343  
    6767    $this->pictureProperties['id']=$page['image_id'];
    6868
    69     $sql="SELECT ti.path, tai.analyzed, ti.has_high FROM ".IMAGES_TABLE." ti
     69    $sql="SELECT ti.path, tai.analyzed FROM ".IMAGES_TABLE." ti
    7070            LEFT JOIN ".$this->tables['images']." tai ON tai.imageId = ti.id
    7171          WHERE ti.id=".$page['image_id'].";";
     
    7373    if($result)
    7474    {
    75       $hasHigh='';
    7675      while($row=pwg_db_fetch_assoc($result))
    7776      {
    7877        $filename=$row['path'];
    79         $hasHigh=$row['has_high'];
    8078        $this->pictureProperties['analyzed']=$row['analyzed'];
    8179      }
    8280      $filename=$path."/".$filename;
    83 
    84       if($hasHigh==='true' and $this->config['amd_UseMetaFromHD']=='y')
    85       {
    86         $filename=dirname($filename)."/pwg_high/".basename($filename);
    87       }
    8881    }
    8982
     
    220213      {
    221214        $group=$tagProperties['gName'];
    222         if(!is_null($md))
    223         {
    224           $metadata[]=$md;
    225           unset($md);
    226         }
    227         $md=Array(
    228           'TITLE' => $tagProperties['gName'],
    229           'lines' => Array()
    230         );
     215        if(!isset($metadata[$group]))
     216        {
     217          $metadata[$group]=Array(
     218                              'TITLE' => $tagProperties['gName'],
     219                              'lines' => Array()
     220                            );
     221        }
    231222      }
    232223
     
    249240        if($value!="")
    250241        {
    251           $md['lines'][L10n::get($picturesTags[$key]->getName())]=AMD_root::prepareValueForDisplay($value, $picturesTags[$key]->isTranslatable());
     242          $metadata[$group]['lines'][L10n::get($picturesTags[$key]->getName())]=AMD_root::prepareValueForDisplay($value, $picturesTags[$key]->isTranslatable());
    252243        }
    253244      }
    254245      elseif($userDefined and isset($userDefinedValues[$tagProperties['numId']]) and $userDefinedValues[$tagProperties['numId']]!='')
    255246      {
    256         $md['lines'][$tagProperties['name']]=$userDefinedValues[$tagProperties['numId']];
    257       }
    258     }
    259 
    260     if(!is_null($md) and count($md['lines'])>0)
    261     {
    262       $metadata[]=$md;
     247        $metadata[$group]['lines'][$tagProperties['name']]=$userDefinedValues[$tagProperties['numId']];
     248      }
    263249    }
    264250
Note: See TracChangeset for help on using the changeset viewer.