Changeset 369
- Timestamp:
- Mar 9, 2010, 3:22:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/export/export.php
r366 r369 30 30 $DbResult = $this->Database->query('SELECT * FROM `ExportLanguage` WHERE `Export`='.$this->Id.' ORDER BY `Sequence`'); 31 31 while($Language = $DbResult->fetch_assoc()) 32 $this->WhereLang .= ' OR ( `Language`= '.$Language['Language'].')';32 $this->WhereLang .= ' OR (Language = '.$Language['Language'].')'; 33 33 if($this->WhereLang == '') $this->WhereLang = 1; 34 34 else $this->WhereLang = '('.substr($this->WhereLang, 4).')'; … … 52 52 } else 53 53 { 54 $this->WhereUsers = '( `User`IN ('.$this->SelectedUsers.'))';55 $this->OrderByUserList = ' ORDER BY FIELD( `User`, '.$this->SelectedUsers.')';54 $this->WhereUsers = '(User IN ('.$this->SelectedUsers.'))'; 55 $this->OrderByUserList = ' ORDER BY FIELD(User, '.$this->SelectedUsers.')'; 56 56 } 57 57 … … 237 237 { 238 238 echo($Group['Name'].'... '); 239 if(file_exists('../source/'.$this->ClientVersion['Version'].'/dbc/'.$Group['DBCFileName'].'.dbc')) 240 { 241 $DBCFile = new DBCFile(); 242 $DBCFile->OpenFile('../source/'.$this->ClientVersion['Version'].'/dbc/'.$Group['DBCFileName'].'.dbc', GetDBCColumns($this->ClientVersion['Version'], $Group['DBCFileName'])); 243 $DBCFile2 = new DBCFile(); 244 if(!file_exists($this->TempDir.'dbc/')) mkdir($this->TempDir.'dbc/', 0777, true); 245 $DBCFile2->CreateFile($this->TempDir.'dbc/'.$Group['DBCFileName'].'.dbc', GetDBCColumns($this->ClientVersion['Version'], $Group['DBCFileName'])); 246 $Count = $DBCFile->GetRecordCount(); 247 //if($Group['DBCFileName'] == 'Spell') $Count = 1000; 248 $Line = $DBCFile->GetLine(0); 249 $DBCFile2->SetRecordCount($Count); 250 for($I = 0; $I < $Count; $I++) 251 { 252 $Line = $DBCFile->GetLine($I); 253 $Query = 'SELECT * FROM (SELECT * FROM '.$Group['TablePrefix'].' WHERE (`Complete` = 1) AND '.$this->WhereLang.' AND '.$this->WhereUsers.' AND (`Entry`='.$Line[0].') AND `VersionStart` <= '.$this->ClientVersion['BuildNumber'].' AND `VersionEnd` >= '.$this->ClientVersion['BuildNumber'].' ORDER BY FIELD(`User`, '.$this->SelectedUsers.')) AS `T` GROUP BY `T`.`Entry`'; 254 $DbResult2 = $this->Database->query($Query); 255 if($DbResult2->num_rows > 0) 256 { 257 $DbRow = $DbResult2->fetch_assoc(); 258 // if($Setting['Diacritics'] != 1) $Buffer = utf2ascii($Buffer); 259 260 foreach($TranslationTree[$Group['Id']]['Items'] as $GroupItem) 261 if(GetDBCColumnIndex($this->ClientVersion['Version'], $Group['DBCFileName'], $GroupItem['Column']) != '') 262 $Line[GetDBCColumnIndex($this->ClientVersion['Version'], $Group['DBCFileName'],$GroupItem['Column'])] = $DbRow[$GroupItem['Column']]; 263 //print_r($Line); 264 } 265 $DBCFile2->SetLine($I, $Line); 266 echo('.'); 267 } 268 $DBCFile2->Commit(); 269 echo('Hotovo <br />'); 270 } else echo('Zdrojový soubor '.'../source/'.$this->ClientVersion['Version'].'/dbc/'.$Group['DBCFileName'].'.dbc'.' nenalezen.'."\n"); 239 if(file_exists('../source/'.$this->ClientVersion['Version'].'/dbc/'.$Group['DBCFileName'].'.dbc')) { 240 241 $i = 1; 242 $columns = ''; 243 foreach($TranslationTree[$Group['Id']]['Items'] as $Column) { 244 $columns .= ' T.'.$Column['Column'].' as text'.$i.','; 245 $i = $i+1; 246 } 247 248 $querty = '"SELECT '.$columns.' T.entry as entry FROM (SELECT * FROM '.$Group['TablePrefix'].' WHERE (Complete = 1) AND '.$this->WhereLang.' AND '.$this->WhereUsers.' AND VersionStart <= '.$this->ClientVersion['BuildNumber'].' AND VersionEnd >= '.$this->ClientVersion['BuildNumber'].') AS T GROUP BY T.entry"'; 249 250 $params = ' -f ../source/'.$this->ClientVersion['Version'].'/dbc/'.$Group['DBCFileName'].'.dbc -n '.$this->TempDir.'dbc/'.$Group['DBCFileName'].'.dbc -c '.GetDBCColumns($this->ClientVersion['Version'], $Group['DBCFileName']).' -q '.$querty; 251 252 exec('./DBCExport '.$params); 253 254 echo('Hotovo <br /> 255 '); 256 } else echo('Zdrojový soubor '.'../source/'.$this->ClientVersion['Version'].'/dbc/'.$Group['DBCFileName'].'.dbc'.' nenalezen.'."\n"); 271 257 } 272 258 } -
trunk/export/export_output.php
r366 r369 179 179 180 180 echo('<form action="?Action=View&Tab=6&ExportId='.$ExportId.'" method="post"><input type="submit" name="Regenerate" value="Přegenerovat"/></form><br />'); 181 echo('U DBC souborů export textů funguje jinak, protože generování je náročné, jsou požadavky zařazovány do fronty a postupně zpracovávány.<br />DBC soubory je nutné zabalit do souboru patch-enGB-5.MPQ uvnitř složky "DBFilesClient" a hru spouštět přes program wowme.exe (WoW Model Edit) . Zabalit je můžete pomocí programu <a href="../download/mpqediten32.zip">Ladik\'s MPQ Editor</a>. Stav vygenerování můžete sledovat na této stránce.<br /><br />');181 echo('U DBC souborů export textů funguje jinak, protože generování je náročné, jsou požadavky zařazovány do fronty a postupně zpracovávány.<br />DBC soubory je nutné zabalit do souboru patch-enGB-5.MPQ uvnitř složky "DBFilesClient" a hru spouštět přes program wowme.exe (WoW Model Edit) u verzí klienta starší než 3.2.0. Od této verze již wowme není potřeba. Zabalit je můžete pomocí programu <a href="../download/mpqediten32.zip">Ladik\'s MPQ Editor</a>. Stav vygenerování můžete sledovat na této stránce.<br /><br />'); 182 182 183 183 $DbResult = $Database->SQLCommand('SELECT * FROM ExportTask WHERE Export = '.$ExportId); … … 190 190 if(array_key_exists('Regenerate', $_POST)) 191 191 { 192 $Database->SQLCommand('UPDATE `ExportTask` SET `TimeStart` = NOW(), `TimeFinish` = NULL');192 $Database->SQLCommand('UPDATE ExportTask SET TimeStart = NOW(), TimeFinish = NULL WHERE Export = '.$ExportId); 193 193 echo('Soubor zařazen znovu ke zpracování.<br/><br/>'); 194 194 } -
trunk/export/process_task.php
r366 r369 8 8 include_once('export_output.php'); 9 9 10 LoadCommandLineParameters();10 //LoadCommandLineParameters(); 11 11 12 12 while(1) … … 27 27 echo('Generování DBC souborů pro export '.$Export->Id.'.. '."\n"); 28 28 $Export->ExportToDBC(); 29 $SaveFilename = $Export->TempDir.'/CzWoW_DBC.zip';29 /* $SaveFilename = $Export->TempDir.'/CzWoW_DBC.zip'; 30 30 $Zip = new zipfile(); 31 31 CreateZipFromDir($Zip, $Export->TempDir.'dbc/', 'DBFilesClient/'); 32 32 $Buffer = $Zip->file(); 33 file_put_contents($SaveFilename, $Buffer); 33 file_put_contents($SaveFilename, $Buffer); */ 34 echo ('Archivuji..'); 35 exec('zip -r '.$Export->TempDir.'/CzWoW_DBC.zip '.$Export->TempDir.'dbc/'); 34 36 echo('Hotovo'); 35 37 } else echo('Funkce pro tvorbu Zip souboru není podporována!'); -
trunk/includes/global_function.php
r366 r369 262 262 $Result[$DbRow['Id']] = $DbRow; 263 263 } 264 $DbResult = $Database->SQLCommand('SELECT * FROM `GroupItem` ');264 $DbResult = $Database->SQLCommand('SELECT * FROM `GroupItem` ORDER BY DBCColumnIndex'); 265 265 while($DbRow = mysql_fetch_assoc($DbResult)) 266 266 {
Note:
See TracChangeset
for help on using the changeset viewer.