source: client_files/export_fo_file.php

Last change on this file was 52, checked in by george, 15 years ago
  • Opraveno: Zobrazení počtu překladů v tabulce uživatelů ve statistice.
File size: 1.3 KB
Line 
1<?php
2
3session_start();
4include('../includes/config.php');
5include('../includes/databaseconection.php');
6include('../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
13if(Licence(LICENCE_ADMIN))
14{
15} else die('Přístup zamítnut!');
16
17$save_filename = '_export/LocalizationStrings.lua';
18
19function 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);
28while($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);
38fclose($file_handle);
39
40echo('Exportování LocalizationStrings.lua: <b>hotovo</b>');
41
42?>
43
Note: See TracBrowser for help on using the repository browser.