Ignore:
Timestamp:
Feb 2, 2014, 8:28:37 PM (11 years ago)
Author:
maron
Message:
  • Added: Export last 2 version in addon
  • Fixed: Export text only once in addon
  • Added: 100% done in progress
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Export/CreateAddon.php

    r731 r776  
    133133
    134134        $Buffer = 'CZWOW_'.$Column['AddonFileName'].'_count='.$FileIndex.';CZWOW_'.$Column['AddonFileName'].'_'.$FileIndex.'={';
    135    
    136         $DbResult2 = $this->Database->query($this->BuildQuery($Group,$ExportVersion));
     135        $TableTexts = array();
     136   
     137        //old version
     138        //get version before
     139        $BuildNumber = $ExportVersion;
     140        if ($ExportVersion == '') $BuildNumber = $this->ClientVersion['BuildNumber'];
     141        $ID = $this->Database->query('SELECT `BuildNumber` FROM `ClientVersion` WHERE '.
     142        ' `Imported` = 1 AND `BuildNumber` < '.$BuildNumber.' ORDER BY  `BuildNumber` DESC LIMIT 1'); 
     143        if($ID->num_rows > 0) {       
     144          $ExportVersionOld = $ID->fetch_assoc();
     145          $ExportVersionOld = $ExportVersionOld['BuildNumber'];
    137146       
     147          echo 'old:'.$ExportVersionOld.' last:'.$ExportVersion;
     148
     149          $DbResult2 = $this->Database->query($this->BuildQuery($Group,$ExportVersionOld));       
     150          while($Line = $DbResult2->fetch_assoc())
     151          {
     152            $en = trim($this->ReplaceEnText($Line['En'.$Column['Column']])); 
     153            $cz = $this->ReplaceCzText($Line[$Column['Column']]);
     154            if(($en <> '') and ($cz <> '') and ($this->NotCancel($en)))
     155            {
     156               $TableTexts[$en] = $cz;
     157            }
     158          }
     159        }
     160                //last version
     161       
     162        $DbResult2 = $this->Database->query($this->BuildQuery($Group,$ExportVersion));       
    138163        while($Line = $DbResult2->fetch_assoc())
    139164        {
     
    142167          if(($en <> '') and ($cz <> '') and ($this->NotCancel($en)))
    143168          {
    144             $Buffer .= "\n".'["'.$en.'"]="'.$cz.'",';
    145             $i++;
     169             $TableTexts[$en] = $cz;
    146170          }
    147171        }
     172       
     173        foreach($TableTexts as $key => $value) {
     174            $Buffer .= "\n".'["'.$key.'"]="'.$value.'",';
     175            $i++;
     176        }
     177       
    148178   
    149179        $Buffer = $Buffer."\n};if not CZWOW_".$Column['AddonFileName']." then CZWOW_".$Column['AddonFileName']."=0; end; CZWOW_".$Column['AddonFileName']."=CZWOW_".$Column['AddonFileName']."+".$i.";\n";
Note: See TracChangeset for help on using the changeset viewer.