Changeset 880 for trunk/Modules/Export/ExportOutput.php
- Timestamp:
- Apr 7, 2020, 10:15:48 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Export/ExportOutput.php
r867 r880 10 10 { 11 11 $FileList = scandir($Path); 12 foreach ($FileList as $FileName)13 { 14 if (file_exists($Path.$FileName) and ($FileName != '.') and ($FileName != '..'))12 foreach ($FileList as $FileName) 13 { 14 if (file_exists($Path.$FileName) and ($FileName != '.') and ($FileName != '..')) 15 15 { 16 if (is_dir($Path.$FileName)) CreateZipFromDir($Zip, $Path.$FileName.'/', $ZipPath.$FileName.'/');16 if (is_dir($Path.$FileName)) CreateZipFromDir($Zip, $Path.$FileName.'/', $ZipPath.$FileName.'/'); 17 17 else $Zip->addFile(file_get_contents($Path.$FileName), $ZipPath.$FileName); 18 18 } … … 28 28 $Export->Id = $ExportId; 29 29 $Export->Init(); 30 if (function_exists('gzcompress'))30 if (function_exists('gzcompress')) 31 31 { 32 32 $SaveFilename = $Export->TempDir.'CzAoWoW_SQL.zip'; … … 45 45 '<a href="'.$System->Link('/'.$Export->TempDirRelative.'CzAoWoW_SQL.zip').'">'.$SQLFilename.'</a><br />'. 46 46 'Pokud se vám zdá, že filtr na export nefunguje, vymažte si vyrovnávací paměť prohlížeče a zkuste stáhnout soubor znovu.'; 47 return ($Output);47 return $Output; 48 48 } 49 49 … … 58 58 htmlspecialchars($Export->ExportToAoWoWSQL()). 59 59 '</pre>'; 60 return ($Output );60 return $Output ; 61 61 } 62 62 … … 69 69 $Export->Id = $ExportId; 70 70 $Export->Init(); 71 if (function_exists('gzcompress'))71 if (function_exists('gzcompress')) 72 72 { 73 73 $SaveFilename = $Export->TempDir.'CzWoW_SQL.zip'; … … 86 86 '<a href="'.$System->Link('/'.$Export->TempDirRelative.'CzWoW_SQL.zip').'">'.$SQLFilename.'</a><br />'. 87 87 'Pokud se vám zdá, že filtr na export nefunguje, vymažte si vyrovnávací paměť prohlížeče a zkuste stáhnout soubor znovu.'; 88 return ($Output);88 return $Output; 89 89 } 90 90 … … 99 99 htmlspecialchars($Export->ExportToMangosSQL()). 100 100 '</pre>'; 101 return ($Output);101 return $Output; 102 102 } 103 103 … … 106 106 global $System; 107 107 108 if (function_exists('gzcompress'))108 if (function_exists('gzcompress')) 109 109 { 110 110 $Addon = new ExportAddon($System); … … 135 135 'Pokud se vám zdá, že filtr na export nefunguje, vymažte si vyrovnávací paměť prohlížeče a zkuste stáhnout soubor znovu.'; 136 136 $Output .= '<br /><strong>Použití ve hře</strong><br />Menu addonu ve hře vyvoláte povelem /czwow.'; 137 return ($Output);137 return $Output; 138 138 } 139 139 … … 146 146 $Export->Id = $ExportId; 147 147 $Export->Init(); 148 if (function_exists('gzcompress'))148 if (function_exists('gzcompress')) 149 149 { 150 150 $SaveFilename = $Export->TempDir.'CzWoW_XML.zip'; … … 163 163 '<a href="'.$System->Link('/'.$Export->TempDirRelative.'CzWoW_XML.zip').'">CzWoW_SQL.zip</a><br />'. 164 164 'Pokud se vám zdá, že filtr na export nefunguje, vymažte si vyrovnávací paměť prohlížeče a zkuste stáhnout soubor znovu.'; 165 return ($Output);165 return $Output; 166 166 } 167 167 … … 176 176 htmlspecialchars($Export->ExportToXML()). 177 177 '</pre>'; 178 return ($Output);178 return $Output; 179 179 } 180 180 … … 190 190 $DbResult = $System->Database->query('SELECT `Id` FROM `ExportTask` WHERE (`Export` = '.$ExportId. 191 191 ') AND ((`TimeFinish` < `TimeStart`) OR (`TimeFinish` IS NULL))'); 192 if ($DbResult->num_rows == 0)193 { 194 if (array_key_exists('Regenerate', $_POST))192 if ($DbResult->num_rows == 0) 193 { 194 if (array_key_exists('Regenerate', $_POST)) 195 195 { 196 196 $System->Database->query('UPDATE `ExportTask` SET `TimeQueued` = NOW(), `Progress`=0 , `TimeStart` = NULL, `TimeFinish` = NULL WHERE `Export` = '.$ExportId); … … 211 211 212 212 $DbResult = $System->Database->query('SELECT * FROM `ExportTask` WHERE `Export` = '.$ExportId); 213 if ($DbResult->num_rows == 0)213 if ($DbResult->num_rows == 0) 214 214 { 215 215 $System->Database->query('INSERT INTO `ExportTask` (`Export` ,`TimeQueued` ) VALUES ('.$ExportId.', NOW())'); … … 220 220 $DbResult = $System->Database->query('SELECT `TimeFinish` FROM `ExportTask` WHERE `Export` = '.$ExportId); 221 221 $ExportTask = $DbResult->fetch_assoc(); 222 if ($ExportTask['TimeFinish'] <> '')222 if ($ExportTask['TimeFinish'] <> '') 223 223 { 224 224 $Output .= '<strong>Souhrný balík: <a href="'.$System->Link('/'.$Export->TempDirRelative.'CzWoW_DBC.zip').'">CzWoW_DBC.zip</a></strong><br/>'; 225 225 $DbResult = $System->Database->query('SELECT `Group`.* FROM `ExportGroup` JOIN `Group` ON `Group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$Export->Id.' AND `Group`.`DBCFileName` != ""'); 226 while ($Group = $DbResult->fetch_assoc())226 while ($Group = $DbResult->fetch_assoc()) 227 227 { 228 if (file_exists($Export->TempDir.'dbc/'.$Group['DBCFileName'].'.dbc'))228 if (file_exists($Export->TempDir.'dbc/'.$Group['DBCFileName'].'.dbc')) 229 229 $Output .= '<a href="'.$System->Link('/'.$Export->TempDirRelative.'dbc/'.$Group['DBCFileName'].'.dbc').'">'.$Group['DBCFileName'].'.dbc</a><br/>'; 230 230 } … … 233 233 234 234 } 235 return ($Output);235 return $Output; 236 236 } 237 237 … … 261 261 'WHERE ((`Export`.`OutputType` = 9) OR (`Export`.`OutputType` = 10)) AND '. 262 262 '(`TimeFinish` IS NULL) AND (`TimeQueued` < (NOW() - '.$Timeout.'))'); 263 if ($DbResult->num_rows > 0)263 if ($DbResult->num_rows > 0) 264 264 { 265 265 $System->ModuleManager->Modules['Log']->WriteLog('ProcesTask nepracuje přes 2 hodiny, pravděpodobně nepracuje!', LOG_TYPE_ERROR); 266 266 } 267 return ($Output);267 return $Output; 268 268 } 269 269 … … 281 281 $DbResult = $System->Database->query('SELECT `Id` FROM `ExportTask` WHERE (`Export` = '.$ExportId. 282 282 ') AND ((`TimeFinish` < `TimeStart`) OR (`TimeFinish` IS NULL))'); 283 if ($DbResult->num_rows == 0)284 { 285 if (array_key_exists('Regenerate', $_POST))283 if ($DbResult->num_rows == 0) 284 { 285 if (array_key_exists('Regenerate', $_POST)) 286 286 { 287 287 $System->Database->query('UPDATE `ExportTask` SET `TimeQueued` = NOW(), `Progress`=0, `TimeStart` = NULL, `TimeFinish` = NULL WHERE `Export` = '.$ExportId); … … 298 298 // Start task for the first time if export task was not yet started 299 299 $DbResult = $System->Database->query('SELECT * FROM `ExportTask` WHERE `Export` = '.$ExportId); 300 if ($DbResult->num_rows == 0)300 if ($DbResult->num_rows == 0) 301 301 { 302 302 $System->Database->query('INSERT INTO ExportTask (`Export` ,`TimeStart` ) VALUES ('.$ExportId.', NOW())'); … … 306 306 $DbResult = $System->Database->query('SELECT `TimeFinish` FROM `ExportTask` WHERE `Export` = '.$ExportId); 307 307 $ExportTask = $DbResult->fetch_assoc(); 308 if ($ExportTask['TimeFinish'] <> '')308 if ($ExportTask['TimeFinish'] <> '') 309 309 { 310 310 $FileName = 'Instalace_CzechWoW_'.$Export->ClientVersion['Version'].'.exe'; … … 313 313 $Output .= ShowProgress($Export); 314 314 } 315 return ($Output);315 return $Output; 316 316 } 317 317 … … 324 324 $Export->Init(); 325 325 326 if (function_exists('gzcompress'))326 if (function_exists('gzcompress')) 327 327 { 328 328 $Output = 'Generování lua souborů...<br />'; … … 342 342 'Souhrný archív <a href="'.$System->Link('/'.$Export->TempDirRelative.'CzWoW_Lua.zip').'">CzWoW_Lua.zip</a><br />'; 343 343 $DbResult = $System->Database->query('SELECT `Group`.* FROM `ExportGroup` JOIN `Group` ON `Group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$Export->Id.' AND `Group`.`LuaFileName` != ""'); 344 while ($Group = $DbResult->fetch_assoc())344 while ($Group = $DbResult->fetch_assoc()) 345 345 { 346 346 $Output .= '<a href="'.$System->Link('/'.$Export->TempDirRelative.'lua/'.$Group['LuaFileName'].'.lua').'">'.$Group['LuaFileName'].'.lua</a><br/>'; 347 347 } 348 348 $Output .= '<br /><br /><strong>Použití ve hře</strong><br />Ze souborů vytvořte MPQ archív a nahrajte ho do hry do podsložky jako Data/enUS/patch-enUS-5.MPQ nebo Data/enUS/patch-enGB-5.MPQ. Pro starší verze hry než 3.2.0 je nutné spouštět hru pomocí programu WoWMe.exe (WoW Model Editor Fix).'; 349 return ($Output);349 return $Output; 350 350 } 351 351 352 352 function ExportOutput($ExportId, $Type) 353 353 { 354 if ($Type == 1) $Output = OutputMangosSQLToHTML($ExportId);355 else if ($Type == 2) $Output = OutputMangosSQLToFile($ExportId);356 else if ($Type == 3) $Output = OutputAoWoWToHTML($ExportId);357 else if ($Type == 4) $Output = OutputAoWoWToFile($ExportId);358 else if ($Type == 5) $Output = OutputXMLToHTML($ExportId);359 else if ($Type == 6) $Output = OutputXMLToFile($ExportId);360 else if ($Type == 7) $Output = OutputAddon($ExportId);361 else if ($Type == 8) $Output = OutputLua($ExportId);362 else if ($Type == 9) $Output = OutputDBCToFile($ExportId);363 else if ($Type == 10) $Output = OutputEXEToFile($ExportId);354 if ($Type == 1) $Output = OutputMangosSQLToHTML($ExportId); 355 else if ($Type == 2) $Output = OutputMangosSQLToFile($ExportId); 356 else if ($Type == 3) $Output = OutputAoWoWToHTML($ExportId); 357 else if ($Type == 4) $Output = OutputAoWoWToFile($ExportId); 358 else if ($Type == 5) $Output = OutputXMLToHTML($ExportId); 359 else if ($Type == 6) $Output = OutputXMLToFile($ExportId); 360 else if ($Type == 7) $Output = OutputAddon($ExportId); 361 else if ($Type == 8) $Output = OutputLua($ExportId); 362 else if ($Type == 9) $Output = OutputDBCToFile($ExportId); 363 else if ($Type == 10) $Output = OutputEXEToFile($ExportId); 364 364 else $Output = ShowMessage('Nebyl vybrán žádný formát výstupu.', MESSAGE_CRITICAL); 365 return ($Output);366 } 365 return $Output; 366 }
Note:
See TracChangeset
for help on using the changeset viewer.