Changeset 681 for trunk/Modules/Export


Ignore:
Timestamp:
Jan 1, 2014, 2:40:05 PM (11 years ago)
Author:
maron
Message:
  • Added: Setting for generation in cmd
  • Fixed: import old Version
Location:
trunk/Modules/Export
Files:
2 edited

Legend:

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

    r677 r681  
    101101
    102102    return($Query);
     103  }
     104 
     105  function NeedGeneration()
     106  {
     107    $this->LoadFilters();
     108    if ($this->Export['OutputType'] == 10) $file = $this->TempDir.'Instalace_CzechWoW_'.$this->ClientVersion['Version'].'.exe';
     109    if ($this->Export['OutputType'] == 9) $file = $this->TempDir.'CzWoW_DBC.zip';
     110
     111    if (file_exists($file))
     112      $date = date('Y-m-d H:i',(filemtime($file)));
     113    else return(true);
     114  // echo $file;
     115   
     116    $DbResult = $this->Database->query('SELECT `Group`.* FROM `ExportGroup` '.
     117        'JOIN `Group` ON `Group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id);
     118    $result = false;         
     119    while($Group = $DbResult->fetch_assoc())
     120    {
     121      $Query = 'SELECT * FROM `'.$Group['TablePrefix'].'` AS `T`'.
     122      ' JOIN `ExportUser` ON (`ExportUser`.`User`=`T`.`User`) AND (`ExportUser`.`Export`='.$this->Id.') '.
     123      ' JOIN `User` ON `User`.`ID`=`T`.`User`'.
     124      ' JOIN `ExportLanguage` ON (`ExportLanguage`.`Export`='.$this->Id.')'.
     125      ' WHERE ( \''.$date.'\' < `T`.`ModifyTime`) AND (`Complete` = 1) AND (`VersionStart` <= '.$this->ClientVersion['BuildNumber'].') AND (`VersionEnd` >= '.$this->ClientVersion['BuildNumber'].')'.
     126      ' ';
     127
     128        $DbResult2 = $this->Database->query($Query);
     129        if ($DbResult2->num_rows > 0) {
     130          $result = true;
     131        } 
     132    } 
     133    return($result);
    103134  }
    104135 
  • trunk/Modules/Export/cmdmpqexport.php

    r669 r681  
    3636  }
    3737}
    38 if(!array_key_exists('ExportId', $_GET) and !array_key_exists('version', $_GET) and !array_key_exists('dbc', $_GET) and !array_key_exists('lua', $_GET) and !array_key_exists('addon', $_GET)) {
     38if(!array_key_exists('ExportId', $_GET) and !array_key_exists('needgeneration', $_GET) and !array_key_exists('version', $_GET) and !array_key_exists('dbc', $_GET) and !array_key_exists('lua', $_GET) and !array_key_exists('addon', $_GET)) {
    3939  $Output .= 'Usage type_export=id_export -for export<br />';
    4040  $Output .= 'Usage ExportId=id_export - for write export info<br />';
     41  $Output .= 'Usage needgeneration=id_export - for write export info<br />';
    4142 
    4243  $Output .= 'type_export={lua,dbc,addon} <br />';
     
    8687}
    8788
     89if(array_key_exists('needgeneration', $_GET)) {
     90  $Export = new Export($System);
     91  $Export->Id = $_GET['needgeneration'];
     92  $Output .= $Export->Init();                   
     93  if ($Export->NeedGeneration()) {
     94    $DbResult = $System->Database->query('SELECT * FROM ExportTask WHERE Export = '.$Export->Id);
     95    if($DbResult->num_rows == 0)
     96    {
     97      $System->Database->query('INSERT INTO ExportTask (`Export` ,`TimeStart` ) VALUES ('.$Export->Id.', NOW())');
     98    } else 
     99      $System->Database->query('UPDATE ExportTask SET TimeStart = NOW(), TimeFinish = NULL WHERE Export = '.$Export->Id);
     100
     101    $System->ModuleManager->Modules['Log']->WriteLog('Zadání úlohy pro vygenerování dbc souboru', LOG_TYPE_DOWNLOAD);
     102    $Output .= 'Export set to generation';
     103  } else     $Output .= 'Export do not need generation';
     104  $Output = str_replace('<br/>','
     105',$Output);
     106  $Output = str_replace('<br />','
     107',$Output);
     108}
     109
    88110if(array_key_exists('ExportId', $_GET)) {
    89111  $Export = new Export($System);
     
    127149'<h2>Nejčastější otázky</h2>'.
    128150'<p><strong>Jak mám hru spustit?</strong><br>'.
    129 'Hru musíte spustit přes soubor WoWLua.exe v kořenovém adresáři hry.</p>'.
     151'Hru musíte spustit přes soubor WowCz.exe v kořenovém adresáři hry.</p>'.
    130152
    131153'<p><strong>Mohu použít tuto češtinu na oficiálních serverech?</strong><br>'.
Note: See TracChangeset for help on using the changeset viewer.