Ignore:
Timestamp:
Apr 21, 2010, 9:27:51 PM (14 years ago)
Author:
grum
Message:

Update plugin for Piwigo 2.1

File:
1 edited

Legend:

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

    r5790 r5935  
    3030    {
    3131      parent::__construct($prefixeTable, $filelocation);
    32       $this->tablef= new manage_tables($this->tables);
     32      $this->tablef= new GPCTables($this->tables);
    3333    }
    3434
     
    4646    {
    4747      global $user, $lang;
     48
     49      $this->initConfig();
     50      $this->loadConfig();
     51      $this->config['installed']=AMD_VERSION2;
     52      $this->saveConfig();
    4853
    4954      $tables_def=array(
     
    9095      //$table_def array
    9196      $tables_def = create_table_add_character_set($tables_def);
    92       $result=$this->tablef->create_tables($tables_def);
     97      $result=$this->tablef->create($tables_def);
    9398      unset($tables_def);
    9499
     
    121126    public function uninstall()
    122127    {
    123       $this->delete_config();
    124       $this->tablef->drop_tables();
     128      $this->deleteConfig();
     129      $this->tablef->drop();
    125130    }
    126131
     
    142147      foreach(AMD_JpegMetaData::getTagList(Array('filter' => AMD_JpegMetaData::TAGFILTER_IMPLEMENTED, 'xmp' => true, 'maker' => true, 'iptc' => true)) as $key => $val)
    143148      {
    144         $sql="INSERT INTO ".$this->tables['used_tags']." VALUES('', '".$key."', '".(($val['translatable'])?'y':'n')."', '".$val['name']."', 0, '".L10n::get($val['name'])."');";
     149        $sql="INSERT INTO ".$this->tables['used_tags']." VALUES('', '".$key."', '".(($val['translatable'])?'y':'n')."', '".$val['name']."', 0, '".addslashes(L10n::get($val['name']))."');";
    145150        pwg_query($sql);
    146151      }
     
    154159              LEFT JOIN ".IMAGES_TABLE." ti ON ti.id = tc.element_id
    155160            WHERE tc.user_id = ".$user['id']."
     161              AND ti.id IS NOT NULL
    156162            ORDER BY RAND() LIMIT 25;";
    157163      $result=pwg_query($sql);
     
    207213      }
    208214
    209       $this->init_config();
    210       $this->load_config();
    211       $this->save_config();
     215      $this->initConfig();
     216      $this->loadConfig();
     217      $this->config['installed']=AMD_VERSION2; //update the installed release number
     218      $this->saveConfig();
    212219    }
    213220
Note: See TracChangeset for help on using the changeset viewer.