Changeset 61 for trunk/client_files
- Timestamp:
- Feb 4, 2009, 9:51:34 PM (16 years ago)
- Location:
- trunk/client_files
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/client_files/Generate/create_language_file.php
r40 r61 1 1 <?php 2 session_start();3 include('../../includes/config.php');4 include('../../includes/databaseconection.php');5 include('../../includes/global_function.php');6 2 7 //připojení do databáze 8 $Database = new Database($Config['Database']['Host'], $Config['Database']['User'], $Config['Database']['Password']); 9 $Database->SQLCommand('SET NAMES '.$Config['Database']['Charset']); 10 $Database->SelectDatabase($Config['Database']['Database']); 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']); 11 12 12 if (Licence(2)) { // echo 'Přístup povolen'; 13 } else { die('Přístup zamítnut!'); } 13 if(Licence(LICENCE_ADMIN)) 14 { // echo 'Přístup povolen'; 15 } else die('Přístup zamítnut!'); 14 16 15 17 include ('define.php'); 16 18 17 18 { // BEGIN function ReplaceVarInText 19 20 21 22 23 24 19 function ReplaceVarInText($string) 20 { 21 $string = str_replace('$N', '"..strlower(UnitName("player")).."', $string); 22 $string = str_replace('$n', '"..strlower(UnitName("player")).."', $string); 23 $string = str_replace('$c', '"..strlower(UnitClass("player")).."', $string); 24 $string = str_replace('$C', '"..strlower(UnitClass("player")).."', $string); 25 $string = str_replace('$R', '"..strlower(UnitRace("player")).."', $string); 26 $string = str_replace('$r', '"..strlower(UnitRace("player")).."', $string); 25 27 26 27 28 29 return $string;30 } // END function ReplaceVarInText 28 $string = str_replace('$', '', $string); 29 $string = str_replace(chr(13), '', $string); 30 $string = str_replace(chr(10), '', $string); 31 return($string); 32 } 31 33 32 //funkce na přepsání zlých znaků34 // Funkce na přepsání zlých znaků 33 35 34 35 { // BEGIN function ReplaceBadChar 36 function ReplaceEnText($string) 37 { 36 38 // $string = mysql_escape_string($string); 37 38 39 40 41 42 43 39 $string = strtolower($string); 40 $string = str_replace('$gman:woman;', '"..gsub(gsub(UnitSex("player"), "^2$", "man"), "^3$", "woman").."', $string); 41 $string = str_replace('$g man : woman;', '"..gsub(gsub(UnitSex("player"), "^2$", "man"), "^3$", "woman").."', $string); 42 $string = str_replace('$ghis:her;', '"..gsub(gsub(UnitSex("player"), "^2$", "his"), "^3$", "her").."', $string); 43 $string = str_replace('$g his : her;', '"..gsub(gsub(UnitSex("player"), "^2$", "his"), "^3$", "her").."', $string); 44 $string = str_replace('$glad:lass;', '"..gsub(gsub(UnitSex("lad"), "^2$", "his"), "^3$", "lass").."', $string); 45 $string = str_replace('$g lad : lass;', '"..gsub(gsub(UnitSex("lad"), "^2$", "his"), "^3$", "lass").."', $string); 44 46 45 46 47 48 49 50 51 return $string;52 } // END function ReplaceBadChar 47 $string = str_replace('"', '\"', $string); 48 $string = str_replace('$b$b', ' ', $string); 49 $string = str_replace('$b $b', ' ', $string); 50 $string = str_replace('$b', ' ', $string); 51 $string = str_replace(' ', ' ', $string); 52 $string = ReplaceVarInText($string); 53 return($string); 54 } 53 55 54 55 { // BEGIN function ReplaceBadChar 56 57 58 59 60 return $string;61 } // END function ReplaceBadChar 56 function ReplaceCzText($string) 57 { 58 $string = mysql_escape_string($string); 59 $string = str_replace('$B', '\r\n', $string); 60 $string = str_replace('$b', '\r\n', $string); 61 $string = ReplaceVarInText($string); 62 return($string); 63 } 62 64 63 for ($j=0; $j<count($ListFile); ++$j) { //hlavní ciklus souborů 65 for($j = 0; $j < count($ListFile); $j++) 66 { //hlavní cyklus souborů 64 67 65 66 68 echo $dir_out.$ListFile[$j]['File'].': '; 69 $i = 0; 67 70 68 71 $buffer = $ListFile[$j]['Header']; //hlavička souboru 69 72 70 $sql = $ListFile[$j]['sql']; 71 $ID = $Database->SQLCommand($sql); 72 while ($Line = mysql_fetch_array($ID)) { 73 $en = ReplaceEnText($Line['en']); 74 $cz = ReplaceCzText($Line['cz']); 75 if ($en <> '' and $cz <> '') { 76 $buffer = $buffer.' 73 $sql = $ListFile[$j]['sql']; 74 $ID = $Database->SQLCommand($sql); 75 while ($Line = mysql_fetch_array($ID)) 76 { 77 $en = ReplaceEnText($Line['en']); 78 $cz = ReplaceCzText($Line['cz']); 79 if($en <> '' and $cz <> '') 80 { 81 $buffer = $buffer.' 77 82 ["'.$en.'"]="'.$cz.'",'; 78 83 $i = $i + 1; 79 }80 84 } 85 } 81 86 82 87 $buffer = $buffer.' 83 88 '.$ListFile[0]['Footer'].'+'.$i.'; 84 89 '; //patička souboru 85 90 86 if ($i > 0) {87 88 89 90 91 92 echo '<b>HOTOVO</b><br />';93 } else {echo '<b>ÁDNÝ TEXT</b><br />';}94 91 if($i > 0) 92 { 93 $file_handle = fopen($dir_out.$ListFile[$j]['File'], 'w'); 94 $write_result = fwrite($file_handle, $buffer); 95 fclose($file_handle); 96 97 echo('<b>HOTOVO</b><br />'); 98 } else echo('<b>ŽÁDNÝ TEXT</b><br />'); 99 } 95 100 96 101 ?> -
trunk/client_files/Generate/define.php
r40 r61 61 61 "Footer" => "};if not ".$wow."WOW_BookPage then ".$wow."WOW_BookPage=0; end; ".$wow."WOW_BookPage=".$wow."WOW_BookPage", 62 62 "sql" => "SELECT DISTINCT entry, ( 63 SELECT Text FROM page _textas text_cz WHERE text_cz.entry = page_text_distric.entry AND Language = 2 AND complete = 164 ORDER BY vote DESC LIMIT 1 65 ) as cz, ( 66 SELECT Text FROM page _textas text_en WHERE text_en.entry = page_text_distric.entry AND Language = 0 LIMIT 167 ) as en FROM page _textas page_text_distric63 SELECT Text FROM page as text_cz WHERE text_cz.entry = page_text_distric.entry AND Language = 2 AND complete = 1 64 ORDER BY vote DESC LIMIT 1 65 ) as cz, ( 66 SELECT Text FROM page as text_en WHERE text_en.entry = page_text_distric.entry AND Language = 0 LIMIT 1 67 ) as en FROM page as page_text_distric 68 68 WHERE $where_sk $limit", 69 69 ); … … 73 73 for ($j=0;$j<2 ;++$j ) { 74 74 $sql = $sql."SELECT DISTINCT entry, ( 75 SELECT text".$i."_$j FROM npc _textas text_cz WHERE text_cz.entry = npc_text_distric.entry AND Language = 2 AND complete = 176 ORDER BY vote DESC LIMIT 1 77 ) as cz, ( 78 SELECT text".$i."_$j FROM npc _textas text_en WHERE text_en.entry = npc_text_distric.entry AND Language = 0 LIMIT 179 ) as en FROM npc _textas npc_text_distric75 SELECT text".$i."_$j FROM npc as text_cz WHERE text_cz.entry = npc_text_distric.entry AND Language = 2 AND complete = 1 76 ORDER BY vote DESC LIMIT 1 77 ) as cz, ( 78 SELECT text".$i."_$j FROM npc as text_en WHERE text_en.entry = npc_text_distric.entry AND Language = 0 LIMIT 1 79 ) as en FROM npc as npc_text_distric 80 80 WHERE $where $limit UNION "; 81 81 } … … 145 145 "Footer" => "};if not ".$wow."WOW_BookPage then ".$wow."WOW_BookPage=0; end; ".$wow."WOW_BookPage=".$wow."WOW_BookPage", 146 146 "sql" => "SELECT DISTINCT entry, ( 147 SELECT Text FROM page _textas text_cz WHERE text_cz.entry = page_text_distric.entry AND Language = 1 AND complete = 1148 ORDER BY vote DESC LIMIT 1 149 ) as cz, ( 150 SELECT Text FROM page _textas text_en WHERE text_en.entry = page_text_distric.entry AND Language = 0 LIMIT 1151 ) as en FROM page _textas page_text_distric147 SELECT Text FROM page as text_cz WHERE text_cz.entry = page_text_distric.entry AND Language = 1 AND complete = 1 148 ORDER BY vote DESC LIMIT 1 149 ) as cz, ( 150 SELECT Text FROM page as text_en WHERE text_en.entry = page_text_distric.entry AND Language = 0 LIMIT 1 151 ) as en FROM page as page_text_distric 152 152 WHERE $where $limit", 153 153 ); … … 158 158 for ($j=0;$j<2 ;++$j ) { 159 159 $sql = $sql."SELECT DISTINCT entry, ( 160 SELECT text".$i."_$j FROM npc _textas text_cz WHERE text_cz.entry = npc_text_distric.entry AND Language = 1 AND complete = 1161 ORDER BY vote DESC LIMIT 1 162 ) as cz, ( 163 SELECT text".$i."_$j FROM npc _textas text_en WHERE text_en.entry = npc_text_distric.entry AND Language = 0 LIMIT 1164 ) as en FROM npc _textas npc_text_distric160 SELECT text".$i."_$j FROM npc as text_cz WHERE text_cz.entry = npc_text_distric.entry AND Language = 1 AND complete = 1 161 ORDER BY vote DESC LIMIT 1 162 ) as cz, ( 163 SELECT text".$i."_$j FROM npc as text_en WHERE text_en.entry = npc_text_distric.entry AND Language = 0 LIMIT 1 164 ) as en FROM npc as npc_text_distric 165 165 WHERE $where $limit UNION "; 166 166 } -
trunk/client_files/Generate/search_var.php
r40 r61 14 14 15 15 function set_name($text) 16 { // BEGIN function get_name16 { 17 17 global $buffer; 18 18 $text = substr($text, strpos($text, '$g')+2, strlen($text)-strpos($text, '$g')); … … 20 20 $men = substr($text, 0, strpos($text, ':')); 21 21 $women = substr($text, strpos($text, ':')+1, strlen($text)-strpos($text, ':')+1); 22 if (isset($buffer[$men]) == false and ($men <> '') and ($women <> '') and (strlen($men) < 10) and (strlen($women) < 10)) { 22 if (isset($buffer[$men]) == false and ($men <> '') and ($women <> '') and (strlen($men) < 10) and (strlen($women) < 10)) 23 { 23 24 $buffer[$men] = $women; 24 25 // echo $men.' '.$women.'<br />'; 25 26 } 26 } // END function get_name27 } 27 28 28 29 … … 31 32 // echo $sql.'<br /><br />'; 32 33 $ID = $Database->SQLCommand($sql); 33 while ($Line = mysql_fetch_array($ID)) { 34 while ($Line = mysql_fetch_array($ID)) 35 { 34 36 // $language = $Line['Language']; 35 37 $text = strtolower($Line['Details']); … … 47 49 48 50 $sql = 'SELECT '; 49 for ($i=0;$i<8 ;++$i ) { 50 for ($j=0;$j<2 ;++$j ) { 51 for ($i=0;$i<8 ;++$i ) 52 { 53 for ($j=0;$j<2 ;++$j ) 54 { 51 55 $sql = $sql."text".$i."_$j,"; 52 56 } 53 57 } 54 58 $sql = substr($sql, 0, strlen($sql)-1); 55 $sql = $sql." FROM npc_text WHERE "; 56 for ($i=0;$i<8 ;++$i ) { 57 for ($j=0;$j<2 ;++$j ) { 59 $sql = $sql." FROM npc WHERE "; 60 for ($i=0;$i<8 ;++$i ) 61 { 62 for ($j=0;$j<2 ;++$j ) 63 { 58 64 $sql = $sql."text".$i."_$j LIKE '%\$G%' OR "; 59 65 } 60 66 } 61 for ($i=0;$i<8 ;++$i ) { 62 for ($j=0;$j<2 ;++$j ) { 67 for ($i=0;$i<8 ;++$i ) 68 { 69 for ($j=0;$j<2 ;++$j ) 70 { 63 71 $sql = $sql."text".$i."_$j LIKE '%\$g%' OR "; 64 72 } 65 73 } 66 $sql = substr($sql, 0, strlen($sql) -3);74 $sql = substr($sql, 0, strlen($sql) - 3); 67 75 68 76 69 77 $ID = $Database->SQLCommand($sql); 70 while ($Line = mysql_fetch_array($ID)) { 78 while ($Line = mysql_fetch_array($ID)) 79 { 71 80 // $language = $Line['Language']; 72 81 73 for ($i=0;$i<8 ;++$i ) { 74 for ($j=0;$j<2 ;++$j ) { 82 for ($i = 0; $i < 8 ;++$i ) 83 { 84 for ($j = 0; $j < 2 ;++$j ) 85 { 75 86 $text = strtolower($Line["text".$i."_$j"]); 76 87 set_name($text); … … 80 91 81 92 echo '$var_g = array(<br />'; 82 foreach ($buffer as $key=>$value) { 93 foreach ($buffer as $key => $value) 94 { 83 95 // echo $key.'-'.$value.'<br />'; 84 96 echo " array('$key','$value'),<br />"; -
trunk/client_files/_czwow/návod na sestavení CZWOW.txt
r24 r61 1 1. v souboru "Generate\define.php" se nastaví vhodný sql p øíkaz na generování a èíslo verze2 2. Pomocí souboru "Generate\search_var.php" se vygenerují v echny promìné $g, vygenerovaný text vlote na konec souboru "Generate\define.php"3 3. pomocí souboru "Generate\create_language_file.php" se vygenerují p øekladové soubory soubory4 4. vygenerované soubory p øekladu se pøevedou na znakovou sadu UTF-81 1. v souboru "Generate\define.php" se nastaví vhodný sql příkaz na generování a číslo verze 2 2. Pomocí souboru "Generate\search_var.php" se vygenerují všechny proměné $g, vygenerovaný text vložte na konec souboru "Generate\define.php" 3 3. pomocí souboru "Generate\create_language_file.php" se vygenerují překladové soubory soubory 4 4. vygenerované soubory překladu se převedou na znakovou sadu UTF-8 5 5 5. pomocí souboru "Generate\img_statistic.php" se vygenerují obrázky pro changelog 6 6. na stránce generující obrázky se vygeneruje popis verze, tu zkopíruj do souboru "_czwow\CzWoW\CzWoW.html" v tomto souboru se musí také upravit verze v hlavi èce7 7. soubory ze slo ky "Generate\compile\" pøekopíruj do sloky "_czwow\CZ" a SK soubory s 2 na konci jsou èeské soubory a patøí do sloky CZ8 8. obrázky ze slo ky "Generate\compile_png" pøekopíruj do sloky "_czwow\CZWOW"6 6. na stránce generující obrázky se vygeneruje popis verze, tu zkopíruj do souboru "_czwow\CzWoW\CzWoW.html" v tomto souboru se musí také upravit verze v hlavičce 7 7. soubory ze složky "Generate\compile\" překopíruj do složky "_czwow\CZ" a SK soubory s 2 na konci jsou české soubory a patří do složky CZ 8 8. obrázky ze složky "Generate\compile_png" překopíruj do složky "_czwow\CZWOW" 9 9 9. v souboru "_czwow\CzWoW.nsi" nastav verzi a pak zkopmpiluj 10 10 10. soubory taky nakopíruj do zipu "_czwow\CzWoW-verze.zip" 11 11. commitni na SVN, vlo do torrentu a uprav web na stahování "wowpreklad\download-addon.php"11 11. commitni na SVN, vlož do torrentu a uprav web na stahování "wowpreklad\download-addon.php"
Note:
See TracChangeset
for help on using the changeset viewer.