| 1 | <?php
|
|---|
| 2 |
|
|---|
| 3 | ini_set('memory_limit', '100M');
|
|---|
| 4 |
|
|---|
| 5 | include_once(dirname(__FILE__).'/../../includes/Global.php');
|
|---|
| 6 | //include_once('../../includes/dbc.php');
|
|---|
| 7 | include_once('Export.php');
|
|---|
| 8 | include_once('Page.php');
|
|---|
| 9 |
|
|---|
| 10 | $System = new Core();
|
|---|
| 11 | $System->DoNotShowPage = true;
|
|---|
| 12 | $System->Run();
|
|---|
| 13 | $PageExport = new PageExport($System);
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 | $Output = '';
|
|---|
| 18 |
|
|---|
| 19 | if (defined('STDIN') == false)
|
|---|
| 20 | {
|
|---|
| 21 | $Output = T('Access denied');
|
|---|
| 22 | exit($Output);
|
|---|
| 23 | }
|
|---|
| 24 |
|
|---|
| 25 | foreach ($_SERVER['argv'] as $parameter)
|
|---|
| 26 | {
|
|---|
| 27 | if (strpos($parameter, '=') !== false)
|
|---|
| 28 | {
|
|---|
| 29 | $index = substr($parameter, 0, strpos($parameter, '='));
|
|---|
| 30 | $parameter = substr($parameter, strpos($parameter, '=') + 1);
|
|---|
| 31 | //echo ($index.' ---- '.$parameter);
|
|---|
| 32 | $_GET[$index] = $parameter;
|
|---|
| 33 | } else $_GET[$parameter] = '';
|
|---|
| 34 | }
|
|---|
| 35 | if (!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)) {
|
|---|
| 36 | $Output .= 'Usage type_export=id_export -for export<br />';
|
|---|
| 37 | $Output .= 'Usage ExportId=id_export - for write export info<br />';
|
|---|
| 38 | $Output .= 'Usage needgeneration=id_export - for write export info<br />';
|
|---|
| 39 |
|
|---|
| 40 | $Output .= 'type_export={lua,dbc,addon} <br />';
|
|---|
| 41 | $Output = str_replace('<br />','
|
|---|
| 42 | ',$Output);
|
|---|
| 43 | }
|
|---|
| 44 | //37
|
|---|
| 45 | if (array_key_exists('lua', $_GET)) {
|
|---|
| 46 | $Export = new Export($System);
|
|---|
| 47 | $Export->Id = $_GET['lua'];
|
|---|
| 48 | $Output .= $Export->Init();
|
|---|
| 49 | $Output .= $Export->ExportToLua();
|
|---|
| 50 | $Output = str_replace('<br/>','
|
|---|
| 51 | ',$Output);
|
|---|
| 52 | $Output = str_replace('<br />','
|
|---|
| 53 | ',$Output);
|
|---|
| 54 | }
|
|---|
| 55 | if (array_key_exists('version', $_GET)) {
|
|---|
| 56 | $Export = new Export($System);
|
|---|
| 57 | $Export->Id = $_GET['version'];
|
|---|
| 58 | $Export->LoadFilters();
|
|---|
| 59 | $Output .= $Export->ClientVersion['Version'];
|
|---|
| 60 | $Output = str_replace('<br/>','
|
|---|
| 61 | ',$Output);
|
|---|
| 62 | $Output = str_replace('<br />','
|
|---|
| 63 | ',$Output);
|
|---|
| 64 | }
|
|---|
| 65 | if (array_key_exists('dbc', $_GET)) {
|
|---|
| 66 | $Export = new Export($System);
|
|---|
| 67 | $Export->Id = $_GET['dbc'];
|
|---|
| 68 | $Output .= $Export->Init();
|
|---|
| 69 | $Output .= $Export->ExportToDbc();
|
|---|
| 70 | $Output = str_replace('<br/>','
|
|---|
| 71 | ',$Output);
|
|---|
| 72 | $Output = str_replace('<br />','
|
|---|
| 73 | ',$Output);
|
|---|
| 74 | }
|
|---|
| 75 | if (array_key_exists('addon', $_GET)) {
|
|---|
| 76 | $Addon = new ExportAddon($System);
|
|---|
| 77 | $Addon->Id = $_GET['addon'];
|
|---|
| 78 | $Output .= $Addon->Init();
|
|---|
| 79 | $Output .= $Output = $Addon->MakeAddon();
|
|---|
| 80 | $Output = str_replace('<br/>','
|
|---|
| 81 | ',$Output);
|
|---|
| 82 | $Output = str_replace('<br />','
|
|---|
| 83 | ',$Output);
|
|---|
| 84 | }
|
|---|
| 85 |
|
|---|
| 86 | if (array_key_exists('needgeneration', $_GET)) {
|
|---|
| 87 | $DbRows = $System->Database->query('SELECT `ClientVersion`.`Version` AS `Version`, '.
|
|---|
| 88 | '`Export`.`Id`,`Export`.`ClientVersion`,`Export`.`OutputType`,`Export`.`Title`,'.
|
|---|
| 89 | '`Export`.`Description` FROM `Export` '.
|
|---|
| 90 | 'JOIN `ClientVersion` AS `ClientVersion` ON `ClientVersion`.`Id`=`Export`.`ClientVersion` '.
|
|---|
| 91 | 'WHERE `Featured`=1 ORDER BY `ClientVersion`.`BuildNumber` DESC');
|
|---|
| 92 | while ($DbExport = $DbRows->fetch_assoc()) {
|
|---|
| 93 | $Export = new Export($System);
|
|---|
| 94 | $Export->Id = $DbExport['Id'];
|
|---|
| 95 | $Output .= $Export->Init();
|
|---|
| 96 | if ($Export->NeedGeneration()) {
|
|---|
| 97 | $DbResult = $System->Database->query('SELECT * FROM `ExportTask` WHERE `Export` = '.$Export->Id);
|
|---|
| 98 | if ($DbResult->num_rows == 0)
|
|---|
| 99 | {
|
|---|
| 100 | $System->Database->query('INSERT INTO `ExportTask` (`Export` ,`TimeStart` ) VALUES ('.$Export->Id.', NOW())');
|
|---|
| 101 | } else
|
|---|
| 102 | $System->Database->query('UPDATE `ExportTask` SET `TimeStart` = NOW(), `Progress` = 0, `TimeFinish` = NULL WHERE `Export` = '.$Export->Id);
|
|---|
| 103 |
|
|---|
| 104 | $System->ModuleManager->Modules['Log']->WriteLog('Zadání úlohy pro vygenerování dbc souboru', LOG_TYPE_DOWNLOAD);
|
|---|
| 105 | $Output .= 'Export '.$Export->Id.' set to generation <br />';
|
|---|
| 106 |
|
|---|
| 107 |
|
|---|
| 108 | } else $Output .= 'Export '.$Export->Id.' do not need generation <br />';
|
|---|
| 109 | $Output = str_replace('<br/>','
|
|---|
| 110 | ',$Output);
|
|---|
| 111 | $Output = str_replace('<br />','
|
|---|
| 112 | ',$Output);
|
|---|
| 113 | }
|
|---|
| 114 | }
|
|---|
| 115 |
|
|---|
| 116 | if (array_key_exists('ExportId', $_GET)) {
|
|---|
| 117 | $Export = new Export($System);
|
|---|
| 118 | $Export->Id = $_GET['ExportId'];
|
|---|
| 119 | $Export->LoadFilters();
|
|---|
| 120 |
|
|---|
| 121 | //generation readme
|
|---|
| 122 | $Output .= '<?xml version="1.0" encoding="utf-8"?\>'.
|
|---|
| 123 | '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'.
|
|---|
| 124 | '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cs">'.
|
|---|
| 125 | '<head>'.
|
|---|
| 126 | '<STYLE type="text/css">'.
|
|---|
| 127 | '.BaseTable {margin: 2px auto 2px auto;border-width: 1px;border-color: black;border-style: solid;border-collapse: collapse;}'.
|
|---|
| 128 |
|
|---|
| 129 | '.BaseTable tr td{ border-width: 1px; border-color: black; border-style: solid; padding: 2px; text-align: center;}'.
|
|---|
| 130 |
|
|---|
| 131 | '.BaseTable tr th{ border-width: 1px; border-color: black; border-style: solid; padding: 2px; background-color: #F0F0F0; text-align: center;}'.
|
|---|
| 132 | '</STYLE>'.
|
|---|
| 133 | '<meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" />'.
|
|---|
| 134 | '<title>Čeština pro WoW</title>'.
|
|---|
| 135 | '</head><body>'.
|
|---|
| 136 | '<h1>České WoW - čestina pro klienta hry World of Warcraft</h1>'.
|
|---|
| 137 |
|
|---|
| 138 | '<table cellspacing="10"><tr><td valign="top">'.
|
|---|
| 139 |
|
|---|
| 140 | '<p>Texty přebírány z projektu <a href="https://wowpreklad.zdechov.net/">wowpreklad.zdechov.net</a><br>'.
|
|---|
| 141 | '<a href="https://wowpreklad.zdechov.net/export/?Action=View&ExportId='.$_GET['ExportId'].'&Tab=0">Export '.$_GET['ExportId'].'</a></p><br>'.
|
|---|
| 142 |
|
|---|
| 143 |
|
|---|
| 144 | '<p><strong>Vlastnosti</strong>'.
|
|---|
| 145 | '<ul>'.
|
|---|
| 146 | '<li>Požadovaná verze klienta: '.$Export->ClientVersion['Version'].'</li>'.
|
|---|
| 147 | '<li>Datum uvolnění: '.date('d.m.Y h:m',time()).'</li>'.
|
|---|
| 148 | '<li>Sestaveno automaticky překladovým systémem <a href="https://wowpreklad.zdechov.net/">WoW překlad</a></li>'.
|
|---|
| 149 | //'<li>Tento soubor se generuje každý den. Pokud se zapojíte do překladu, zítra můžete stáhnout tento soubor znovu včetně svých překladů</li>'.
|
|---|
| 150 | //'<li>Sestavil: Maron</li>'.
|
|---|
| 151 | '</ul>'.
|
|---|
| 152 | '</p>'.
|
|---|
| 153 | '<br>'.
|
|---|
| 154 |
|
|---|
| 155 | '<h2>Nejčastější otázky</h2>'.
|
|---|
| 156 | '<p><strong>Jak mám hru spustit?</strong><br>'.
|
|---|
| 157 | 'Hru musíte spustit přes soubor WowCz.exe v kořenovém adresáři hry.</p>'.
|
|---|
| 158 |
|
|---|
| 159 | '<p><strong>Mohu použít tuto češtinu na oficiálních serverech?</strong><br>'.
|
|---|
| 160 | 'Ne úplně, protože se vystavujete riziku zablokování vašeho účtu z důvodu použití upravené hry. Na oficiálním serveru lze využít pouze Addon s češtinou CzWoW.</p>'.
|
|---|
| 161 |
|
|---|
| 162 | '<p><strong>Mám nainstalovánu češtinu a nejde mi spustit Wow.exe.</strong><br>'.
|
|---|
| 163 | 'Pokud chcete opět spouštět hru přes původní Wow.exe v angličtině, musíte češtinu nejprve odinstalovat ze systému. Především se jedná o soubor Data/enGB/patch-enGB-5.MPQ či Data/enUS/patch-enUS-5.MPQ, který je nutno smazat.</p>'.
|
|---|
| 164 |
|
|---|
| 165 | '<p><strong>Nedaří se mi provést aktualizaci klienta s nainstalovanou češtinou.</strong><br>'.
|
|---|
| 166 | 'Před aktualizací na novější verzi klienta musíte nejprve češtinu odinstalovat. Čeština totiž mění v rámci patch MPQ souboru některé soubory hry, což oficiální instalátory vyhodnotí jako poškození hry.</p>'.
|
|---|
| 167 |
|
|---|
| 168 | '</td><td>';
|
|---|
| 169 |
|
|---|
| 170 | $Output .= $PageExport->ExportViewStat(' WHERE `DBCFileName` !=\'\' OR `LuaFileName` !=\'\' OR `Group`.`Id` = 1 OR `Group`.`Id` = 2 OR `Group`.`Id` = 3 OR `Group`.`Id` = 16');
|
|---|
| 171 |
|
|---|
| 172 | $Output .= '</td></tr></table>'.
|
|---|
| 173 |
|
|---|
| 174 |
|
|---|
| 175 | '</body></html>';
|
|---|
| 176 |
|
|---|
| 177 | }
|
|---|
| 178 | //$_GET['ExportId']
|
|---|
| 179 |
|
|---|
| 180 |
|
|---|
| 181 | echo ($Output);
|
|---|