source: client_files/generate_SQL_other.php

Last change on this file was 40, checked in by george, 16 years ago
  • Upraveno: Změna kódování znaků souborů na UTF-8.
File size: 2.9 KB
Line 
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(2)) { // echo 'Přístup povolen';
14 } else { die('Přístup zamítnut!'); }
15
16 //Const
17 $SeparatorString = '"';
18 $SlashString = chr(92);
19 $DBCFile = 6;
20 $F = 'tallent';
21 $File = "_language_files/$F.lua";
22 $save_filename = "_sql/$F.sql";
23
24 function Read()
25 { // BEGIN function Read
26 global $SeparatorString,$Buffer,$SlashString;
27 $Separator = $SeparatorString;
28
29 $result_string = substr($Buffer,0,strpos($Buffer,$Separator)); //načtení stringu
30 $last_char = substr($result_string,strlen($result_string)-1,1); //načtení předcházejícího znaku před separatorem
31 $Buffer = substr($Buffer,strlen($result_string)+1,strlen($Buffer)-strlen($result_string)); //mazání
32
33 while ($last_char == $SlashString) { //NFIRM", "Abandon \"%s\"?", "đ×ĐéđŚđ
34 $length_del = substr($Buffer,0,strpos($Buffer,$Separator));
35 $result_string .= $SeparatorString.substr($Buffer,0,strpos($Buffer,$Separator));
36 $last_char = substr($result_string,strlen($result_string)-1,1); //načtení předcházejícího znaku před separatorem
37 $Buffer = substr($Buffer,strlen($length_del)+1,strlen($Buffer)-strlen($result_string)); //mazání
38 }
39
40 return $result_string;
41
42 } // END function Read
43
44
45 $fcontents = file ($File);
46 $Buffer = '';
47
48 while (list ($line_num, $line) = each ($fcontents)) {
49 $Buffer .= $line;
50 }
51
52 $sql = "";
53 $id_text = '';
54 while ($Buffer <> '') {
55 Read();
56 $aj_text = Read();
57 Read();
58 $ru_text = Read();
59 $sql .= "INSERT INTO `client_text` ( `text` , `id_text` , `File` , `Language`) VALUES ( \"$aj_text\", \"$id_text\", '$DBCFile', '0' );
60 ";
61 }
62 $file_handle = fopen($save_filename, 'w');
63 $write_result = fwrite($file_handle, $sql);
64 fclose($file_handle);
65
66 echo '<b>hotovo</b>';
67
68/*
69
70local f=function(name, en, ru) RuWoW_interface[name]=ru; RuWoW_interface_entoname[en]=name; end; RuWoW_interface={ };RuWoW_interface_entoname={ };
71f("ABANDON_PET", "Are you sure you want to permanently abandon your pet?", "đĺĐő Đâđ-đÁĐÇđÁđŻĐő, ĐçĐéđż ĐůđżĐéđŞĐéđÁ đŻđ-đ-ĐüđÁđ-đ+đ- đŞđĚđ-đ-đ-đŞĐéĐîĐüĐĆ đżĐé Đüđ-đżđÁđ-đż đŹđŞĐéđżđ-Đćđ-?");
72f("ABANDON_QUEST_CONFIRM", "Abandon \"%s\"?", "đ×ĐéđŚđ-đĚđ-ĐéĐîĐüĐĆ đżĐé \"%s\"?");
73
74
75
76*/
77?>
78
Note: See TracBrowser for help on using the repository browser.