Changeset 7619 for extensions/GMaps


Ignore:
Timestamp:
11/04/10 10:29:48 (9 years ago)
Author:
grum
Message:

fix bug on install/update process

Location:
extensions/GMaps
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/GMaps/gmaps_install.class.inc.php

    r7616 r7619  
    233233      $tablesCreate=array( 
    234234"CREATE TABLE `".$this->tables['cache']."` ( 
    235   `requestId` int(8) UNSIGNED NOT NULL default '0', 
     235  `requestId` mediumint(8) UNSIGNED NOT NULL default '0', 
    236236  `imageId` mediumint(8) NOT NULL, 
    237237  `latitude` decimal(17,14) NOT NULL default '0', 
    238238  `longitude` decimal(17,14) NOT NULL default '0', 
    239239  PRIMARY KEY (`requestId`,`imageId`) 
    240 );", 
     240)", 
    241241"CREATE TABLE `".$this->tables['cache_id']."` ( 
    242242  `requestId` mediumint(8) UNSIGNED NOT NULL auto_increment, 
    243243  `userId` smallint(5) NOT NULL, 
    244   `date` NOT NULL default '0000-00-00 00:00:00', 
     244  `date` timestamp NOT NULL default '0000-00-00 00:00:00', 
    245245  PRIMARY KEY (`requestId`) 
    246246)" 
    247247      ); 
    248248 
    249       $tablesUpdate=array( 
    250         $this->tables['category_maps'] => array( 
    251           'forceDisplay' => " ADD COLUMN `forceDisplay` CHAR(1)  NOT NULL DEFAULT 'n' AFTER `title` ", 
    252         ) 
    253       ); 
    254  
    255249      $tablesDef = create_table_add_character_set($tablesCreate); 
    256250 
    257251      $tablef=new GPCTables(array($this->tables['cache'], $this->tables['cache_id'])); 
    258252      $tablef->create($tablesCreate); 
    259       $tablef->updateTablesFields($tablesUpdate); 
    260253 
    261254      unset($tablesCreate); 
    262       unset($tablesUpdate); 
    263255    } 
    264256 
  • extensions/GMaps/gmaps_root.class.inc.php

    r7616 r7619  
    324324      // new requestId 
    325325      $sql="INSERT INTO ".$this->tables['cache_id']." 
    326             VALUES ('', '".$user['id']."', '".date('Y-m-d h:i:s')."');"; 
     326            VALUES ('', '".$user['id']."', '".date('Y-m-d H:i:s')."');"; 
    327327      $result=pwg_query($sql); 
    328328      if($result) 
     
    343343      // new requestId 
    344344      $sql="UPDATE ".$this->tables['cache_id']." 
    345             SET `date` = '".date('Y-m-d h:i:s')."' 
     345            SET `date` = '".date('Y-m-d H:i:s')."' 
    346346            WHERE requestId='$requestId';"; 
    347347      pwg_query($sql); 
     
    356356    protected function cleanCache($time=300) 
    357357    { 
    358       $date=date('Y-m-d h:i:s', time()-$time); 
     358      $date=date('Y-m-d H:i:s', time()-$time); 
    359359 
    360360      $sql="DELETE FROM ".$this->tables['cache']." pgc 
Note: See TracChangeset for help on using the changeset viewer.