1 | <?php
|
---|
2 |
|
---|
3 | session_start();
|
---|
4 | include('../includes/config.php');
|
---|
5 | include('../includes/databaseconection.php');
|
---|
6 | include('../includes/global_function.php');
|
---|
7 |
|
---|
8 | //připojení do databáze
|
---|
9 | $Database = new Database($Config['Database']['Host'], $Config['Database']['User'], $Config['Database']['Password']);
|
---|
10 | $Database->SQLCommand('SET NAMES '.$Config['Database']['Charset']);
|
---|
11 | $Database->SelectDatabase($Config['Database']['Database']);
|
---|
12 |
|
---|
13 | if(Licence(LICENCE_ADMIN))
|
---|
14 | {
|
---|
15 | } else die('Přístup zamítnut!');
|
---|
16 |
|
---|
17 | $save_filename = '_export/LocalizationStrings.lua';
|
---|
18 |
|
---|
19 | function RepairText($text)
|
---|
20 | {
|
---|
21 | $text = mysql_escape_string($text);
|
---|
22 | return $text;
|
---|
23 | }
|
---|
24 |
|
---|
25 | $Buffer = "local f=function(name, en, ru) RuWoW_interface[name]=ru; RuWoW_interface_entoname[en]=name; end; RuWoW_interface={ };RuWoW_interface_entoname={ };\n";
|
---|
26 | $sql = "SELECT * FROM client_text WHERE Language = '0' AND File = 0";
|
---|
27 | $ID = $Database->SQLCommand($sql);
|
---|
28 | while($Line = mysql_fetch_array($ID))
|
---|
29 | {
|
---|
30 | $id_text = RepairText($Line['id_text']);
|
---|
31 | $text = RepairText($Line['text']);
|
---|
32 |
|
---|
33 | $Buffer .= 'f("'.$id_text.'", "'.$text.'", "test");'."\n";
|
---|
34 | }
|
---|
35 |
|
---|
36 | $file_handle = fopen($save_filename, 'w');
|
---|
37 | $write_result = fwrite($file_handle, $Buffer);
|
---|
38 | fclose($file_handle);
|
---|
39 |
|
---|
40 | echo('Exportování LocalizationStrings.lua: <b>hotovo</b>');
|
---|
41 |
|
---|
42 | ?>
|
---|
43 |
|
---|