Ignore:
Timestamp:
Sep 13, 2010, 8:40:44 PM (14 years ago)
Author:
grum
Message:

Implement metadata search, release 0.5.1
bug:1846, bug:1691

File:
1 edited

Legend:

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

    r6730 r6891  
    1919 */
    2020
    21   @include_once('amd_root.class.inc.php');
     21  include_once('amd_root.class.inc.php');
    2222  include_once(PHPWG_PLUGINS_PATH.'grum_plugins_classes-2/tables.class.inc.php');
    2323
     
    6666  `imageId` mediumint(8) unsigned NOT NULL default '0',
    6767  `numId` int(10) unsigned NOT NULL default '0',
    68   `value` text default NULL,
    69   PRIMARY KEY  USING BTREE (`imageId`,`numId`)
     68  `value` text,
     69  `numValue` decimal(10,8) default NULL,
     70  PRIMARY KEY  USING BTREE (`imageId`,`numId`),
     71  KEY `byNumId` (`numId`,`value`(35)),
     72  KEY `byNumId2` (`numId`,`numValue`)
    7073);",
    7174"CREATE TABLE `".$this->tables['images']."` (
     
    194197    {
    195198      /*
    196        * create new tables
     199       * create new tables & alter existing tables
    197200       */
    198201      $tableDef=array(
     
    215218  KEY `byTagParentId` USING BTREE (`numId`,`parentId`,`order`),
    216219  KEY `byTagOrder` (`numId`,`order`)
    217 );"
     220);",
     221"ALTER TABLE `".$this->tables['images_tags']."`
     222  ADD COLUMN `numValue` DECIMAL(10,8)  DEFAULT NULL AFTER `value`,
     223  ADD INDEX `byNumId`(`numId`, `value`(35)),
     224  ADD INDEX `byNumId2`(`numId`, `numValue`)
     225;"
    218226      );
    219227      $tablesDef = create_table_add_character_set($tablesDef);
     
    305313          $excludeList="";
    306314        }
    307         $sql="SELECT ti.id, ti.path
     315        $sql="SELECT ti.id, ti.path, ti.has_high
    308316              FROM ".IMAGES_TABLE." ti ".$excludeList."
    309317              ORDER BY RAND() LIMIT ".(25-count($listToAnalyze[0])).";";
     
    328336        foreach($listToAnalyze[0] as $val)
    329337        {
    330           $this->analyzeImageFile($path."/".$val['path'], $val['id']);
     338          if($val['has_high']===true and $this->config['amd_UseMetaFromHD']=='y')
     339          {
     340            $this->analyzeImageFile($path."/".dirname($val['path'])."/pwg_high/".basename($val['path']), $val['id']);
     341          }
     342          else
     343          {
     344            $this->analyzeImageFile($path."/".$val['path'], $val['id']);
     345          }
     346
    331347        }
    332348
Note: See TracChangeset for help on using the changeset viewer.