1 | <?php
|
---|
2 |
|
---|
3 | session_start();
|
---|
4 |
|
---|
5 | // příkaz:
|
---|
6 |
|
---|
7 | //php index.php "action=result" 'ExportSetting=a:10:{s:11:"users-order";s:838:",459,1,2,499,304,462,407,379,58,400,392,119,281,590,277,159,192,588,503,586,131,195,288,208,537,426,337,146,30,122,598,399,596,28,8,319,174,33,165,188,269,18,84,331,578,591,147,579,592,289,303,567,243,502,144,285,161,568,351,163,547,262,256,141,536,301,318,214,486,172,154,466,446,335,127,563,76,293,173,325,580,290,153,543,23,196,509,552,237,389,317,177,52,594,416,539,473,573,17,5,139,452,148,362,210,346,35,553,71,68,394,143,369,515,448,140,445,32,171,211,347,226,152,403,245,217,27,7,268,549,86,81,348,370,476,132,562,307,575,583,291,555,548,16,474,182,556,535,320,252,359,264,338,533,405,577,250,221,582,197,230,72,242,213,409,472,186,554,523,492,378,413,512,581,352,518,485,602,601,604,603,606,607,595,609,617,614,618,616,613,622,624,638,641,643,626,627,648,639,652,642,650,26,156,640,633,635,653,637,654,636,284,531,585,629,651,647";s:15:"users-selection";a:44:{i:0;s:3:"459";i:1;s:1:"1";i:2;s:1:"2";i:3;s:3:"499";i:4;s:3:"304";i:5;s:3:"462";i:6;s:3:"407";i:7;s:3:"379";i:8;s:3:"400";i:9;s:3:"281";i:10;s:3:"277";i:11;s:3:"159";i:12;s:3:"588";i:13;s:3:"503";i:14;s:3:"586";i:15;s:3:"131";i:16;s:3:"195";i:17;s:3:"288";i:18;s:3:"208";i:19;s:3:"537";i:20;s:3:"426";i:21;s:3:"337";i:22;s:3:"122";i:23;s:3:"319";i:24;s:3:"174";i:25;s:3:"165";i:26;s:3:"188";i:27;s:3:"269";i:28;s:2:"18";i:29;s:3:"331";i:30;s:3:"578";i:31;s:3:"579";i:32;s:3:"592";i:33;s:3:"567";i:34;s:3:"568";i:35;s:3:"446";i:36;s:3:"580";i:37;s:3:"362";i:38;s:3:"549";i:39;s:3:"562";i:40;s:3:"556";i:41;s:3:"618";i:42;s:3:"613";i:43;s:3:"622";}s:6:"groups";a:18:{i:0;s:1:"1";i:1;s:1:"2";i:2;s:1:"3";i:3;s:1:"4";i:4;s:1:"5";i:5;s:1:"6";i:6;s:1:"7";i:7;s:1:"8";i:8;s:2:"10";i:9;s:2:"11";i:10;s:2:"12";i:11;s:2:"13";i:12;s:2:"14";i:13;s:2:"15";i:14;s:2:"16";i:15;s:2:"17";i:16;s:2:"18";i:17;s:2:"19";}s:10:"Diacritics";b:1;s:11:"language-cz";b:1;s:11:"language-sk";b:1;s:14:"language-other";b:0;s:6:"Export";s:11:"AoWoWImport";s:9:"language1";b:0;s:9:"language2";b:0;}'
|
---|
8 |
|
---|
9 | // Load commandline parameters
|
---|
10 | if(!array_key_exists('REMOTE_ADDR', $_SERVER))
|
---|
11 | {
|
---|
12 | foreach($_SERVER['argv'] as $parameter)
|
---|
13 | {
|
---|
14 | if(strpos($parameter, '=') !== false)
|
---|
15 | {
|
---|
16 | $index = substr($parameter,0,strpos($parameter, '='));
|
---|
17 | $parameter = substr($parameter,strpos($parameter, '=')+1);
|
---|
18 | //echo ($index.' ---- '.$parameter);
|
---|
19 | $_GET[$index] = $parameter;
|
---|
20 | }
|
---|
21 | }
|
---|
22 | }
|
---|
23 |
|
---|
24 | if(!array_key_exists('ExportSetting', $_SESSION))
|
---|
25 | if(array_key_exists('ExportSetting', $_COOKIE))
|
---|
26 | $_SESSION['ExportSetting'] = $_COOKIE['ExportSetting'];
|
---|
27 | else $_SESSION['ExportSetting'] = '';
|
---|
28 |
|
---|
29 | setcookie('ExportSetting', $_SESSION['ExportSetting'], time() + 60 * 60 * 24 * 100);
|
---|
30 | include('../includes/global.php');
|
---|
31 | include('../includes/zip.lib.php');
|
---|
32 | include('export.php');
|
---|
33 | include('create_addon.php');
|
---|
34 | include('../includes/dbc.php');
|
---|
35 |
|
---|
36 | ShowPage();
|
---|
37 |
|
---|
38 | function CheckBox($Name, $Checked = false, $Id = '', $Class = '')
|
---|
39 | {
|
---|
40 | if($Id) $Id = ' id="'.$Id.'"'; else $Id = '';
|
---|
41 | if($Class) $Class = ' class="'.$Class.'"'; else $Class = '';
|
---|
42 | if($Checked) $Checked = ' checked="checked"'; else $Checked = '';
|
---|
43 | return('<input type="checkbox" value="checked" name="'.$Name.'"'.$Checked.$Id.$Class.' />');
|
---|
44 | }
|
---|
45 |
|
---|
46 | function RadioButton($Name, $Value, $Checked = false, $onclick = '')
|
---|
47 | {
|
---|
48 | if($Checked) $Checked = ' checked="checked"'; else $Checked = '';
|
---|
49 | return('<input onclick="'.$onclick.'" type="radio" name="'.$Name.'" value="'.$Value.'"'.$Checked.' />');
|
---|
50 | }
|
---|
51 |
|
---|
52 | function SelectOption($Name, $Text, $Selected = false)
|
---|
53 | {
|
---|
54 | if($Selected) $Selected = ' selected="selected"'; else $Selected = '';
|
---|
55 | return('<option value="'.$Name.'"'.$Selected.'>'.$Text.'</option>');
|
---|
56 | }
|
---|
57 |
|
---|
58 | function GetVersions($out)
|
---|
59 | {
|
---|
60 | global $Database,$TranslationTree,$Config;
|
---|
61 | $result = 'null';
|
---|
62 | if ($out == 'VerseCZ') $out = 'Addon';
|
---|
63 | if (($out == 'XMLCompressed') or ($out == 'XMLDirect')) $out = 'sources';
|
---|
64 | if (($out == 'MangosSQLCompressed') or ($out == 'MangosSQLDirect') or ($out == 'AoWoWSQLCompressed') or ($out == 'AoWoWSQLDirect') or ($out == 'AoWoWImport')) $out = 'sql';
|
---|
65 | switch($out)
|
---|
66 | {
|
---|
67 | case 'Addon':
|
---|
68 | $Addon_verses = scandir('files', 1);
|
---|
69 | unset($Addon_verses[count($Addon_verses) - 1]);
|
---|
70 | unset($Addon_verses[count($Addon_verses) - 1]);
|
---|
71 | unset($Addon_verses[count($Addon_verses) - 1]);
|
---|
72 | $result = '[';
|
---|
73 | foreach($Addon_verses as $version) {
|
---|
74 | $result .= "'".$version."',";
|
---|
75 | }
|
---|
76 | $result = substr($result,0,strlen($result)-1);
|
---|
77 | $result .= "]";
|
---|
78 | break;
|
---|
79 | case 'sources':
|
---|
80 | $dirs = scandir('../source', 1);
|
---|
81 | unset($dirs[count($dirs) - 1]);
|
---|
82 | unset($dirs[count($dirs) - 1]);
|
---|
83 | unset($dirs[count($dirs) - 1]);
|
---|
84 | $result = '[';
|
---|
85 | foreach($dirs as $dir) {
|
---|
86 | $result .= "'".$dir."',";
|
---|
87 | }
|
---|
88 | $result = substr($result,0,strlen($result)-1);
|
---|
89 | $result .= "]";
|
---|
90 | break;
|
---|
91 | case 'sql':
|
---|
92 | $dirs = scandir('../source', 1);
|
---|
93 | unset($dirs[count($dirs) - 1]);
|
---|
94 | unset($dirs[count($dirs) - 1]);
|
---|
95 | unset($dirs[count($dirs) - 1]);
|
---|
96 | $result = '[';
|
---|
97 | foreach($dirs as $dir) {
|
---|
98 | if ($TranslationTree[1]['LastVersion'] >= GetBuildNumber($dir))
|
---|
99 | $result .= "'".$dir."',";
|
---|
100 | }
|
---|
101 | if ($result <> '[') $result = substr($result,0,strlen($result)-1);
|
---|
102 | $result .= "]";
|
---|
103 | break;
|
---|
104 | case 'DBC':
|
---|
105 | $sql = 'SELECT Version FROM wow_client_version WHERE DBCColumns_GameTips <> "" AND DBCColumns_Spell <> "" ORDER BY BuildNumber DESC';
|
---|
106 | $ID = $Database->SQLCommand($sql);
|
---|
107 | $result = '[';
|
---|
108 | while($Line = mysql_fetch_assoc($ID))
|
---|
109 | {
|
---|
110 | $result .= "'".$Line['Version']."',";
|
---|
111 | }
|
---|
112 | $result = substr($result,0,strlen($result)-1);
|
---|
113 | $result .= "]";
|
---|
114 | break;
|
---|
115 | case 'Lua':
|
---|
116 | $dirs = scandir('../source', 1);
|
---|
117 | $result = '[';
|
---|
118 | foreach($dirs as $dir) {
|
---|
119 | $ok = true;
|
---|
120 | foreach($TranslationTree as $Group)
|
---|
121 | {
|
---|
122 | if(($Group['LuaFileName'] != '') and ($Group['TablePrefix'] != ''))
|
---|
123 | {
|
---|
124 | if ((file_exists('../source/'.$dir.'/lua/'.$Group['LuaFileName'].'.lua') == false))
|
---|
125 | $ok = false;
|
---|
126 | }
|
---|
127 | }
|
---|
128 | if ($ok) $result .= "'".$dir."',";
|
---|
129 | }
|
---|
130 | $result = substr($result,0,strlen($result)-1);
|
---|
131 | $result .= "]";
|
---|
132 | break;
|
---|
133 | }
|
---|
134 | return($result);
|
---|
135 | }
|
---|
136 |
|
---|
137 | function WriteOption($str,$Selected)
|
---|
138 | {
|
---|
139 | if ($str <> 'null')
|
---|
140 | {
|
---|
141 | $str = substr($str, 2, strlen($str) - 4);
|
---|
142 | $versions = explode("','", $str);
|
---|
143 | foreach($versions as $version)
|
---|
144 | {
|
---|
145 | echo('<option value="'.$version.'"');
|
---|
146 | if($Selected == $version) echo(' selected="selected"');
|
---|
147 | echo('>'.$version.'</option>');
|
---|
148 | }
|
---|
149 | }
|
---|
150 | }
|
---|
151 |
|
---|
152 | function WriteSetting($ExportSetting)
|
---|
153 | {
|
---|
154 | echo('<textarea rows="10" cols="100">'.serialize($ExportSetting).'</textarea><br />'.
|
---|
155 | 'Odkaz ke stažení s vlastním nastavením: '.
|
---|
156 | '<a href="?action=output&ExportSetting='.htmlspecialchars(serialize($ExportSetting)).'">Odkaz vlastního exportu</a><br />'.
|
---|
157 | 'I když se nastavení ukládá, pro jistotu si jej můžete uložit nebo poslat příteli.');
|
---|
158 | }
|
---|
159 |
|
---|
160 | if(array_key_exists('ExportSetting', $_GET))
|
---|
161 | {
|
---|
162 | $ExportSetting = unserialize(stripcslashes(stripcslashes($_GET['ExportSetting'])));
|
---|
163 | } else
|
---|
164 | {
|
---|
165 | if(array_key_exists('UserID', $_SESSION) and ($_SESSION['UserID'] != ''))
|
---|
166 | {
|
---|
167 | $DbResult = $Database->SQLCommand('SELECT ExportSetting FROM user WHERE ID='.$_SESSION['UserID']);
|
---|
168 | $DbRow = mysql_fetch_assoc($DbResult);
|
---|
169 | $ExportSetting = unserialize($DbRow['ExportSetting']);
|
---|
170 |
|
---|
171 | //print_r($_POST);
|
---|
172 | } else $ExportSetting = unserialize($_SESSION['ExportSetting']);
|
---|
173 | }
|
---|
174 | if(!isset($ExportSetting['users-selection'])) $ExportSetting['users-selection'] = array();
|
---|
175 | if(!isset($ExportSetting['Diacritics'])) $ExportSetting['Diacritics'] = 1;
|
---|
176 | foreach($LanguageList as $Language)
|
---|
177 | if($Language['Enabled'] == 1)
|
---|
178 | if(!isset($ExportSetting['language'.$Language['Id']])) $ExportSetting['language'.$Language['Id']] = 1;
|
---|
179 | if(!isset($ExportSetting['users-order'])) $ExportSetting['users-order'] = '';
|
---|
180 | if(!isset($ExportSetting['Export'])) $ExportSetting['Export'] = 'Addon';
|
---|
181 | if(!isset($ExportSetting['Version'])) $ExportSetting['Version'] = $Config['Web']['GameVersion'];
|
---|
182 | if(!isset($ExportSetting['groups'])) $ExportSetting['groups'] = array();
|
---|
183 |
|
---|
184 | function CreateZipFromDir(&$Zip, $Path, $ZipPath)
|
---|
185 | {
|
---|
186 | //echo($Path.'<br />');
|
---|
187 | $FileList = scandir($Path);
|
---|
188 | foreach($FileList as $FileName)
|
---|
189 | {
|
---|
190 | if(file_exists($Path.$FileName) and ($FileName != '.') and ($FileName != '..'))
|
---|
191 | {
|
---|
192 | //echo($Path.$FileName.'<br />');
|
---|
193 | if(is_dir($Path.$FileName)) CreateZipFromDir($Zip, $Path.$FileName.'/', $ZipPath.$FileName.'/');
|
---|
194 | else $Zip->addFile(file_get_contents($Path.$FileName), $ZipPath.$FileName);
|
---|
195 | }
|
---|
196 | }
|
---|
197 | }
|
---|
198 |
|
---|
199 | if(!array_key_exists('action', $_GET)) $_GET['action'] = '';
|
---|
200 | switch($_GET['action'])
|
---|
201 | {
|
---|
202 | case 'result':
|
---|
203 | if (array_key_exists('Version',$_POST)) $ExportSetting['Version'] = $_POST['Version'];
|
---|
204 | if (array_key_exists('Export',$_POST)) $ExportSetting['Export'] = $_POST['Export'];
|
---|
205 | switch($ExportSetting['Export'])
|
---|
206 | {
|
---|
207 | case 'MangosSQLCompressed':
|
---|
208 | if(function_exists('gzcompress'))
|
---|
209 | {
|
---|
210 | $TempDir = $Config['Web']['TempFolder'].$_SESSION['User'].'/';
|
---|
211 | if(!file_exists($TempDir)) mkdir($TempDir, 0777, true);
|
---|
212 | $SaveFilename = $TempDir.'CzWoW_SQL.zip';
|
---|
213 | $SQLFilename = 'CzWoW_SQL.sql';
|
---|
214 | $BufferZip = ExportToMangosSQL($ExportSetting);
|
---|
215 | $ZipFile = new zipfile();
|
---|
216 | $ZipFile->addFile($BufferZip, $SQLFilename);
|
---|
217 | $Buffer = $ZipFile->file();
|
---|
218 | file_put_contents($SaveFilename, $Buffer);
|
---|
219 | } else echo('Funkce pro tvorbu Zip souboru není podporována!');
|
---|
220 | echo('<script type="text/javascript" language="JavaScript" charset="utf-8">'.
|
---|
221 | 'setTimeout("parent.location.href=\''.$SaveFilename.'\'", 3000)'.
|
---|
222 | '</script>');
|
---|
223 |
|
---|
224 | echo('Pokud nezačalo stahování, soubor by mělo jít stáhnout pomocí tohoto odkazu: '.
|
---|
225 | '<a href="'.$SaveFilename.'">'.$SQLFilename.'</a><br />'.
|
---|
226 | '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.');
|
---|
227 | break;
|
---|
228 | case 'MangosSQLDirect':
|
---|
229 | echo('Vygenerovaný SQL kód: <br /><pre class="SQLCode">');
|
---|
230 | echo(htmlspecialchars(ExportToMangosSQL($ExportSetting)));
|
---|
231 | echo('</pre>');
|
---|
232 | break;
|
---|
233 | case 'AoWoWSQLCompressed':
|
---|
234 | if(function_exists('gzcompress'))
|
---|
235 | {
|
---|
236 | $TempDir = $Config['Web']['TempFolder'].$_SESSION['User'].'/';
|
---|
237 | if(!file_exists($TempDir)) mkdir($TempDir, 0777, true);
|
---|
238 | $SaveFilename = $TempDir.'CzAoWoW_SQL.zip';
|
---|
239 | $SQLFilename = 'CzAoWoW_SQL.sql';
|
---|
240 | $BufferZip = ExportToAoWoWSQL($ExportSetting);
|
---|
241 | $ZipFile = new zipfile();
|
---|
242 | $ZipFile->addFile($BufferZip, $SQLFilename);
|
---|
243 | $Buffer = $ZipFile->file();
|
---|
244 | file_put_contents($SaveFilename, $Buffer);
|
---|
245 | } else echo('Funkce pro tvorbu Zip souboru není podporována!');
|
---|
246 | echo('<script type="text/javascript" language="JavaScript" charset="utf-8">'.
|
---|
247 | 'setTimeout("parent.location.href=\''.$SaveFilename.'\'", 3000)'.
|
---|
248 | '</script>');
|
---|
249 |
|
---|
250 | echo('Pokud nezačalo stahování, soubor by mělo jít stáhnout pomocí tohoto odkazu: '.
|
---|
251 | '<a href="'.$SaveFilename.'">'.$SQLFilename.'</a><br />'.
|
---|
252 | '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.');
|
---|
253 | break;
|
---|
254 | case 'AoWoWSQLDirect':
|
---|
255 | echo('Vygenerovaný SQL kód: <br /><pre class="SQLCode">');
|
---|
256 | echo(htmlspecialchars(ExportToAoWoWSQL($ExportSetting)));
|
---|
257 | echo('</pre>');
|
---|
258 | break;
|
---|
259 | case 'AoWoWImport':
|
---|
260 | require_once('../aowow/configs/config.php');
|
---|
261 | echo('<div style="font-size: xx-small;">');
|
---|
262 | echo('Gewneruji SQL kód ');
|
---|
263 | $AoWoWSQL = ExportToAoWoWSQL($ExportSetting);
|
---|
264 | echo('<strong>Hotovo</strong><br />');
|
---|
265 |
|
---|
266 | $Database->SelectDatabase($AoWoWconf['mangos']['db']);
|
---|
267 | $Database->SQLCommand('SET NAMES '.$Config['Database']['Charset']);
|
---|
268 |
|
---|
269 | echo('Aktualizuji aktuality ');
|
---|
270 | $Database->SQLCommand("UPDATE `aowow_news` SET `text_loc0` = 'Poslední aktualizace dat ".Date ("d. n. Y, H:i:s")." ', `text_loc8` = 'Poslední aktualizace dat ".Date ("d. n. Y, H:i:s")." ' WHERE `aowow_news`.`id` =3");
|
---|
271 | echo('<strong>Hotovo</strong><br />');
|
---|
272 |
|
---|
273 | echo('Mažu dočasné soubory ');
|
---|
274 | $files = scandir('../aowow/cache/mangos');
|
---|
275 | foreach($files as $file)
|
---|
276 | {
|
---|
277 | $end = substr($file, strlen($file) - 3);
|
---|
278 | if($end == 'aww') unlink('../aowow/cache/mangos/'.$file);
|
---|
279 | }
|
---|
280 | $files = scandir('../aowow/cache/templates/wowhead');
|
---|
281 | foreach($files as $file)
|
---|
282 | {
|
---|
283 | $end = substr($file, strlen($file) - 3);
|
---|
284 | if ($end == 'php') unlink('../aowow/cache/templates/wowhead/'.$file);
|
---|
285 | }
|
---|
286 | echo ('<strong>Hotovo</strong><br />');
|
---|
287 |
|
---|
288 | echo('Importuji do AoWoW ');
|
---|
289 | $BufferArray = explode(";\n", $AoWoWSQL);
|
---|
290 | foreach($BufferArray as $Line)
|
---|
291 | {
|
---|
292 | if($Line <> '') $Database->SQLCommand($Line);
|
---|
293 | echo('. ');
|
---|
294 | }
|
---|
295 | echo('<strong>Hotovo</strong><br />');
|
---|
296 |
|
---|
297 | // TODO aowow_itemenchantmet, aowow_char_titles, aowow_factions, aowow_itemset, aowow_spelldispeltype, aowow_spellmechanic, aowow_spellrange, aowow_zones
|
---|
298 |
|
---|
299 | $Database->SelectDatabase($Config['Database']['Database']);
|
---|
300 | $Database->SQLCommand('SET NAMES '.$Config['Database']['Charset']);
|
---|
301 | echo('</div>');
|
---|
302 | WriteLog('Plnění AoWoW databáze překladem', 4);
|
---|
303 | break;
|
---|
304 | case 'XMLCompressed':
|
---|
305 | if(function_exists('gzcompress'))
|
---|
306 | {
|
---|
307 | $TempDir = $Config['Web']['TempFolder'].$_SESSION['User'].'/';
|
---|
308 | if(!file_exists($TempDir)) mkdir($TempDir, 0777, true);
|
---|
309 | $SaveFilename = $TempDir.'CzWoW_XML.zip';
|
---|
310 | $SQLFilename = 'CzWoW_XML.sql';
|
---|
311 | $BufferZip = ExportToXML($ExportSetting);
|
---|
312 | $ZipFile = new zipfile();
|
---|
313 | $ZipFile->addFile($BufferZip, $SQLFilename);
|
---|
314 | $Buffer = $ZipFile->file();
|
---|
315 | file_put_contents($SaveFilename, $Buffer);
|
---|
316 | } else echo('Funkce pro tvorbu Zip souboru není podporována!');
|
---|
317 | echo('<script type="text/javascript" language="JavaScript" charset="utf-8">'.
|
---|
318 | 'setTimeout("parent.location.href=\''.$SaveFilename.'\'", 3000)'.
|
---|
319 | '</script>');
|
---|
320 |
|
---|
321 | echo('Pokud nezačalo stahování, soubor by mělo jít stáhnout pomocí tohoto odkazu: '.
|
---|
322 | '<a href="'.$SaveFilename.'">CzWoW_SQL.zip</a><br />'.
|
---|
323 | '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.');
|
---|
324 | break;
|
---|
325 | case 'XMLDirect':
|
---|
326 | echo('Vygenerované XML: <br /><pre class="SQLCode">');
|
---|
327 | echo(htmlspecialchars(ExportToXML($ExportSetting)));
|
---|
328 | echo('</pre>');
|
---|
329 | break;
|
---|
330 | /*case 'Server':
|
---|
331 | if(Licence(LICENCE_ADMIN))
|
---|
332 | {
|
---|
333 | $Buffer = ExportToMangosSQL($ExportSetting);
|
---|
334 | $Database->SelectDatabase($Config['Database']['DatabaseMangos']);
|
---|
335 | $BufferArray = explode("\n", $Buffer);
|
---|
336 | echo('Přenášení dat do serveru...<br />');
|
---|
337 | foreach($BufferArray as $Line)
|
---|
338 | {
|
---|
339 | $Database->SQLCommand($Line);
|
---|
340 | echo('.');
|
---|
341 | }
|
---|
342 | echo("<br />Hotovo<br />");
|
---|
343 | } else echo('Nemáte oprávnění.');
|
---|
344 | break;*/
|
---|
345 | case 'Addon':
|
---|
346 | if(function_exists('gzcompress')) {
|
---|
347 | $TempDir = $Config['Web']['TempFolder'].$_SESSION['User'].'/CzWoW-'.$ExportSetting['Version'].'/';
|
---|
348 | echo('Generování addonu...'.$ExportSetting['Export'].'<br />');
|
---|
349 | MakeAddon($ExportSetting);
|
---|
350 | $SaveFilename = $Config['Web']['TempFolder'].$_SESSION['User'].'/CzWoW_Addon-'.$ExportSetting['Version'].'.zip';
|
---|
351 | $Zip = new zipfile();
|
---|
352 | CreateZipFromDir($Zip, $TempDir, 'CzWoW/');
|
---|
353 | $Zip->addFile(file_get_contents('files/'.$ExportSetting['Version'].'/CzWoW/OptionsFrame.xml'), 'CzWoW/OptionsFrame.xml');
|
---|
354 | $Zip->addFile(file_get_contents('files/'.$ExportSetting['Version'].'/CzWoW/CzWoW.xml'), 'CzWoW/CzWoW.xml');
|
---|
355 | $Zip->addFile(file_get_contents('files/'.$ExportSetting['Version'].'/CzWoW/CzWoW.toc'), 'CzWoW/CzWoW.toc');
|
---|
356 | $Zip->addFile(file_get_contents('files/'.$ExportSetting['Version'].'/CzWoW/CzWoW.lua'), 'CzWoW/CzWoW.lua');
|
---|
357 | $Zip->addFile(file_get_contents('files/'.$ExportSetting['Version'].'/CzWoW/GameMenuFrame.xml'), 'CzWoW/GameMenuFrame.xml');
|
---|
358 | $Zip->addFile(file_get_contents('files/'.$ExportSetting['Version'].'/CzWoW/Localization.lua'), 'CzWoW/Localization.lua');
|
---|
359 | $Buffer = $Zip->file();
|
---|
360 | file_put_contents($SaveFilename, $Buffer);
|
---|
361 | echo('Hotovo<br /><br />');
|
---|
362 | } else echo('Funkce pro tvorbu Zip souboru není podporována!');
|
---|
363 | echo('<script type="text/javascript" language="JavaScript" charset="utf-8">'.
|
---|
364 | 'setTimeout("parent.location.href=\''.$SaveFilename.'\'", 3000)'.
|
---|
365 | '</script>');
|
---|
366 |
|
---|
367 | echo('Pokud nezačalo stahování, soubor by mělo jít stáhnout pomocí tohoto odkazu: '.
|
---|
368 | '<a href="'.$SaveFilename.'">CzWoW_Addon-'.$ExportSetting['Version'].'.zip</a><br />'.
|
---|
369 | '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.');
|
---|
370 | echo('<br /><strong>Použití ve hře</strong><br />Menu addonu ve hře vyvoláte povelem /czwow.');
|
---|
371 | break;
|
---|
372 | case 'VerseCZ':
|
---|
373 | if(function_exists('gzcompress'))
|
---|
374 | {
|
---|
375 | $Line = mysql_fetch_assoc($Database->SQLCommand('SELECT verse FROM verseclient ORDER BY DATE DESC LIMIT 1'));
|
---|
376 | $TempDir = $Config['Web']['TempFolder'].'Addon/CzWoW/';
|
---|
377 | echo('Generování addonu...<br />');
|
---|
378 | MakeAddon($ExportSetting);
|
---|
379 | MakeReadme($ExportSetting);
|
---|
380 |
|
---|
381 | $SaveFilename = $Config['Web']['TempFolder'].'Addon/CzWoW_'.$Line['verse'].'.zip';
|
---|
382 | $Zip = new zipfile();
|
---|
383 | CreateZipFromDir($Zip, $TempDir, 'Interface/AddOns/CzWoW/');
|
---|
384 | //addon
|
---|
385 | $Zip->addFile(file_get_contents('files/'.$ExportSetting['Version'].'/CzWoW/OptionsFrame.xml'), 'Interface/AddOns/CzWoW/OptionsFrame.xml');
|
---|
386 | $Zip->addFile(file_get_contents('files/'.$ExportSetting['Version'].'/CzWoW/CzWoW.xml'), 'Interface/AddOns/CzWoW/CzWoW.xml');
|
---|
387 | $Zip->addFile(file_get_contents('files/'.$ExportSetting['Version'].'/CzWoW/CzWoW.toc'), 'Interface/AddOns/CzWoW/CzWoW.toc');
|
---|
388 | $Zip->addFile(file_get_contents('files/'.$ExportSetting['Version'].'/CzWoW/CzWoW.lua'), 'Interface/AddOns/CzWoW/CzWoW.lua');
|
---|
389 | $Zip->addFile(file_get_contents('files/'.$ExportSetting['Version'].'/CzWoW/GameMenuFrame.xml'), 'Interface/AddOns/CzWoW/GameMenuFrame.xml');
|
---|
390 | $Zip->addFile(file_get_contents('files/'.$ExportSetting['Version'].'/CzWoW/Localization.lua'), 'Interface/AddOns/CzWoW/Localization.lua');
|
---|
391 | //fonty
|
---|
392 | $Zip->addFile(file_get_contents('files/'.$ExportSetting['Version'].'/Fonts/FRIZQT__.ttf'), 'Fonts/FRIZQT__.ttf');
|
---|
393 | $Zip->addFile(file_get_contents('files/'.$ExportSetting['Version'].'/Fonts/MORPHEUS.ttf'), 'Fonts/MORPHEUS.ttf');
|
---|
394 | $Zip->addFile(file_get_contents('files/'.$ExportSetting['Version'].'/Fonts/SKURRI.ttf'), 'Fonts/SKURRI.ttf');
|
---|
395 | //readme
|
---|
396 | $Zip->addFile(file_get_contents($Config['Web']['TempFolder'].'Addon/CzWoW/CZWOW-Readme.txt'), 'CZWOW-Readme.txt');
|
---|
397 |
|
---|
398 | $Buffer = $Zip->file();
|
---|
399 | file_put_contents($SaveFilename, $Buffer);
|
---|
400 | WriteLog('Vytvořena verze češtiny pro clienta '.$Line['verse'], 4);
|
---|
401 |
|
---|
402 | echo('Hotovo<br /><br />');
|
---|
403 | } else echo('Funkce pro tvorbu Zip souboru není podporována!');
|
---|
404 |
|
---|
405 | echo('Odkaz ke stažení: '.
|
---|
406 | '<a href="'.$SaveFilename.'">'.$SaveFilename.'</a><br />');
|
---|
407 | break;
|
---|
408 | case 'DBC':
|
---|
409 |
|
---|
410 | echo('<br /><br /><br />U dbc souborů export textů funguje jinak, protože generování je náročné na výpočet provádí se přes noc kdy je server nejmíň vytížen. Nyní jste zadali úlohu, která se provede v noci. Zítra si můžete stáhnout vygenerovaný soubor v sekci <a href="../download.php">Stahování</a>.<br /><br />Dbc soubory je nutné zabalit do souboru patch-enGB-5.MPQ uvnitř složky "DBFilesClient" a hru spouštět přes wowme.exe. Zabalit to můžete pomocí programu <a href="../download/mpqediten32.zip">Ladik\'s MPQ Editor</a>. Stav vygenerování můžete sledovat na stránce <a href="../download.php">Stahování</a>, kde si také můžete zítra stáhnout soubor.<br /><br />');
|
---|
411 |
|
---|
412 | //TODO: pouze jedna aktivní úloha na uživatele
|
---|
413 | $sql = 'SELECT * FROM tasks WHERE Active = 1 AND User = '.$_SESSION['UserID'];
|
---|
414 | $ID = $Database->SQLCommand($sql);
|
---|
415 | if (mysql_num_rows($ID) > 0)
|
---|
416 | {
|
---|
417 | echo ('Nemůžete zadat stejný požadavek dvakrát za den. Bylo pouze aktualizováno nastavení exportu!');
|
---|
418 | $Database->SQLCommand('UPDATE `wowpreklad`.`tasks` SET `ExportSetting` = "'.addslashes(serialize($ExportSetting)).'" WHERE Active = 1 AND User = '.$_SESSION['UserID']);
|
---|
419 | } else {
|
---|
420 | $Database->SQLCommand('INSERT INTO `wowpreklad`.`tasks` (`User` ,`ExportSetting` ,`Date` ) VALUES ("'.$_SESSION['UserID'].'", "'.addslashes(serialize($ExportSetting)).'", NOW( ))');
|
---|
421 | }
|
---|
422 | WriteLog('Zadání úlohy pro vygenerování dbc souboru', 2);
|
---|
423 |
|
---|
424 |
|
---|
425 | /*
|
---|
426 | if(function_exists('gzcompress'))
|
---|
427 | {
|
---|
428 | $TempDir = $Config['Web']['TempFolder'].$_SESSION['User'].'/dbc/';
|
---|
429 | echo('Generování dbc souborů...<br />');
|
---|
430 | ExportToDBC($ExportSetting);
|
---|
431 | $SaveFilename = $Config['Web']['TempFolder'].$_SESSION['User'].'/CzWoW_DBC.zip';
|
---|
432 | $Zip = new zipfile();
|
---|
433 | CreateZipFromDir($Zip, $TempDir, 'DBCClientFiles/');
|
---|
434 | $Buffer = $Zip->file();
|
---|
435 | file_put_contents($SaveFilename, $Buffer);
|
---|
436 | echo('Hotovo<br /><br />');
|
---|
437 | } else echo('Funkce pro tvorbu Zip souboru není podporována!');
|
---|
438 | echo('<script type="text/javascript" language="JavaScript" charset="utf-8">'.
|
---|
439 | 'setTimeout("parent.location.href=\''.$SaveFilename.'\'", 3000)'.
|
---|
440 | '</script>');
|
---|
441 |
|
---|
442 | echo('Pokud nezačalo stahování, soubor by mělo jít stáhnout pomocí tohoto odkazu: '.
|
---|
443 | '<a href="'.$SaveFilename.'">CzWoW_DBC.zip</a><br />'.
|
---|
444 | '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.');
|
---|
445 | echo('<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 Data/enUS jako patch-enUS-5.MPQ. Hru spusťte pomocí programu WoWMe.exe (WoW Model Editor Fix).');
|
---|
446 | */
|
---|
447 |
|
---|
448 | break;
|
---|
449 | case 'Lua':
|
---|
450 | if(function_exists('gzcompress'))
|
---|
451 | {
|
---|
452 | $TempDir = $Config['Web']['TempFolder'].$_SESSION['User'].'/lua/';
|
---|
453 | echo('Generování lua souborů...<br />');
|
---|
454 | ExportToLUA($ExportSetting);
|
---|
455 | $SaveFilename = $Config['Web']['TempFolder'].$_SESSION['User'].'/CzWoW_Lua.zip';
|
---|
456 | $Zip = new zipfile();
|
---|
457 | CreateZipFromDir($Zip, $TempDir, '');
|
---|
458 | $Buffer = $Zip->file();
|
---|
459 | file_put_contents($SaveFilename, $Buffer);
|
---|
460 | echo('Hotovo<br /><br />');
|
---|
461 | } else echo('Funkce pro tvorbu Zip souboru není podporována!');
|
---|
462 | echo('<script type="text/javascript" language="JavaScript" charset="utf-8">'.
|
---|
463 | 'setTimeout("parent.location.href=\''.$SaveFilename.'\'", 3000)'.
|
---|
464 | '</script>');
|
---|
465 |
|
---|
466 | echo('Pokud nezačalo stahování, soubor by mělo jít stáhnout pomocí tohoto odkazu: '.
|
---|
467 | '<a href="'.$SaveFilename.'">CzWoW_Lua.zip</a><br />'.
|
---|
468 | '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.');
|
---|
469 | echo('<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 Data/enUS jako patch-enUS-5.MPQ. Hru spusťte pomocí programu WoWMe.exe (WoW Model Editor Fix).');
|
---|
470 | break;
|
---|
471 | }
|
---|
472 | //statistika výstupu
|
---|
473 | if ($ExportSetting['Export'] <> 'AoWoWSQLDirect' and $ExportSetting['Export'] <> 'XMLDirect' and $ExportSetting['Export'] <> 'AoWoWImport' and $ExportSetting['Export'] <> 'MangosSQLDirect') {
|
---|
474 | echo '<br /><br />';
|
---|
475 | foreach($TranslationTree as $Group)
|
---|
476 | if($Group['TablePrefix'] != '' and (in_array($Group['Id'], $ExportSetting['groups'])))
|
---|
477 | echo('<div class="state-image"><img alt="'.$Group['TablePrefix'].'" src="../img_statistic.php?group='.$Group['Id'].'&user='.$_SESSION['UserID'].'" title="statistika překladů '.$Group['Name'].'"/></div>');
|
---|
478 | }
|
---|
479 |
|
---|
480 | WriteLog('Generování SQL výstupu: Typ exportu: <strong>'.$ExportSetting['Export'].'</strong>, Diakritika: <strong>'.$ExportSetting['Diacritics'].'</strong>', 2);
|
---|
481 | break;
|
---|
482 | case 'output':
|
---|
483 | if(array_key_exists('groups', $_POST)) $ExportSetting['groups'] = $_POST['groups'];
|
---|
484 | $ExportSetting['Diacritics'] = array_key_exists('Diacritics', $_POST);
|
---|
485 | foreach($LanguageList as $Language)
|
---|
486 | if($Language['Enabled'] == 1)
|
---|
487 | $ExportSetting['language'.$Language['Id']] = array_key_exists('language'.$Language['Id'], $_POST);
|
---|
488 |
|
---|
489 | if(array_key_exists('ExportSetting', $_GET))
|
---|
490 | $ExportSetting = unserialize(stripcslashes(stripcslashes($_GET['ExportSetting'])));
|
---|
491 |
|
---|
492 | echo('<strong>Krok 3. - Typ výstupu</strong><br /><br />');
|
---|
493 | echo('<form action="?action=result" method="post"><div>'.
|
---|
494 | '<table><tr><td>'.
|
---|
495 | '<fieldset><legend>Forma výstupu</legend>'.
|
---|
496 | RadioButton('Export', 'MangosSQLDirect', $ExportSetting['Export'] == 'MangosSQLDirect', 'UpdateVersion('.GetVersions('MangosSQLDirect').',\''.$ExportSetting['Version'].'\')').'MaNGOS SQL - přímo zobrazit<br />'.
|
---|
497 | RadioButton('Export', 'MangosSQLCompressed', $ExportSetting['Export'] == 'MangosSQLCompressed', 'UpdateVersion('.GetVersions('MangosSQLCompressed').',\''.$ExportSetting['Version'].'\')').'MaNGOS SQL - komprimovaný soubor<br />'.
|
---|
498 | RadioButton('Export', 'AoWoWSQLDirect', $ExportSetting['Export'] == 'AoWoWSQLDirect', 'UpdateVersion('.GetVersions('AoWoWSQLDirect').',\''.$ExportSetting['Version'].'\')').'AoWoW SQL - přímo zobrazit<br />'.
|
---|
499 | RadioButton('Export', 'AoWoWSQLCompressed', $ExportSetting['Export'] == 'AoWoWSQLCompressed', 'UpdateVersion('.GetVersions('AoWoWSQLCompressed').',\''.$ExportSetting['Version'].'\')').'AoWoW SQL - komprimovaný soubor<br />'.
|
---|
500 | RadioButton('Export', 'XMLDirect', $ExportSetting['Export'] == 'XMLDirect', 'UpdateVersion('.GetVersions('XMLDirect').',\''.$ExportSetting['Version'].'\')').'XML - přímo zobrazit<br />'.
|
---|
501 | RadioButton('Export', 'XMLCompressed', $ExportSetting['Export'] == 'XMLCompressed', 'UpdateVersion('.GetVersions('XMLCompressed').',\''.$ExportSetting['Version'].'\')').'XML - komprimovaný soubor<br />'.
|
---|
502 | RadioButton('Export', 'Addon', $ExportSetting['Export'] == 'Addon', 'UpdateVersion('.GetVersions('Addon').',\''.$ExportSetting['Version'].'\')').'Addon - komprimovaný soubor<br />'.
|
---|
503 | RadioButton('Export', 'Lua', $ExportSetting['Export'] == 'Lua', 'UpdateVersion('.GetVersions('Lua').',\''.$ExportSetting['Version'].'\')').'Lua skripty - komprimovaný soubor<br />');
|
---|
504 | if(Licence(LICENCE_USER)) {
|
---|
505 | echo(RadioButton('Export', 'DBC', $ExportSetting['Export'] == 'DBC', 'UpdateVersion('.GetVersions('DBC').',\''.$ExportSetting['Version'].'\')').'DBC - komprimovaný soubor (pouze přihlášení)<br />');
|
---|
506 | } else {
|
---|
507 | echo (' <span style="padding: 20px"> Pro export do souborů dbc musíte být přihlášen</span>');
|
---|
508 | }
|
---|
509 | if(Licence(LICENCE_ADMIN)) {
|
---|
510 | // echo(RadioButton('Export', 'DBC', $ExportSetting['Export'] == 'DBC', 'UpdateVersion('.GetVersions('DBC').',\''.$ExportSetting['Version'].'\')').'DBC - komprimovaný soubor (pouze admin)<br />');
|
---|
511 | echo(RadioButton('Export', 'AoWoWImport', $ExportSetting['Export'] == 'AoWoWImport', 'UpdateVersion('.GetVersions('AoWoWImport').',\''.$ExportSetting['Version'].'\')').'Importovat do AoWoW (pouze admin)<br />');
|
---|
512 | echo(RadioButton('Export', 'VerseCZ', $ExportSetting['Export'] == 'VerseCZ', 'UpdateVersion('.GetVersions('VerseCZ').',\''.$ExportSetting['Version'].'\')').'Vytvoření verze češtiny <a href="../download.php?createverse" Title="Před konečným exportováním napište popis k verzi" Target="_NEW">Popis k verzi</a> (pouze admin)<br />');
|
---|
513 | }
|
---|
514 | //echo('
|
---|
515 | echo('</fieldset>');
|
---|
516 | echo('<fieldset><legend>Dostupné verze výstupu</legend>');
|
---|
517 | echo('<select id="Version" size="5" name="Version">');
|
---|
518 | WriteOption(GetVersions($ExportSetting['Export']),$ExportSetting['Version']);
|
---|
519 | echo('</select></fieldset>');
|
---|
520 | echo('</td>');
|
---|
521 | echo('<td class="Description">Zvolte způsob, jakým mají být získána výstupní data. V případě přímého zobrazení může být do vašeho prohlížeče přenášeno vysoké množství dat, což může vést k jeho přetížení.<br /><br />Poté zvolte pro kterou verzi hry mají být data získána. Pokud verze není přesná zvolte nejbližší.<br /><br />Addon je potřeba nakopírovat do složky klienta Interface/AddOns a ve hře lze zpřístupnit jeho možnosti pomocí příkazu /czwow.<br />');
|
---|
522 | echo('</td></tr></table>');
|
---|
523 | echo('<br /><input type="submit" value="Dokončit" />');
|
---|
524 | echo('</div></form><br />');
|
---|
525 | echo('<fieldset><legend>Nastavení exportu pro zálohování</legend>');
|
---|
526 | WriteSetting($ExportSetting);
|
---|
527 | echo ('</fieldset>');
|
---|
528 | break;
|
---|
529 | case 'parameters':
|
---|
530 | $ExportSetting['users-order'] = $_POST['users-order'];
|
---|
531 | $ExportSetting['users-selection'] = array();
|
---|
532 | $UsersList = explode(',', $_POST['users-order']);
|
---|
533 | foreach($UsersList as $Index => $Item)
|
---|
534 | {
|
---|
535 | if(array_key_exists('user_'.$Item, $_POST)) $ExportSetting['users-selection'][] = $Item;
|
---|
536 | }
|
---|
537 | //if(array_key_exists('users', $_POST)) $ExportSetting['users'] = $_POST['users'];
|
---|
538 | echo('<strong>Krok 2. - Volba parametrů</strong><br /><br />');
|
---|
539 | echo('<form action="?action=output" method="post"><div>');
|
---|
540 | echo('<table><tr><td>');
|
---|
541 | echo('<fieldset><legend>Jazyk</legend>'.
|
---|
542 | CheckBox('Diacritics', $ExportSetting['Diacritics'] == 'checked').'Včetně diakritiky<br /><br />');
|
---|
543 | //echo('<input type="checkbox" name="Use" checked="true">Přidat výchovýběr databáze.<br />');
|
---|
544 |
|
---|
545 | foreach($LanguageList as $Language)
|
---|
546 | if($Language['Enabled'] == 1)
|
---|
547 | echo(CheckBox('language'.$Language['Id'], $ExportSetting['language'.$Language['Id']] == 'checked').$Language['Name'].'<br />');
|
---|
548 |
|
---|
549 | echo('</fieldset><br /></td><td class="Description">Pro správné zobrazení českých znaků ve hře je nutné používat upravené <a href="download/ceske_fonty_do_wow.zip">počeštěné fonty</a>.<br />Vyberte jaké jazyky se mají uvažovat při exportu.</td></tr><tr><td><fieldset><legend>Skupiny textů</legend>');
|
---|
550 | echo('<select name="groups[]" size="15" multiple="multiple">');
|
---|
551 | foreach($TranslationTree as $Group)
|
---|
552 | if($Group['TablePrefix'] != '')
|
---|
553 | echo(SelectOption($Group['Id'], $Group['Name'].' ('.$Group['TablePrefix'].')', in_array($Group['Id'], $ExportSetting['groups'])));
|
---|
554 |
|
---|
555 | echo('</select></fieldset><br /></td><td class="Description">Vyberte skupiny textů, z kterých bude sestaven export. Přidržením CTRL nebo SHIFT můžete provádět výběr více položek.</td></tr></table><input type="submit" value="Pokračovat" />');
|
---|
556 | echo('</div></form>');
|
---|
557 | break;
|
---|
558 | default:
|
---|
559 | echo('<strong>Krok 1. - Výběr překladatelů</strong><br /><br />');
|
---|
560 | echo('<script type="text/javascript" src="'.$Config['Web']['BaseURL'].'style/jquery.js"></script>
|
---|
561 | <script type="text/javascript" src="'.$Config['Web']['BaseURL'].'style/jquery-ui.js"></script>
|
---|
562 | <script type="text/javascript">
|
---|
563 | $(document).ready(function()
|
---|
564 | {
|
---|
565 | $("#users-table").sortable({ items: "tr", sort: SortComplete });
|
---|
566 | $("#users-order").val($("#users-table").sortable(\'toArray\'));
|
---|
567 | });
|
---|
568 |
|
---|
569 | function SortComplete()
|
---|
570 | {
|
---|
571 | $("#users-order").val($("#users-table").sortable(\'toArray\'));
|
---|
572 | }
|
---|
573 | </script>');
|
---|
574 | echo('<form id="ListUser" action="?action=parameters" method="post"><div>');
|
---|
575 |
|
---|
576 | $Columns = '';
|
---|
577 | $Joins = '';
|
---|
578 |
|
---|
579 | //řezení podle odkazu
|
---|
580 | if(array_key_exists('Order', $_GET)) $order = $_GET['Order'];
|
---|
581 | else $order = 'T.TranslatedCount';
|
---|
582 | if(array_key_exists('Desc', $_GET)) $desc = $_GET['Desc'];
|
---|
583 | else $desc = '';
|
---|
584 | if($desc == '') $desc = 'DESC'; else $desc = '';
|
---|
585 |
|
---|
586 | foreach($TranslationTree as $Group)
|
---|
587 | if($Group['TablePrefix'] != '')
|
---|
588 | {
|
---|
589 | $Columns .= 'COALESCE(T'.$Group['Id'].'.Count, 0) + ';
|
---|
590 | $Joins .= ' LEFT JOIN (SELECT User, COUNT(User) as Count FROM `'.$Group['TablePrefix'].'` WHERE (Complete = 1) AND (Language <> 0) GROUP BY User) as T'.$Group['Id'].' ON user.ID=T'.$Group['Id'].'.User';
|
---|
591 | }
|
---|
592 | $Query = 'SELECT T.ID, T.TranslatedCount, T.user, T.XP FROM (SELECT user.ID, user.user, user.XP, ('.substr($Columns, 0, -3).') as TranslatedCount FROM `user`'.$Joins.') AS T WHERE T.TranslatedCount > 0 ORDER BY '.$order.' '.$desc;
|
---|
593 | $ID = $Database->SQLCommand($Query);
|
---|
594 |
|
---|
595 | // Rebuild user order list
|
---|
596 | $Users = array();
|
---|
597 | while($Line = mysql_fetch_assoc($ID)) {
|
---|
598 | $Users[$Line['ID']] = $Line;
|
---|
599 | $UsersOrder[] = $Line['ID'];
|
---|
600 | }
|
---|
601 | //řazení podle posledního použitého
|
---|
602 | if(!array_key_exists('Order', $_GET)) {
|
---|
603 | $UsersOrder = explode(',', $ExportSetting['users-order']);
|
---|
604 | foreach($Users as $User)
|
---|
605 | if(!in_array($User['ID'], $UsersOrder)) $UsersOrder[] = $User['ID'];
|
---|
606 | foreach($UsersOrder as $Index => $UserId)
|
---|
607 | if(!array_key_exists($UserId, $Users)) unset($UsersOrder[$Index]);
|
---|
608 | }
|
---|
609 | $ExportSetting['users-order'] = implode(',', $UsersOrder);
|
---|
610 |
|
---|
611 | if(array_key_exists('team', $_GET)) {
|
---|
612 | $ExportSetting['users-selection'] = array();
|
---|
613 | $Query = 'SELECT ID FROM user WHERE team = '.$_GET['team'];
|
---|
614 | $ID = $Database->SQLCommand($Query);
|
---|
615 | while($LineTeam = mysql_fetch_assoc($ID))
|
---|
616 | $ExportSetting['users-selection'][] = $LineTeam['ID'];
|
---|
617 | }
|
---|
618 |
|
---|
619 |
|
---|
620 | echo(' <input type="submit" value="Pokračovat" /> <span onclick="CheckAll()">'.CheckBox('CheckAll', False, 'CheckAll').' Zatrhnout vše</span> ');
|
---|
621 |
|
---|
622 | echo('<table><tr><td>'.
|
---|
623 | '<table class="BaseTable" id="users-table"><tr>
|
---|
624 | <th><a href="?Order=user&Desc='.$desc.'">Jméno</a></th>
|
---|
625 | <th><a href="?Order=T.TranslatedCount&Desc='.$desc.'" title="Počet přeložených textů">Překladů</a></th>
|
---|
626 | <th><a href="?Order=XP&Desc='.$desc.'">Úroveň</a></th>
|
---|
627 | <th></th></tr>');
|
---|
628 | //print_r($UsersOrder);
|
---|
629 | // Show ordered user list
|
---|
630 | foreach($UsersOrder as $UserId)
|
---|
631 | echo('<tr id="'.$UserId.'">
|
---|
632 | <td><a href="'.$Config['Web']['BaseURL'].'/TranslationList.php?user='.$UserId.'&action=userall" title="Zobrazit všechny jeho přeložené texty">'.$Users[$UserId]['user'].'</a></td>
|
---|
633 | <td>'.$Users[$UserId]['TranslatedCount'].'</td>
|
---|
634 | <td><img src="'.$Config['Web']['TempFolder'].$Users[$UserId]['user'].'/level.png" alt="Úroveň uživatele" /></td>
|
---|
635 | <td>'.CheckBox('user_'.$UserId, in_array($UserId, $ExportSetting['users-selection']), '', 'CheckBox').'</td></tr>');
|
---|
636 | echo('</table></td><td class="Description">Zvolte ze seznamu uživatele, od kterých chcete načítat překlady a upravte jejich pořadí, takže od uživatelů výše budou brány překlady přednostně.<br />'.
|
---|
637 | 'Řádky v tabulce můžete přesouvat metodou uchop a táhni.'.
|
---|
638 | '</td></tr></table>'.
|
---|
639 | '<div><input name="users-order" id="users-order" size="100" type="hidden" /><br />');
|
---|
640 | echo('<input type="submit" value="Pokračovat" /></div>');
|
---|
641 | echo('</div></form>');
|
---|
642 | break;
|
---|
643 | }
|
---|
644 |
|
---|
645 | if(array_key_exists('UserID', $_SESSION) and ($_SESSION['UserID'] != ''))
|
---|
646 | $Database->SQLCommand('UPDATE user SET ExportSetting = "'.addslashes(serialize($ExportSetting)).'" WHERE ID='.$_SESSION['UserID']);
|
---|
647 | else $_SESSION['ExportSetting'] = serialize($ExportSetting);
|
---|
648 |
|
---|
649 | //print_r($ExportSetting);
|
---|
650 |
|
---|
651 | ShowFooter();
|
---|
652 | ?>
|
---|