Changeset 290
- Timestamp:
- Dec 27, 2009, 1:08:48 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/banners.php
r188 r290 4 4 5 5 ShowPage(); 6 7 $Banner = '<a href="'.$Config['Web']['BaseURL'].'"><img src="'.$Config['Web']['BaseURL'].'banners/baner_468_60.jpg" '. 8 'alt="baner_'.$Config['Web']['BaseURL'].'" title="Otevřený projekt překládání celé hry World of Warcraft" '. 9 'class="banner" height="60" width="468" /></a>'; 10 11 $BannerSmall = '<a href="'.$Config['Web']['BaseURL'].'"><img src="'.$Config['Web']['BaseURL'].'banners/baner_88_31.jpg" '. 12 'alt="baner_'.$Config['Web']['BaseURL'].'" title="Otevřený projekt překládání celé hry World of Warcraft" '. 13 'class="banner" height="31" width="88" /></a>'; 14 15 echo('<strong>Bannery:</strong><br />'); 16 17 echo($Banner.' <textarea rows="2" cols="30">'.htmlspecialchars($Banner).'</textarea><br />'); 18 echo($BannerSmall.' <textarea rows="2" cols="30">'.htmlspecialchars($BannerSmall).'</textarea><br />'); 6 19 7 20 $ID = $Database->SQLCommand('SELECT * FROM `banner` WHERE `Show`=1 AND `DateLast` > (NOW() - INTERVAL 3 MONTH)'); 8 21 9 echo('< strong>Servery odkazující na nás:</strong> <br />22 echo('<br/><strong>Servery odkazující na nás:</strong> <br /> 10 23 <div style="font-size: 10px;">Seznam je automaticky aktualizován a zobrazeny jsou servery s aktivní bannerem mladším než tři měsíce.</div><br />'); 11 24 while($Line = mysql_fetch_assoc($ID)) 12 25 { 13 echo('<a href="'.$Line['LastURL'].'">'.$Line['Web'].'</a> '.$Line['Description'].' <br />'); 26 echo('<a href="'.$Line['LastURL'].'">'.$Line['Web'].'</a> '.$Line['Description'].' <br />'); 14 27 } 15 28 -
trunk/download.php
r282 r290 71 71 } else 72 72 { 73 echo('<br /><h3><a href="export/">Export textů</a> - Export podle vlastního výběru do SQL, XML, LUA nebo Addonu</h3>'.74 '<br />Exportovat podle zálohovaného nastavení:<form action="export" method="get"><div>'.75 '<input name="action" value="output" type="hidden" />'.76 '<textarea name="ExportSetting" rows="10" cols="40"></textarea>'.77 '<input type="submit" value="Exportovat" /></div></form><br /><br />');78 73 79 if 74 if(Licence(LICENCE_USER)) 80 75 { 81 76 $ID = $Database->SQLCommand('SELECT * FROM tasks WHERE User = '.$_SESSION['UserID'].' ORDER BY Date DESC LIMIT 10'); -
trunk/export/cmd.php
r265 r290 1 1 <?php 2 2 3 ini_set( "memory_limit","100M");3 ini_set('memory_limit', '100M'); 4 4 5 5 if(!isset($_SERVER['REMOTE_ADDR'])) … … 10 10 { 11 11 $index = substr($parameter,0,strpos($parameter, '=')); 12 13 12 $parameter = substr($parameter,strpos($parameter, '=')+1); 13 //echo ($index.' ---- '.$parameter); 14 14 $_GET[$index] = $parameter; 15 15 } 16 } 16 } 17 17 } 18 18 … … 29 29 foreach($FileList as $FileName) 30 30 { 31 32 31 if(file_exists($Path.$FileName) and ($FileName != '.') and ($FileName != '..')) 32 { 33 33 //echo($Path.$FileName.'<br />'); 34 35 else $Zip->addFile(file_get_contents($Path.$FileName), $ZipPath.$FileName); 36 34 if(is_dir($Path.$FileName)) CreateZipFromDir($Zip, $Path.$FileName.'/', $ZipPath.$FileName.'/'); 35 else $Zip->addFile(file_get_contents($Path.$FileName), $ZipPath.$FileName); 36 } 37 37 } 38 38 } … … 44 44 { 45 45 $ExportSetting = unserialize($Line['ExportSetting']); 46 47 $_SESSION['UserID'] = $Line['User']; 46 $_SESSION['User'] = $Line['UserName']; 47 $_SESSION['UserID'] = $Line['User']; 48 48 49 49 if(function_exists('gzcompress')) 50 50 { 51 51 $TempDir = $Config['Web']['TempFolder'].$_SESSION['User'].'/dbc/'; 52 52 echo('Generování dbc souborů.. '); 53 53 ExportToDBC($ExportSetting); 54 54 $SaveFilename = $Config['Web']['TempFolder'].$_SESSION['User'].'/CzWoW_DBC.zip'; 55 55 $Zip = new zipfile(); 56 57 56 CreateZipFromDir($Zip, $TempDir, 'DBFilesClient/'); 57 $Buffer = $Zip->file(); 58 58 file_put_contents($SaveFilename, $Buffer); 59 59 echo('Hotovo'); 60 60 } else echo('Funkce pro tvorbu Zip souboru není podporována!'); 61 61 } … … 64 64 65 65 66 // 66 // WriteLog('Generování dbc úloh', 2); 67 67 ?> -
trunk/export/export.php
r264 r290 1 1 <?php 2 2 3 function ExportToMangosSQL($Setting) 3 include_once('../includes/system.php'); 4 5 class Export extends Module 4 6 { 5 global $Database, $Config, $TranslationTree, $LanguageList; 6 7 $AnoNe = array('Ne', 'Ano'); 8 if($_SESSION['UserID'] != '') 9 { 10 $DbResult = $Database->SQLCommand('SELECT user FROM `user` WHERE ID='.$_SESSION['UserID']); 11 $User = mysql_fetch_assoc($DbResult); 12 } else $User = array('user' => 'Neznámý'); 13 14 $WhereLang = ''; 15 foreach($LanguageList as $Language) 16 if($Language['Enabled'] == 1) 17 if(isset($Setting['language'.$Language['Id']])) $WhereLang .= ' OR (Language = '.$Language['Id'].')'; 18 if($WhereLang == '') $WhereLang = 1; 19 else $WhereLang = '('.substr($WhereLang, 4).')'; 20 21 $SelectedUsers = ''; 22 foreach($Setting['users-selection'] as $Item) 23 $SelectedUsers .= ','.$Item; 24 $SelectedUsers = substr($SelectedUsers, 1); 25 26 if($SelectedUsers == '') $Where = 0; 27 else $Where = 'ID IN ('.$SelectedUsers.')'; 28 29 $UserNames = ''; 30 $DbResult = $Database->SQLCommand('SELECT user FROM `user` WHERE '.$Where); 31 while($DbRow = mysql_fetch_assoc($DbResult)) 32 $UserNames .= ','.$DbRow['user']; 33 $UserNames = substr($UserNames, 1); 7 var $Id; 8 var $AnoNe = array('Ne', 'Ano'); 9 var $WhereLang; 10 var $WhereUsers; 11 var $SelectedUsers; 12 var $UserNames; 13 var $User; 14 var $ClientVersion; 15 16 function LoadFilters() 17 { 18 $DbResult = $this->Database->query('SELECT * FROM `Export` WHERE Id='.$this->Id); 19 $this->Export = $DbResult->fetch_assoc(); 20 21 // Filter selected languages 22 $this->WhereLang = ''; 23 $DbResult = $this->Database->query('SELECT * FROM `ExportLanguage` WHERE Export='.$this->Id.' ORDER BY Sequence'); 24 while($Language = $DbResult->fetch_assoc()) 25 $this->WhereLang .= ' OR (Language = '.$Language['Language'].')'; 26 if($this->WhereLang == '') $WhereLang = 1; 27 else $this->WhereLang = '('.substr($this->WhereLang, 4).')'; 28 29 // Filter selected users 30 $this->SelectedUsers = ''; 31 $DbResult = $this->Database->query('SELECT * FROM `ExportUser` WHERE Export='.$this->Id.' ORDER BY Sequence'); 32 while($User = $DbResult->fetch_assoc()) 33 $this->SelectedUsers .= ','.$User['User']; 34 $this->SelectedUsers = substr($this->SelectedUsers, 1); 35 36 if($this->SelectedUsers == '') $Where = 0; 37 else $Where = 'ID IN ('.$this->SelectedUsers.')'; 38 39 $this->UserNames = ''; 40 $DbResult = $this->Database->query('SELECT user FROM `user` WHERE '.$Where); 41 while($DbRow = $DbResult->fetch_assoc()) 42 $this->UserNames .= ','.$DbRow['user']; 43 $this->UserNames = substr($this->UserNames, 1); 34 44 35 if($SelectedUsers == '') $WhereUsers = 1; 36 else $WhereUsers = '(User IN ('.$SelectedUsers.'))'; 37 38 $Buffer = 39 "-- Generováno projektem wowpreklad.zdechov.net\n". 40 "-- ===========================================\n". 41 "--\n". 42 "-- Web projektu: ".$Config['Web']['BaseURL']."\n". 43 "-- Datum exportu: ".date("j.n.Y H:i:s")."\n". 44 "-- Znaková sada: ".$Config['Database']['Charset']." / ".$Config['Web']['Charset']."\n". 45 "-- Diakritika: ".$AnoNe[$Setting['Diacritics']]."\n". 46 "-- Vygeneroval uživatel: ".$User['user']."\n". 47 "-- Vzato od uživatelů: ".$UserNames."\n". 48 "-- Generované tabulky: "; 49 foreach($TranslationTree as $Group) 50 if($Group['MangosTable'] != '') 51 if(in_array($Group['Id'], $Setting['groups'])) 52 $Buffer .= $Group['MangosTable'].', '; 53 $Buffer .= "\n\n"; 54 55 foreach($TranslationTree as $Group) 56 if(in_array($Group['Id'], $Setting['groups'])) 57 { 58 if($Group['MangosTable'] != '') 59 { 60 $Query = 'SELECT * FROM (SELECT * FROM '.$Group['TablePrefix'].' WHERE (Complete = 1) AND VersionStart <= '.GetBuildNumber($Setting['Version']).' AND VersionEnd >= '.GetBuildNumber($Setting['Version']).' AND '.$WhereLang.' AND '.$WhereUsers.' ORDER BY FIELD(User, '.$SelectedUsers.')) AS T GROUP BY T.entry'; 45 if($this->SelectedUsers == '') $WhereUsers = 1; 46 else $this->WhereUsers = '(User IN ('.$this->SelectedUsers.'))'; 47 48 if($_SESSION['UserID'] != '') 49 { 50 $DbResult = $this->Database->query('SELECT user FROM `user` WHERE ID='.$_SESSION['UserID']); 51 $this->User = $DbResult->fetch_assoc(); 52 } else $this->User = array('user' => 'Neznámý'); 53 54 $DbResult = $this->Database->query('SELECT `BuildNumber` FROM `wow_client_version` WHERE `Id`='.$this->Export['ClientVersion']); 55 $DbRow = $DbResult->fetch_assoc(); 56 $this->ClientVersion = $DbRow['BuildNumber']; 57 } 58 59 function ExportToMangosSQL() 60 { 61 global $TranslationTree, $LanguageList; 62 63 $this->LoadFilters(); 64 65 $Buffer = 66 "-- Generováno projektem wowpreklad.zdechov.net\n". 67 "-- ===========================================\n". 68 "--\n". 69 "-- Web projektu: ".$this->Config['Web']['BaseURL']."\n". 70 "-- Datum exportu: ".date("j.n.Y H:i:s")."\n". 71 "-- Znaková sada: ".$this->Config['Database']['Charset']." / ".$this->Config['Web']['Charset']."\n". 72 "-- Diakritika: ".$this->AnoNe[$this->Export['WithDiacritic']]."\n". 73 "-- Vygeneroval uživatel: ".$this->User['user']."\n". 74 "-- Vzato od uživatelů: ".$this->UserNames."\n". 75 "-- Generované tabulky: "; 76 77 $DbResult = $this->Database->query('SELECT `group`.* FROM `ExportGroup` JOIN `group` ON `group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id); 78 while($Group = $DbResult->fetch_assoc()) 79 { 80 $Buffer .= $Group['MangosTable'].', '; 81 } 82 $Buffer .= "\n\n"; 83 84 $DbResult = $this->Database->query('SELECT `group`.* FROM `ExportGroup` JOIN `group` ON `group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id); 85 while($Group = $DbResult->fetch_assoc()) 86 { 87 if($Group['MangosTable'] != '') 88 { 89 $Query = 'SELECT * FROM (SELECT * FROM '.$Group['TablePrefix'].' WHERE (Complete = 1) AND VersionStart <= '.$this->ClientVersion.' AND VersionEnd >= '.$this->ClientVersion.' AND '.$this->WhereLang.' AND '.$this->WhereUsers.' ORDER BY FIELD(User, '.$this->SelectedUsers.')) AS T GROUP BY T.entry'; 90 //echo($Query); 91 $Buffer .= "\n\n-- ".$Group['Name']."\n\n"; 92 $DbResult2 = $this->Database->query($Query); 93 while($Line = $DbResult2->fetch_array()) 94 { 95 $Values = ''; 96 foreach($TranslationTree[$Group['Id']]['Items'] as $GroupItem) 97 { 98 if($GroupItem['MangosColumn'] == '') $GroupItem['MangosColumn'] = $GroupItem['Column']; 99 $Values .= ', `'.$GroupItem['MangosColumn'].'`="'.addslashes($Line[$GroupItem['Column']]).'"'; 100 } 101 $Values = substr($Values, 2); 102 $Buffer .= 'UPDATE `'.$Group['MangosTable'].'` SET '.$Values.' WHERE `'.$Group['MangosTableIndex'].'` = '.$Line['entry'].';'."\n"; 103 } 104 } 105 } 106 if($this->Export['WithDiacritic'] != 1) $Buffer = utf2ascii($Buffer); 107 return($Buffer); 108 } 109 110 function ExportToAoWoWSQL() 111 { 112 global $Config, $TranslationTree, $AoWoWconf, $LanguageList; 113 114 require_once('../aowow/configs/config.php'); 115 116 $Buffer = $this->ExportToMangosSQL(); 117 118 $this->LoadFilters(); 119 120 // Data to aowow 121 122 $Database2 = new mysqli($this->Config['Database']['Host'], $this->Config['Database']['User'], $this->Config['Database']['Password'], $this->Config['Database']['Database']); 123 $Database2->query('SET NAMES '.$this->Config['Database']['Charset']); 124 $Database2->select_db($AoWoWconf['mangos']['db']); 125 $AoWoWTables = array('aowow_resistances' => 'Id', 'aowow_spelldispeltype' => 'Id', 'aowow_skill' => 'skillID'); 126 foreach($AoWoWTables as $AoWoWTable => $IndexColum) 127 { 128 $Buffer .= '--'.$AoWoWTable.', '; 129 $Buffer .= "\n\n"; 130 $Query = 'SELECT name,'.$IndexColum.' FROM '.$AoWoWTable; 131 $DbResult = $Database2->query($Query); 132 while($Line = $DbResult->fetch_assoc()) 133 { 134 $Ori_text = $Line['name']; 135 $DbResult2 = $Datbase2->query('SELECT text as en, 136 (SELECT text FROM '.$Config['Database']['Database'].'.global_strings as tabletran 137 WHERE tableen.entry = tabletran.entry AND (Complete = 1) AND '.$WhereLang.' 138 AND '.$WhereUsers.' ORDER BY FIELD(User, '.$SelectedUsers.') LIMIT 1) as tran 139 FROM '.$Config['Database']['Database'].'.global_strings as tableen WHERE 140 text = "'.addslashes($Ori_text).'" LIMIT 1'); 141 $Tran = $DbResult2->fetch_assoc(); 142 //echo ($Line['name'].'='.$Tran['tran']); 143 if($Tran['tran'] == '') 144 { 145 $DbResult2 = $Database2->query('SELECT OptionText as en, 146 (SELECT OptionText FROM '.$this->Config['Database']['Database'].'.npc_option as tabletran 147 WHERE tableen.entry = tabletran.entry AND (Complete = 1) AND '.$this->WhereLang.' 148 AND '.$this->WhereUsers.' ORDER BY FIELD(User, '.$this->SelectedUsers.') LIMIT 1) as tran 149 FROM '.$this->Config['Database']['Database'].'.npc_option as tableen WHERE 150 OptionText = "'.addslashes($Ori_text).'" LIMIT 1'); 151 $Tran = $DbResult2->fetch_assoc(); 152 } 153 154 if($Tran['tran'] <> '') 155 $Buffer .= 'UPDATE `'.$AoWoWTable.'` SET name = "'.addslashes($Tran['tran']).'" WHERE '.$IndexColum.' = '.$Line[$IndexColum].' ;'."\n"; 156 } 157 $Buffer .= "\n\n"; 158 } 159 if($this->Export['WithDiacritic'] != 1) $Buffer = utf2ascii($Buffer); 160 return($Buffer); 161 } 162 163 164 function ExportToXML() 165 { 166 global $TranslationTree, $LanguageList; 167 168 $this->LoadFilters($this->Id); 169 170 $Buffer = '<?xml version="1.0" encoding="utf-8"?>'."\n". 171 "<document>\n". 172 " <meta>\n". 173 " <projecturl>".$this->Config['Web']['BaseURL']."</projecturl>\n". 174 " <time>".date('r')."</time>\n". 175 " <diacritics mode=".'"'.$this->Export['WithDiacritic'].'"'." />\n". 176 " <author>".$this->User['user']."</author>\n". 177 " <contributors>\n"; 178 foreach(explode(',', $this->UserNames) as $UserName) 179 $Buffer .= " <user>".$UserName."</user>\n"; 180 $Buffer .= 181 " </contributors>\n". 182 " </meta>\n". 183 " <translation>\n"; 184 185 $DbResult = $this->Database->query('SELECT `group`.* FROM `ExportGroup` JOIN `group` ON `group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id); 186 while($Group = $DbResult->fetch_assoc()) 187 { 188 if($Group['MangosTable'] == '') 189 { 190 $Group['MangosTable'] = $Group['TablePrefix']; 191 $Group['MangosTableIndex'] = 'entry'; 192 } 193 $Query = 'SELECT *,(SELECT user FROM user WHERE user.ID=T.User) as UserName FROM (SELECT * FROM '.$Group['TablePrefix'].' WHERE (Complete = 1) AND VersionStart <= '.$this->ClientVersion.' AND VersionEnd >= '.$this->ClientVersion.' AND '.$this->WhereLang.' AND '.$this->WhereUsers.' ORDER BY FIELD(User, '.$this->SelectedUsers.')) AS T GROUP BY T.entry'; 61 194 //echo($Query); 62 $Buffer .= "\n\n-- ".$Group['Name']."\n\n"; 63 $ID = $Database->SQLCommand($Query); 64 while($Line = mysql_fetch_array($ID)) 65 { 66 $Values = ''; 67 foreach($Group['Items'] as $GroupItem) 68 { 69 if($GroupItem['MangosColumn'] == '') $GroupItem['MangosColumn'] = $GroupItem['Column']; 70 $Values .= ', `'.$GroupItem['MangosColumn'].'`="'.addslashes($Line[$GroupItem['Column']]).'"'; 71 } 72 $Values = substr($Values, 2); 73 $Buffer .= 'UPDATE `'.$Group['MangosTable'].'` SET '.$Values.' WHERE `'.$Group['MangosTableIndex'].'` = '.$Line['entry'].';'."\n"; 74 } 75 } 195 $Buffer .= ' <group id="'.$Group['Id'].'" name="'.$Group['TablePrefix'].'">'."\n"; 196 $DbResult2 = $this->Database->query($Query); 197 while($Line = $DbResult2->fetch_assoc()) 198 { 199 $Buffer .= ' <item id="'.$Line['entry'].'" user="'.$Line['UserName'].'">'."\n"; 200 $Values = ''; 201 foreach($TranslationTree[$Group['Id']]['Items'] as $GroupItem) 202 { 203 if($GroupItem['MangosColumn'] == '') $GroupItem['MangosColumn'] = $GroupItem['Column']; 204 if($Line[$GroupItem['Column']] != '') 205 $Buffer .= ' <text index="'.$GroupItem['Id'].'" name="'.$GroupItem['Column'].'">'.addslashes($Line[$GroupItem['Column']]).'</text>'."\n"; 206 } 207 $Buffer .= " </item>\n"; 208 } 209 $Buffer .= " </group>\n"; 210 } 211 if($this->Export['WithDiacritic'] != 1) $Buffer = utf2ascii($Buffer); 212 $Buffer .= " </translation>\n". 213 "</document>"; 214 return($Buffer); 215 } 216 217 function ExportToDBC() 218 { 219 global $TranslationTree, $LanguageList; 220 221 $this->LoadFilters(); 222 223 $TempDir = $this->Config['Web']['TempFolder'].$_SESSION['User'].'/dbc/'; 224 if(!file_exists($TempDir)) mkdir($TempDir, 0777, true); 225 226 227 foreach($TranslationTree as $Group) 228 if(in_array($Group['Id'], $Setting['groups']) and ($Group['DBCFileName'] != '')) 229 { 230 echo($Group['Name'].'... '); 231 $DBCFile = new DBCFile(); 232 $DBCFile->OpenFile('../source/'.$Setting['Version'].'/dbc/'.$Group['DBCFileName'].'.dbc', GetDBCColumns($Setting['Version'],$Group['DBCFileName'])); 233 $DBCFile2 = new DBCFile(); 234 $DBCFile2->CreateFile($TempDir.$Group['DBCFileName'].'.dbc', GetDBCColumns($Setting['Version'],$Group['DBCFileName'])); 235 $Count = $DBCFile->GetRecordCount(); 236 //if($Group['DBCFileName'] == 'Spell') $Count = 1000; 237 $Line = $DBCFile->GetLine(0); 238 $DBCFile2->SetRecordCount($Count); 239 for($I = 0; $I < $Count; $I++) 240 { 241 $Line = $DBCFile->GetLine($I); 242 $Query = 'SELECT * FROM (SELECT * FROM '.$Group['TablePrefix'].' WHERE (Complete = 1) AND '.$WhereLang.' AND '.$WhereUsers.' AND (entry='.$Line[0].') AND VersionStart <= '.GetBuildNumber($Setting['Version']).' AND VersionEnd >= '.GetBuildNumber($Setting['Version']).' ORDER BY FIELD(User, '.$SelectedUsers.')) AS T GROUP BY T.entry'; 243 $DbResult = $this->Database->query($Query); 244 if($DbResult->num_rows > 0) 245 { 246 $DbRow = $DbResult->fetch_assoc(); 247 // if($Setting['Diacritics'] != 1) $Buffer = utf2ascii($Buffer); 248 249 foreach($Group['Items'] as $GroupItem) 250 if(GetDBCColumnIndex($Setting['Version'],$Group['DBCFileName'],$GroupItem['Column']) != '') 251 $Line[GetDBCColumnIndex($this->Export['ClientVersion'],$Group['DBCFileName'],$GroupItem['Column'])] = $DbRow[$GroupItem['Column']]; 252 //print_r($Line); 253 } 254 $DBCFile2->SetLine($I, $Line); 255 echo('.'); 256 } 257 $DBCFile2->Commit(); 258 echo('Hotovo <br />'); 259 } 76 260 } 77 if($Setting['Diacritics'] != 1) $Buffer = utf2ascii($Buffer); 78 return($Buffer); 79 } 80 81 function ExportToAoWoWSQL($Setting) 82 { 83 global $Database, $Config, $TranslationTree, $AoWoWconf, $LanguageList; 84 85 require_once('../aowow/configs/config.php'); 86 87 $Buffer = ExportToMangosSQL($Setting); 261 262 function ExportToLua() 263 { 264 global $TranslationTree, $LanguageList; 265 266 $this->LoadFilters(); 267 268 $TempDir = $this->Config['Web']['TempFolder'].$_SESSION['User'].'/lua/'; 269 if(!file_exists($TempDir)) mkdir($TempDir, 0777, true); 270 271 $DbResult = $this->Database->query('SELECT `group`.* FROM `ExportGroup` JOIN `group` ON `group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id.' AND `group`.`LuaFileName` != ""'); 272 while($Group = $DbResult->fetch_assoc()) 273 { 274 echo($Group['Name'].'... '); 275 $File = new FileStream(); 276 $File->OpenFile('../source/'.$this->ClientVersion.'/lua/'.$Group['LuaFileName'].'.lua'); 277 $File2 = new FileStream(); 278 $File2->CreateFile($TempDir.''.$Group['LuaFileName'].'.lua'); 88 279 89 $AnoNe = array('Ne', 'Ano'); 90 if($_SESSION['UserID'] != '') 91 { 92 $DbResult = $Database->SQLCommand('SELECT user FROM `user` WHERE ID='.$_SESSION['UserID']); 93 $User = mysql_fetch_assoc($DbResult); 94 } else $User = array('user' => 'Neznámý'); 95 96 $WhereLang = ''; 97 foreach($LanguageList as $Language) 98 if($Language['Enabled'] == 1) 99 if(isset($Setting['language'.$Language['Id']])) $WhereLang .= ' OR (Language = '.$Language['Id'].')'; 100 if($WhereLang == '') $WhereLang = 1; 101 else $WhereLang = '('.substr($WhereLang, 4).')'; 102 103 $SelectedUsers = ''; 104 foreach($Setting['users-selection'] as $Item) 105 $SelectedUsers .= ','.$Item; 106 $SelectedUsers = substr($SelectedUsers, 1); 107 108 if($SelectedUsers == '') $Where = 0; 109 else $Where = 'ID IN ('.$SelectedUsers.')'; 110 111 $UserNames = ''; 112 $DbResult = $Database->SQLCommand('SELECT user FROM `user` WHERE '.$Where); 113 while($DbRow = mysql_fetch_assoc($DbResult)) 114 $UserNames .= ','.$DbRow['user']; 115 $UserNames = substr($UserNames, 1); 116 117 if($SelectedUsers == '') $WhereUsers = 1; 118 else $WhereUsers = '(User IN ('.$SelectedUsers.'))'; 119 120 // Data to aowow 121 122 $Database->SelectDatabase($AoWoWconf['mangos']['db']); 123 $Database->SQLCommand('SET NAMES '.$Config['Database']['Charset']); 124 $AoWoWTables = array('aowow_resistances' => 'Id', 'aowow_spelldispeltype' => 'Id', 'aowow_skill' => 'skillID'); 125 foreach($AoWoWTables as $AoWoWTable => $IndexColum) 126 { 127 $Buffer .= '--'.$AoWoWTable.', '; 128 $Buffer .= "\n\n"; 129 $Query = 'SELECT name,'.$IndexColum.' FROM '.$AoWoWTable; 130 $ID = $Database->SQLCommand($Query); 131 while($Line = mysql_fetch_assoc($ID)) 132 { 133 $Ori_text = $Line['name']; 134 $Tran = mysql_fetch_assoc($Database->SQLCommand('SELECT text as en, 135 (SELECT text FROM '.$Config['Database']['Database'].'.global_strings as tabletran 136 WHERE tableen.entry = tabletran.entry AND (Complete = 1) AND '.$WhereLang.' 137 AND '.$WhereUsers.' ORDER BY FIELD(User, '.$SelectedUsers.') LIMIT 1) as tran 138 FROM '.$Config['Database']['Database'].'.global_strings as tableen WHERE 139 text = "'.addslashes($Ori_text).'" LIMIT 1')); 140 //echo ($Line['name'].'='.$Tran['tran']); 141 if ($Tran['tran'] == '') 142 { 143 $Tran = mysql_fetch_assoc($Database->SQLCommand('SELECT OptionText as en, 144 (SELECT OptionText FROM '.$Config['Database']['Database'].'.npc_option as tabletran 145 WHERE tableen.entry = tabletran.entry AND (Complete = 1) AND '.$WhereLang.' 146 AND '.$WhereUsers.' ORDER BY FIELD(User, '.$SelectedUsers.') LIMIT 1) as tran 147 FROM '.$Config['Database']['Database'].'.npc_option as tableen WHERE 148 OptionText = "'.addslashes($Ori_text).'" LIMIT 1')); 149 } 150 if ($Tran['tran'] <> '') 151 $Buffer .= 'UPDATE `'.$AoWoWTable.'` SET name = "'.addslashes($Tran['tran']).'" WHERE '.$IndexColum.' = '.$Line[$IndexColum].' ;'."\n"; 152 } 153 $Buffer .= "\n\n"; 154 } 155 if($Setting['Diacritics'] != 1) $Buffer = utf2ascii($Buffer); 156 return($Buffer); 157 } 158 159 160 function ExportToXML($Setting) 161 { 162 global $Database, $Config, $TranslationTree, $LanguageList; 163 164 $AnoNe = array('Ne', 'Ano'); 165 if($_SESSION['UserID'] != '') 166 { 167 $DbResult = $Database->SQLCommand('SELECT user FROM `user` WHERE ID='.$_SESSION['UserID']); 168 $User = mysql_fetch_assoc($DbResult); 169 } else $User = array('user' => 'Neznámý'); 170 171 $WhereLang = ''; 172 foreach($LanguageList as $Language) 173 if($Language['Enabled'] == 1) 174 if(isset($Setting['language'.$Language['Id']])) $WhereLang .= ' OR (Language = '.$Language['Id'].')'; 175 if($WhereLang == '') $WhereLang = 1; 176 else $WhereLang = '('.substr($WhereLang, 4).')'; 177 178 $SelectedUsers = ''; 179 foreach($Setting['users-selection'] as $Item) 180 $SelectedUsers .= ','.$Item; 181 $SelectedUsers = substr($SelectedUsers, 1); 182 183 if($SelectedUsers == '') $Where = 0; 184 else $Where = 'ID IN ('.$SelectedUsers.')'; 185 186 $UserNames = ''; 187 $DbResult = $Database->SQLCommand('SELECT user FROM `user` WHERE '.$Where); 188 while($DbRow = mysql_fetch_assoc($DbResult)) 189 $UserNames .= ','.$DbRow['user']; 190 $UserNames = substr($UserNames, 1); 191 192 if($SelectedUsers == '') $WhereUsers = 1; 193 else $WhereUsers = '(User IN ('.$SelectedUsers.'))'; 194 195 $Buffer = '<?xml version="1.0" encoding="utf-8"?>'."\n". 196 "<document>\n". 197 " <meta>\n". 198 " <projecturl>".$Config['Web']['BaseURL']."</projecturl>\n". 199 " <time>".date('r')."</time>\n". 200 " <diacritics mode=".'"'.$Setting['Diacritics'].'"'." />\n". 201 " <author>".$User['user']."</author>\n". 202 " <contributors>\n"; 203 foreach(explode(',', $UserNames) as $UserName) 204 $Buffer .= " <user>".$UserName."</user>\n"; 205 $Buffer .= 206 " </contributors>\n". 207 " </meta>\n". 208 " <translation>\n"; 209 210 foreach($TranslationTree as $Group) 211 if(in_array($Group['Id'], $Setting['groups'])) 212 { 213 if($Group['MangosTable'] == '') 214 { 215 $Group['MangosTable'] = $Group['TablePrefix']; 216 $Group['MangosTableIndex'] = 'entry'; 217 } 218 $Query = 'SELECT *,(SELECT user FROM user WHERE user.ID=T.User) as UserName FROM (SELECT * FROM '.$Group['TablePrefix'].' WHERE (Complete = 1) AND VersionStart <= '.GetBuildNumber($Setting['Version']).' AND VersionEnd >= '.GetBuildNumber($Setting['Version']).' AND '.$WhereLang.' AND '.$WhereUsers.' ORDER BY FIELD(User, '.$SelectedUsers.')) AS T GROUP BY T.entry'; 219 //echo($Query); 220 $Buffer .= ' <group id="'.$Group['Id'].'" name="'.$Group['TablePrefix'].'">'."\n"; 221 $ID = $Database->SQLCommand($Query); 222 while($Line = mysql_fetch_array($ID)) 223 { 224 $Buffer .= ' <item id="'.$Line['entry'].'" user="'.$Line['UserName'].'">'."\n"; 225 $Values = ''; 226 foreach($Group['Items'] as $GroupItem) 227 { 228 if($GroupItem['MangosColumn'] == '') $GroupItem['MangosColumn'] = $GroupItem['Column']; 229 if($Line[$GroupItem['Column']] != '') 230 $Buffer .= ' <text index="'.$GroupItem['Id'].'" name="'.$GroupItem['Column'].'">'.addslashes($Line[$GroupItem['Column']]).'</text>'."\n"; 231 } 232 $Buffer .= " </item>\n"; 233 } 234 $Buffer .= " </group>\n"; 235 } 236 if($Setting['Diacritics'] != 1) $Buffer = utf2ascii($Buffer); 237 $Buffer .= " </translation>\n". 238 "</document>"; 239 return($Buffer); 240 } 241 242 function ExportToDBC($Setting) 243 { 244 global $Database, $Config, $TranslationTree, $LanguageList; 245 246 $TempDir = $Config['Web']['TempFolder'].$_SESSION['User'].'/dbc/'; 247 if(!file_exists($TempDir)) mkdir($TempDir, 0777, true); 248 249 if($_SESSION['UserID'] != '') 250 { 251 $DbResult = $Database->SQLCommand('SELECT user FROM `user` WHERE ID='.$_SESSION['UserID']); 252 $User = mysql_fetch_assoc($DbResult); 253 } else $User = array('user' => 'Neznámý'); 254 255 $WhereLang = ''; 256 foreach($LanguageList as $Language) 257 if($Language['Enabled'] == 1) 258 if(isset($Setting['language'.$Language['Id']])) $WhereLang .= ' OR (Language = '.$Language['Id'].')'; 259 if($WhereLang == '') $WhereLang = 1; 260 else $WhereLang = '('.substr($WhereLang, 4).')'; 261 262 $SelectedUsers = ''; 263 foreach($Setting['users-selection'] as $Item) 264 $SelectedUsers .= ','.$Item; 265 $SelectedUsers = substr($SelectedUsers, 1); 266 267 if($SelectedUsers == '') $Where = 0; 268 else $Where = 'ID IN ('.$SelectedUsers.')'; 269 270 $UserNames = ''; 271 $DbResult = $Database->SQLCommand('SELECT user FROM `user` WHERE '.$Where); 272 while($DbRow = mysql_fetch_assoc($DbResult)) 273 $UserNames .= ','.$DbRow['user']; 274 $UserNames = substr($UserNames, 1); 275 276 if($SelectedUsers == '') $WhereUsers = 1; 277 else $WhereUsers = '(User IN ('.$SelectedUsers.'))'; 278 279 foreach($TranslationTree as $Group) 280 if(in_array($Group['Id'], $Setting['groups']) and ($Group['DBCFileName'] != '')) 281 { 282 echo($Group['Name'].'... '); 283 $DBCFile = new DBCFile(); 284 $DBCFile->OpenFile('../source/'.$Setting['Version'].'/dbc/'.$Group['DBCFileName'].'.dbc', GetDBCColumns($Setting['Version'],$Group['DBCFileName'])); 285 $DBCFile2 = new DBCFile(); 286 $DBCFile2->CreateFile($TempDir.$Group['DBCFileName'].'.dbc', GetDBCColumns($Setting['Version'],$Group['DBCFileName'])); 287 $Count = $DBCFile->GetRecordCount(); 288 //if($Group['DBCFileName'] == 'Spell') $Count = 1000; 289 $Line = $DBCFile->GetLine(0); 290 $DBCFile2->SetRecordCount($Count); 291 for($I = 0; $I < $Count; $I++) 292 { 293 $Line = $DBCFile->GetLine($I); 294 $Query = 'SELECT * FROM (SELECT * FROM '.$Group['TablePrefix'].' WHERE (Complete = 1) AND '.$WhereLang.' AND '.$WhereUsers.' AND (entry='.$Line[0].') AND VersionStart <= '.GetBuildNumber($Setting['Version']).' AND VersionEnd >= '.GetBuildNumber($Setting['Version']).' ORDER BY FIELD(User, '.$SelectedUsers.')) AS T GROUP BY T.entry'; 295 $DbResult = $Database->SQLCommand($Query); 296 if(mysql_num_rows($DbResult) > 0) 297 { 298 $DbRow = mysql_fetch_assoc($DbResult); 299 // if($Setting['Diacritics'] != 1) $Buffer = utf2ascii($Buffer); 300 301 foreach($Group['Items'] as $GroupItem) 302 if(GetDBCColumnIndex($Setting['Version'],$Group['DBCFileName'],$GroupItem['Column']) != '') 303 $Line[GetDBCColumnIndex($Setting['Version'],$Group['DBCFileName'],$GroupItem['Column'])] = $DbRow[$GroupItem['Column']]; 304 //print_r($Line); 305 } 306 $DBCFile2->SetLine($I, $Line); 307 echo('.'); 308 } 309 $DBCFile2->Commit(); 310 echo('Hotovo <br />'); 280 while(!$File->EOF()) 281 { 282 $Line = $File->ReadLine(); 283 if(strpos($Line, '=') !== false) 284 { 285 $LineParts = explode(';', $Line); 286 $LineParts2 = explode('=', $LineParts[0]); 287 $Value['ShortCut'] = trim($LineParts2[0]); 288 $Value['Text'] = substr(trim($LineParts2[1]), 1, -1); 289 $Value['Comment'] = addslashes(substr(trim($LineParts[1]), 3)); 290 291 $Query = 'SELECT * FROM (SELECT * FROM '.$Group['TablePrefix'].' WHERE (Complete = 1) AND '.$this->WhereLang.' AND '.$this->WhereUsers.' AND (ShortCut="'.$Value['ShortCut'].'") AND VersionStart <= '.$this->ClientVersion.' AND VersionEnd >= '.$this->ClientVersion.' ORDER BY FIELD(User, '.$this->SelectedUsers.')) AS T GROUP BY T.entry'; 292 //echo($Query); 293 $DbResult2 = $this->Database->query($Query); 294 if($DbResult2->num_rows > 0) 295 { 296 $DbRow = $DbResult2->fetch_assoc(); 297 $Value['Text'] = $DbRow['Text']; 298 $Value['Comment'] = $DbRow['Comment']; 299 //echo('.'); 300 } 301 $NewLine = $Value['ShortCut'].' = "'.$Value['Text'].'";'; 302 if($Value['Comment'] != '') $NewLine .= ' -- '.$Value['Comment']; 303 $NewLine .= "\n"; 304 $File2->WriteLine($NewLine); 305 } else $File2->WriteLine($Line."\n"); 306 } 307 echo('Hotovo <br />'); 308 } 311 309 } 312 310 } 313 311 314 function ExportToLua($Setting)315 {316 global $Database, $Config, $TranslationTree, $LanguageList;317 318 $TempDir = $Config['Web']['TempFolder'].$_SESSION['User'].'/lua/';319 if(!file_exists($TempDir)) mkdir($TempDir, 0777, true);320 321 if($_SESSION['UserID'] != '')322 {323 $DbResult = $Database->SQLCommand('SELECT user FROM `user` WHERE ID='.$_SESSION['UserID']);324 $User = mysql_fetch_assoc($DbResult);325 } else $User = array('user' => 'Neznámý');326 327 $WhereLang = '';328 foreach($LanguageList as $Language)329 if($Language['Enabled'] == 1)330 if(isset($Setting['language'.$Language['Id']])) $WhereLang .= ' OR (Language = '.$Language['Id'].')';331 if($WhereLang == '') $WhereLang = 1;332 else $WhereLang = '('.substr($WhereLang, 4).')';333 334 $SelectedUsers = '';335 foreach($Setting['users-selection'] as $Item)336 $SelectedUsers .= ','.$Item;337 $SelectedUsers = substr($SelectedUsers, 1);338 339 if($SelectedUsers == '') $Where = 0;340 else $Where = 'ID IN ('.$SelectedUsers.')';341 342 $UserNames = '';343 $DbResult = $Database->SQLCommand('SELECT user FROM `user` WHERE '.$Where);344 while($DbRow = mysql_fetch_assoc($DbResult))345 $UserNames .= ','.$DbRow['user'];346 $UserNames = substr($UserNames, 1);347 348 if($SelectedUsers == '') $WhereUsers = 1;349 else $WhereUsers = '(User IN ('.$SelectedUsers.'))';350 351 foreach($TranslationTree as $Group)352 if(in_array($Group['Id'], $Setting['groups']) and ($Group['LuaFileName'] != ''))353 {354 echo($Group['Name'].'... ');355 $File = new FileStream();356 $File->OpenFile('../source/'.$Setting['Version'].'/lua/'.$Group['LuaFileName'].'.lua');357 $File2 = new FileStream();358 $File2->CreateFile($TempDir.''.$Group['LuaFileName'].'.lua');359 360 while(!$File->EOF())361 {362 $Line = $File->ReadLine();363 if(strpos($Line, '=') !== false)364 {365 $LineParts = explode(';', $Line);366 $LineParts2 = explode('=', $LineParts[0]);367 $Value['ShortCut'] = trim($LineParts2[0]);368 $Value['Text'] = substr(trim($LineParts2[1]), 1, -1);369 $Value['Comment'] = addslashes(substr(trim($LineParts[1]), 3));370 371 $Query = 'SELECT * FROM (SELECT * FROM '.$Group['TablePrefix'].' WHERE (Complete = 1) AND '.$WhereLang.' AND '.$WhereUsers.' AND (ShortCut="'.$Value['ShortCut'].'") AND VersionStart <= '.GetBuildNumber($Setting['Version']).' AND VersionEnd >= '.GetBuildNumber($Setting['Version']).' ORDER BY FIELD(User, '.$SelectedUsers.')) AS T GROUP BY T.entry';372 //echo($Query);373 $DbResult = $Database->SQLCommand($Query);374 if(mysql_num_rows($DbResult) > 0)375 {376 $DbRow = mysql_fetch_assoc($DbResult);377 $Value['Text'] = $DbRow['Text'];378 $Value['Comment'] = $DbRow['Comment'];379 //echo('.');380 }381 $NewLine = $Value['ShortCut'].' = "'.$Value['Text'].'";';382 if($Value['Comment'] != '') $NewLine .= ' -- '.$Value['Comment'];383 $NewLine .= "\n";384 $File2->WriteLine($NewLine);385 } else $File2->WriteLine($Line."\n");386 }387 echo('Hotovo <br />');388 }389 }390 391 312 ?> -
trunk/export/index.php
r286 r290 3 3 session_start(); 4 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) 5 include_once('../includes/global.php'); 6 include_once('export_output.php'); 7 8 function ExportList() 9 { 10 global $Database; 11 12 echo('<a href="?Action=ViewList">Všechny</a>'); 13 if(Licence(LICENCE_USER)) 14 { 15 echo(' <a href="?Action=ViewList&Filter=Others">Ostatních</a>'); 16 echo(' <a href="?Action=ViewList&Filter=My">Moje</a>'); 17 } 18 19 $Filter = ''; 20 if(array_key_exists('Filter', $_GET)) 21 { 22 if($_GET['Filter'] == 'My') $Filter = ' WHERE `Export`.`User` = '.$_SESSION['UserID']; 23 if($_GET['Filter'] == 'Others') $Filter = ' WHERE `Export`.`User` != '.$_SESSION['UserID']; 24 } 25 26 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `Export` '.$Filter); 27 $DbRow = mysql_fetch_row($DbResult); 28 $PageList = GetPageList($DbRow[0]); 29 30 echo('<h3>Seznam exportů</h3>'); 31 echo($PageList['Output']); 32 33 $TableColumns = array( 34 array('Name' => 'TimeCreate', 'Title' => 'Čas vytvoření'), 35 array('Name' => 'UserName', 'Title' => 'Překladatel'), 36 array('Name' => 'Title', 'Title' => 'Popis'), 37 array('Name' => 'UsedCount', 'Title' => 'Počet stažení'), 38 array('Name' => 'UserCount', 'Title' => 'Překladatelů'), 39 array('Name' => 'GroupCount', 'Title' => 'Překladových skupin'), 40 array('Name' => '', 'Title' => 'Akce'), 41 ); 42 $Order = GetOrderTableHeader($TableColumns, 'TimeCreate'); 43 echo('<table class="BaseTable">'); 44 echo($Order['Output']); 45 46 $DbResult = $Database->SQLCommand('SELECT `user`.`user` AS `UserName`, `Export`.*, (SELECT COUNT(*) FROM ExportGroup WHERE ExportGroup.Export=Export.Id) AS GroupCount, (SELECT COUNT(*) FROM ExportUser WHERE ExportUser.Export=Export.Id) AS UserCount FROM `Export` LEFT JOIN `user` ON `user`.`ID`=`Export`.`User` '.$Filter.$Order['SQL'].$PageList['SQLLimit']); 47 while($Export = mysql_fetch_assoc($DbResult)) 48 { 49 $Action = '<a href="?Action=View&ExportId='.$Export['Id'].'">Zobrazit</a>'; 50 if($Export['User'] == $_SESSION['UserID']) $Action .= ' <a href="?Action=Delete&ExportId='.$Export['Id'].'"><div onclick="return confirmAction(\'Opravdu smazat položku?\');">Smazat</div></a>'; 51 echo('<tr><td>'.$Export['TimeCreate'].'</td><td>'.$Export['UserName'].'</td><td>'.$Export['Title'].'</td><td>'.$Export['UsedCount'].'</td><td>'.$Export['UserCount'].'</td><td>'.$Export['GroupCount'].'</td><td>'.$Action.'</td></tr>'); 52 } 53 echo('</table>'); 54 echo($PageList['Output']); 55 56 if(Licence(LICENCE_USER)) echo('<br/><div style="text-align: center;"><a href="?Action=Create">Vytvořit nový export</a></div>'); 57 } 58 59 function ExportCreate() 60 { 61 if(Licence(LICENCE_USER)) 62 { 63 echo('<form action="?Action=CreateFinish" method="post">'. 64 '<fieldset><legend>Vytvoření nového exportu</legend>'. 65 '<table><tr><td>Titulek:</td><td><input type="text" name="Title" /></td></tr>'. 66 '<tr><td colspan="2"><input type="submit" value="Vytvořit" /></td></tr>'. 67 '</table></fieldset></form>'); 68 } else echo('Nemáte oprávnění'); 69 } 70 71 function ExportCreateFinish() 72 { 73 global $Database; 74 75 if(Licence(LICENCE_USER)) 76 { 77 if(array_key_exists('Title', $_POST)) 15 78 { 16 $index = substr($parameter,0,strpos($parameter, '=')); 17 $parameter = substr($parameter,strpos($parameter, '=')+1); 18 //echo ($index.' ---- '.$parameter); 19 $_GET[$index] = $parameter; 79 $Database->SQLCommand('INSERT INTO `Export` (`Title`, `User`, `TimeCreate`) VALUES ("'.$_POST['Title'].'", '.$_SESSION['UserID'].', NOW())'); 80 $ExportId = mysql_insert_id(); 81 echo('Nový export vytvořen.<br/>Přímý odkaz na tento export: <a href="?Action=View&ExportId='.$ExportId.'">zde</a><br/><br/>'); 82 $_GET['Filter'] = 'my'; 83 ExportList(); 84 } else echo('Chybí údaje formuláře'); 85 } else echo('Nemáte oprávnění'); 86 } 87 88 function ExportDelete() 89 { 90 global $Database; 91 92 if(Licence(LICENCE_USER)) 93 { 94 if(array_key_exists('ExportId', $_GET)) 95 { 96 $Database->SQLCommand('DELETE FROM Export WHERE Id='.$_GET['ExportId']); 97 echo('Export smazán.<br/><br/>'); 98 $_GET['Filter'] = 'my'; 99 ExportList(); 100 } else echo('Nebylo zadáno Id'); 101 } else echo('Nemáte oprávnění'); 102 } 103 104 function ExportViewTranslators() 105 { 106 global $Database, $TranslationTree, $Config; 107 108 $DisabledInput = array(false => ' disabled="disabled"', true => ''); 109 if(array_key_exists('ExportId', $_GET)) 110 { 111 $DbRows = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId']); 112 if(mysql_num_rows($DbRows) > 0) 113 { 114 $Export = mysql_fetch_assoc($DbRows); 115 if(Licence(LICENCE_USER) and ($_SESSION['UserID'] == $Export['User'])) $Editable = true; 116 else $Editable = false; 117 118 119 if(array_key_exists('Operation', $_GET)) 120 { 121 if($_GET['Operation'] == 'Save') 122 { 123 //print_r($_POST); 124 // Update user selection page 125 foreach($_POST as $Index => $Value) 126 { 127 if(substr($Index, 0, 3) == 'seq') 128 { 129 $UserId = substr($Index, 3) * 1; 130 if(array_key_exists('sel'.$UserId, $_POST)) $Selected = true; 131 else $Selected = false; 132 $Condition = ' WHERE Export='.$_GET['ExportId'].' AND User='.$UserId; 133 $DbResult = $Database->SQLCommand('SELECT * FROM ExportUser '.$Condition); 134 if(mysql_num_rows($DbResult) > 0) 135 { 136 if(!$Selected) $Database->SQLCommand('DELETE FROM ExportUser '.$Condition); 137 else $Database->SQLCommand('UPDATE ExportUser SET Sequence='.$Value.$Condition); 138 } else 139 { 140 if($Selected) $Database->SQLCommand('INSERT INTO ExportUser (Export, User, Sequence) VALUES ('.$_GET['ExportId'].', '.$UserId.', '.$Value.')'); 141 } 142 } 143 } 144 145 // Recalculate sequence number 146 $Database->SQLCommand('SET @I = 0'); 147 $Database->SQLCommand('UPDATE ExportUser SET Sequence = (@I := @I + 1) WHERE Export='.$_GET['ExportId'].' ORDER BY Sequence;'); 20 148 } 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."',"; 149 } 150 151 $Columns = ''; 152 $Joins = ''; 153 foreach($TranslationTree as $Group) 154 if($Group['TablePrefix'] != '') 155 { 156 $Columns .= 'COALESCE(T'.$Group['Id'].'.Count, 0) + '; 157 $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'; 158 } 159 $Query = 'SELECT (@I := @I + 1) AS Sequence2, ExportUser.Sequence, 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'; 160 $Query .=' LEFT JOIN ExportUser ON ExportUser.Export = '.$_GET['ExportId'].' AND ExportUser.User=T.ID'; 161 $Query .=' WHERE T.TranslatedCount > 0 ORDER BY COALESCE(Sequence, 100)'; 162 163 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$Query.') AS X'); 164 $DbRow = mysql_fetch_row($DbResult); 165 $PageList = GetPageList($DbRow[0]); 166 167 $TableColumns = array( 168 array('Name' => 'user', 'Title' => 'Jméno'), 169 array('Name' => 'TranslatedCount', 'Title' => 'Překladů'), 170 array('Name' => 'XP', 'Title' => 'Úroveň'), 171 array('Name' => '', 'Title' => 'Výběr'), 172 array('Name' => 'Sequence2', 'Title' => 'Pořadí'), 173 ); 174 $Order = GetOrderTableHeader($TableColumns, 'TranslatedCount'); 175 echo('<form action="?Action=View&ExportId='.$_GET['ExportId'].'&Operation=Save" method="post">'); 176 echo('<h3>Překladatelé</h3>'); 177 echo('<input type="submit" value="Uložit výběr" '.$DisabledInput[$Editable].'/><br />'. 178 'Zvolte ze seznamu uživatele, od kterých chcete načítat překlady a upravte jejich pořadí.<br />'. 179 'Pořadí řádků je dáno číselnou hodnotou, kterou lze změnit na požadované pořadí. Řádky se stejným pořadovým číslem budou přečíslovány vzestupně.'); 180 181 echo($PageList['Output']); 182 echo('<table class="BaseTable">'); 183 echo($Order['Output']); 184 185 $Query = 'SELECT * FROM ('.$Query.') AS TX '.$Order['SQL'].$PageList['SQLLimit']; 186 $Database->SQLCommand('SET @I = 0'); 187 $DbResult = $Database->SQLCommand($Query); 188 while($User = mysql_fetch_assoc($DbResult)) 189 { 190 $Checked = $User['Sequence'] != ''; 191 $Selection = CheckBox('sel'.$User['ID'], $Checked, '', 'CheckBox', !$Editable); 192 $Sequence = '<input type="text" name="seq'.$User['ID'].'" style="text-align: center; width: 40px;" value="'.$User['Sequence2'].'"'.$DisabledInput[$Editable].'/>'; 193 echo('<tr> 194 <td><a href="'.$Config['Web']['BaseURL'].'/TranslationList.php?user='.$User['ID'].'&action=userall" title="Zobrazit všechny jeho přeložené texty">'.$User['user'].'</a></td> 195 <td>'.$User['TranslatedCount'].'</td> 196 <td><img src="'.$Config['Web']['TempFolder'].$User['user'].'/level.png" alt="Úroveň uživatele" /></td> 197 <td>'.$Selection.'</td><td>'.$Sequence.'</td></tr>'); 198 } 199 echo('</table>'); 200 echo('</form>'); 201 echo($PageList['Output']); 202 } else echo('Položka nenalezena'); 203 } else echo('Nebylo zadáno Id'); 204 } 205 206 function ExportViewGeneral() 207 { 208 global $Database; 209 210 $DisabledInput = array(false => ' disabled="disabled"', true => ''); 211 $DisabledTextArea = array(false => ' readonly="yes"', true => ''); 212 echo('<h3>Obecná nastavení</h3>'); 213 if(array_key_exists('ExportId', $_GET)) 214 { 215 $DbRows = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId']); 216 if(mysql_num_rows($DbRows) > 0) 217 { 218 $Export = mysql_fetch_assoc($DbRows); 219 if(Licence(LICENCE_USER) and ($_SESSION['UserID'] == $Export['User'])) $Editable = true; 220 else $Editable = false; 221 if($Export['WithDiacritic'] == 1) $WithDiacritic = ' checked="checked"'; else $WithDiacritic = ''; 222 echo('<form action="?Action=ModifyFinish&ExportId='.$Export['Id'].'" method="post">'. 223 '<table>'. 224 '<tr><td colspan="2"><input type="submit" value="Uložit" '.$DisabledInput[$Editable].'/></td></tr>'. 225 '<tr><td>Označení:</td><td><input type="text" style="width: 400px" name="Title" value="'.$Export['Title'].'"'.$DisabledInput[$Editable].'/></td></tr>'. 226 '<tr><td>Popis:</td><td><textarea name="Description" cols="54" rows="10"'.$DisabledTextArea[$Editable].'></textarea></td></tr>'. 227 '<tr><td>Včetně háčků a čárek</td><td><input type="checkbox" name="WithDiacritic" '.$WithDiacritic.''.$DisabledInput[$Editable].'/></td></tr>'. 228 '</table></fieldset></form>'); 229 } else echo('Položka nenalezena'); 230 } else echo('Nebylo zadáno Id'); 231 } 232 233 function ExportViewLanguages() 234 { 235 global $Database, $TranslationTree, $Config; 236 237 $DisabledInput = array(false => ' disabled="disabled"', true => ''); 238 if(array_key_exists('ExportId', $_GET)) 239 { 240 $DbRows = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId']); 241 if(mysql_num_rows($DbRows) > 0) 242 { 243 $Export = mysql_fetch_assoc($DbRows); 244 if(Licence(LICENCE_USER) and ($_SESSION['UserID'] == $Export['User'])) $Editable = true; 245 else $Editable = false; 246 247 if(array_key_exists('Operation', $_GET)) 248 { 249 if($_GET['Operation'] == 'Save') 250 { 251 //print_r($_POST); 252 // Update user selection page 253 foreach($_POST as $Index => $Value) 254 { 255 if(substr($Index, 0, 3) == 'seq') 256 { 257 $LanguageId = substr($Index, 3) * 1; 258 if(array_key_exists('sel'.$LanguageId, $_POST)) $Selected = true; 259 else $Selected = false; 260 $Condition = ' WHERE Export='.$_GET['ExportId'].' AND Language='.$LanguageId; 261 $DbResult = $Database->SQLCommand('SELECT * FROM ExportLanguage '.$Condition); 262 if(mysql_num_rows($DbResult) > 0) 263 { 264 if(!$Selected) $Database->SQLCommand('DELETE FROM ExportLanguage '.$Condition); 265 else $Database->SQLCommand('UPDATE ExportLanguage SET Sequence='.$Value.$Condition); 266 } else 267 { 268 if($Selected) $Database->SQLCommand('INSERT INTO ExportLanguage (Export, Language, Sequence) VALUES ('.$_GET['ExportId'].', '.$LanguageId.', '.$Value.')'); 269 } 270 } 75 271 } 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)) 272 273 // Recalculate sequence number 274 $Database->SQLCommand('SET @I = 0'); 275 $Database->SQLCommand('UPDATE ExportLanguage SET Sequence = (@I := @I + 1) WHERE Export='.$_GET['ExportId'].' ORDER BY Sequence;'); 276 } 277 } 278 279 $Query = 'SELECT (@I := @I + 1) AS Sequence2, Sequence, language.Id, Name FROM language'; 280 $Query .=' LEFT JOIN ExportLanguage ON ExportLanguage.Export = '.$_GET['ExportId'].' AND ExportLanguage.Language=language.Id'; 281 $Query .=' WHERE language.Enabled = 1 ORDER BY COALESCE(Sequence, 100)'; 282 283 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$Query.') AS X'); 284 $DbRow = mysql_fetch_row($DbResult); 285 $PageList = GetPageList($DbRow[0]); 286 287 $TableColumns = array( 288 array('Name' => 'Name', 'Title' => 'Název'), 289 array('Name' => '', 'Title' => 'Výběr'), 290 array('Name' => 'Sequence2', 'Title' => 'Pořadí'), 291 ); 292 $Order = GetOrderTableHeader($TableColumns, 'Name'); 293 echo('<form action="?Action=View&ExportId='.$_GET['ExportId'].'&Operation=Save" method="post">'); 294 echo('<h3>Jazyky</h3>'); 295 echo('<input type="submit" value="Uložit výběr" '.$DisabledInput[$Editable].'/><br />'. 296 'Zvolte ze seznamu dostupných jazyků, ze kterých chcete sestavit překlady a upravte jejich pořadí.<br />'. 297 'Pořadí řádků je dáno číselnou hodnotou, kterou lze změnit na požadované pořadí. Řádky se stejným pořadovým číslem budou přečíslovány vzestupně.'); 298 299 echo($PageList['Output']); 300 echo('<table class="BaseTable">'); 301 echo($Order['Output']); 302 303 $Query = 'SELECT * FROM ('.$Query.') AS TX '.$Order['SQL'].$PageList['SQLLimit']; 304 $Database->SQLCommand('SET @I = 0'); 305 $DbResult = $Database->SQLCommand($Query); 306 while($Langugage = mysql_fetch_assoc($DbResult)) 307 { 308 $Checked = $Langugage['Sequence'] != ''; 309 $Selection = CheckBox('sel'.$Langugage['Id'], $Checked, '', 'CheckBox', !$Editable); 310 $Sequence = '<input type="text" name="seq'.$Langugage['Id'].'" style="text-align: center; width: 40px;" value="'.$Langugage['Sequence2'].'"'.$DisabledInput[$Editable].'/>'; 311 echo('<tr> 312 <td>'.$Langugage['Name'].'</a></td> 313 <td>'.$Selection.'</td><td>'.$Sequence.'</td></tr>'); 314 } 315 echo('</table>'); 316 echo('</form>'); 317 echo($PageList['Output']); 318 } else echo('Položka nenalezena'); 319 } else echo('Nebylo zadáno Id'); 320 } 321 322 function ExportViewGroups() 323 { 324 global $Database, $TranslationTree, $Config; 325 326 $DisabledInput = array(false => ' disabled="disabled"', true => ''); 327 if(array_key_exists('ExportId', $_GET)) 328 { 329 $DbRows = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId']); 330 if(mysql_num_rows($DbRows) > 0) 331 { 332 $Export = mysql_fetch_assoc($DbRows); 333 if(Licence(LICENCE_USER) and ($_SESSION['UserID'] == $Export['User'])) $Editable = true; 334 else $Editable = false; 335 336 if(array_key_exists('Operation', $_GET)) 337 { 338 if($_GET['Operation'] == 'Save') 339 { 340 //print_r($_POST); 341 // Update user selection page 342 foreach($_POST as $Index => $Value) 109 343 { 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) 344 if(substr($Index, 0, 3) == 'seq') 121 345 { 122 if(($Group['LuaFileName'] != '') and ($Group['TablePrefix'] != '')) 346 $GroupId = substr($Index, 3) * 1; 347 if(array_key_exists('sel'.$GroupId, $_POST)) $Selected = true; 348 else $Selected = false; 349 $Condition = ' WHERE `Export`='.$_GET['ExportId'].' AND `Group`='.$GroupId; 350 $DbResult = $Database->SQLCommand('SELECT * FROM `ExportGroup` '.$Condition); 351 if(mysql_num_rows($DbResult) > 0) 123 352 { 124 if ((file_exists('../source/'.$dir.'/lua/'.$Group['LuaFileName'].'.lua') == false)) 125 $ok = false; 353 if(!$Selected) $Database->SQLCommand('DELETE FROM `ExportGroup` '.$Condition); 354 } else 355 { 356 if($Selected) $Database->SQLCommand('INSERT INTO `ExportGroup` (`Export`, `Group`) VALUES ('.$_GET['ExportId'].', '.$GroupId.')'); 357 } 358 } 126 359 } 127 360 } 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']); 361 } 362 363 $Query = 'SELECT `group`.*, `ExportGroup`.`Id` AS `ExportGroupId` FROM `group` LEFT JOIN `ExportGroup` ON `ExportGroup`.`Export`='.$_GET['ExportId'].' AND `Group`=`group`.`Id`'; 364 365 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$Query.') AS X'); 366 $DbRow = mysql_fetch_row($DbResult); 367 $PageList = GetPageList($DbRow[0]); 368 369 $TableColumns = array( 370 array('Name' => 'Name', 'Title' => 'Jméno'), 371 array('Name' => 'MangosTable', 'Title' => 'Tabulka MaNGOSu'), 372 array('Name' => 'DBCFileName', 'Title' => 'DBC soubor'), 373 array('Name' => 'LuaFileName', 'Title' => 'Lua soubor'), 374 array('Name' => '', 'Title' => 'Výběr'), 375 ); 376 $Order = GetOrderTableHeader($TableColumns, 'Name'); 377 echo('<form action="?Action=View&ExportId='.$_GET['ExportId'].'&Operation=Save" method="post">'); 378 echo('<h3>Překladové skupiny</h3>'); 379 echo('<input type="submit" value="Uložit výběr" '.$DisabledInput[$Editable].'/><br />'. 380 'Zvolte ze překladových skupin, ze kterých chcete načítat překlady.<br />'); 381 382 echo($PageList['Output']); 383 echo('<table class="BaseTable">'); 384 echo($Order['Output']); 385 386 $Query = 'SELECT * FROM ('.$Query.') AS TX '.$Order['SQL'].$PageList['SQLLimit']; 387 $DbResult = $Database->SQLCommand($Query); 388 while($Group = mysql_fetch_assoc($DbResult)) 389 { 390 $Checked = $Group['ExportGroupId'] != ''; 391 $Selection = CheckBox('sel'.$Group['Id'], $Checked, '', 'CheckBox', !$Editable); 392 echo('<tr>'. 393 '<td>'.$Group['Name'].'</td>'. 394 '<td>'.$Group['MangosTable'].'</td>'. 395 '<td>'.$Group['DBCFileName'].'</td>'. 396 '<td>'.$Group['LuaFileName'].'</td>'. 397 '<td>'.$Selection.'<input type="hidden" name="seq'.$Group['Id'].'"/></td></tr>'); 398 } 399 echo('</table>'); 400 echo('</form>'); 401 echo($PageList['Output']); 402 } else echo('Položka nenalezena'); 403 } else echo('Nebylo zadáno Id'); 404 } 405 406 function ExportViewOutputFormat() 407 { 408 global $Database; 409 410 $DisabledInput = array(false => ' disabled="disabled"', true => ''); 411 if(array_key_exists('ExportId', $_GET)) 412 { 413 $DbRows = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId']); 414 if(mysql_num_rows($DbRows) > 0) 415 { 416 $Export = mysql_fetch_assoc($DbRows); 417 if(Licence(LICENCE_USER) and ($_SESSION['UserID'] == $Export['User'])) $Editable = true; 418 else $Editable = false; 419 420 if(array_key_exists('OutputType', $_POST)) 421 { 422 $Database->SQLCommand('UPDATE Export SET OutputType='.$_POST['OutputType'].' WHERE Id='.$_GET['ExportId']); 423 } 424 425 $DbResult = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId']); 426 $Export = mysql_fetch_assoc($DbResult); 427 428 echo('<h3>Formát generovaného výstupu</h3>'); 429 echo('<form action="?Action=View&ExportId='.$_GET['ExportId'].'&Operation=Save" method="post">'); 430 echo('<input type="submit" value="Uložit" '.$DisabledInput[$Editable].'/><br/>'); 431 $DbResult = $Database->SQLCommand('SELECT * FROM ExportOutputType ORDER BY Name'); 432 while($ExportFormat = mysql_fetch_assoc($DbResult)) 433 { 434 echo(RadioButton('OutputType', $ExportFormat['Id'], $Export['OutputType'] == $ExportFormat['Id'], '', !$Editable).' '.$ExportFormat['Name'].'<br/>'); 435 } 436 echo('</form>'); 437 } else echo('Položka nenalezena'); 438 } else echo('Nebylo zadáno Id'); 439 } 440 441 function ExportViewVersion() 442 { 443 global $Database, $Config; 444 445 $DisabledInput = array(false => ' disabled="disabled"', true => ''); 446 if(array_key_exists('ExportId', $_GET)) 447 { 448 $DbRows = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId']); 449 if(mysql_num_rows($DbRows) > 0) 450 { 451 $Export = mysql_fetch_assoc($DbRows); 452 if(Licence(LICENCE_USER) and ($_SESSION['UserID'] == $Export['User'])) $Editable = true; 453 else $Editable = false; 268 454 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(); 455 if(array_key_exists('ClientVersion', $_POST)) 456 { 457 $Database->SQLCommand('UPDATE Export SET ClientVersion='.$_POST['ClientVersion'].' WHERE Id='.$_GET['ExportId']); 458 } 459 460 $DbResult = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId']); 461 $Export = mysql_fetch_assoc($DbResult); 462 463 $Query = 'SELECT wow_client_version.* FROM ExportVersion LEFT JOIN wow_client_version ON wow_client_version.Id=ExportVersion.ClientVersion WHERE ExportType='.$Export['OutputType']; 464 465 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$Query.') AS X'); 466 $DbRow = mysql_fetch_row($DbResult); 467 $PageList = GetPageList($DbRow[0]); 468 469 $TableColumns = array( 470 array('Name' => 'Version', 'Title' => 'Verze'), 471 array('Name' => 'BuildNumber', 'Title' => 'Sestavení'), 472 array('Name' => 'ReleaseDate', 'Title' => 'Datum uvolnění'), 473 array('Name' => 'Title', 'Title' => 'Titutek'), 474 array('Name' => '', 'Title' => 'Výběr'), 475 ); 476 $Order = GetOrderTableHeader($TableColumns, 'BuildNumber'); 477 echo('<form action="?Action=View&ExportId='.$_GET['ExportId'].'" method="post">'); 478 echo('<h3>Verze klienta</h3>'); 479 480 echo('<input type="submit" value="Uložit výběr" '.$DisabledInput[$Editable].'/><br /> 481 Vyberte pro jakou verzi herního klienta se budou texty exportovat.<br />'); 482 echo($PageList['Output']); 483 echo('<table class="BaseTable">'); 484 echo($Order['Output']); 485 486 $Query = 'SELECT * FROM ('.$Query.') AS TX '.$Order['SQL'].$PageList['SQLLimit']; 487 $DbResult = $Database->SQLCommand($Query); 488 while($Version = mysql_fetch_assoc($DbResult)) 489 { 490 echo('<tr><td><a href="http://www.wowwiki.com/Patch_'.$Version['Version'].'">'.$Version['Version'].'</a></td><td>'.$Version['BuildNumber'].'</td><td>'.HumanDate($Version['ReleaseDate']).'</td><td>'.$Version['Title'].'</td><td>'.RadioButton('ClientVersion', $Version['Id'], $Export['ClientVersion'] == $Version['Id'], '', !$Editable 491 ).'</td></tr>'); 492 493 } 494 echo('</table>'); 495 echo('</form>'); 496 echo($PageList['Output']); 497 } else echo('Položka nenalezena'); 498 } else echo('Nebylo zadáno Id'); 499 } 500 501 function ExportViewOutput() 502 { 503 global $Database; 504 505 $DbResult = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId']); 506 $Export = mysql_fetch_assoc($DbResult); 507 ExportOutput($Export['Id'], $Export['OutputType']); 508 } 509 510 function ExportView() 511 { 512 global $Database; 513 514 $DbResult = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId']); 515 $Export = mysql_fetch_assoc($DbResult); 516 $DbResult = $Database->SQLCommand('SELECT * FROM user WHERE ID='.$Export['User']); 517 $User = mysql_fetch_assoc($DbResult); 518 echo('Export <strong><a href="?Action=View&Tab=6&ExportId='.$Export['Id'].'">'.$_GET['ExportId'].'</a></strong> překladatele <strong>'.$User['user'].'</strong> s označením <strong>'.$Export['Title'].'</strong>'); 519 ShowTabs(array('Obecné', 'Překladatelé', 'Překlady', 'Jazyky', 'Formát', 'Verze', 'Výstup')); 520 echo('<div id="content">'); 521 if($_SESSION['Tab'] == 0) ExportViewGeneral(); 522 else if($_SESSION['Tab'] == 1) ExportViewTranslators(); 523 else if($_SESSION['Tab'] == 2) ExportViewGroups(); 524 else if($_SESSION['Tab'] == 3) ExportViewLanguages(); 525 else if($_SESSION['Tab'] == 4) ExportViewOutputFormat(); 526 else if($_SESSION['Tab'] == 5) ExportViewVersion(); 527 else if($_SESSION['Tab'] == 6) ExportViewOutput(); 528 529 echo('</div>'); 530 } 531 532 ShowPage(); 533 534 if(array_key_exists('Action', $_GET)) 535 { 536 if($_GET['Action'] == 'Create') ExportCreate(); 537 else if($_GET['Action'] == 'CreateFinish') ExportCreateFinish(); 538 else if($_GET['Action'] == 'View') ExportView(); 539 else if($_GET['Action'] == 'Delete') ExportDelete(); 540 else ExportList(); 541 } else ExportList(); 542 543 ShowFooter(); 544 652 545 ?> -
trunk/includes/error.php
r289 r290 37 37 { 38 38 //print_r($Item); 39 if(array_key_exists('line', $Item)) 40 $Error .= ' '.$Item['file'].'('.$Item['line'].")\t".$Item['function']; 41 else $Error .= ' '.$Item['file']."\t".$Item['function']; 39 if(!array_key_exists('line', $Item)) $Item['line'] = ''; 40 if(!array_key_exists('file', $Item)) $Item['file'] = ''; 41 if(!array_key_exists('function', $Item)) $Item['function'] = ''; 42 $Error .= ' '.$Item['file'].'('.$Item['line'].")\t".$Item['function']; 42 43 $Arguments = ''; 43 44 if(array_key_exists('args', $Item) and is_array($Item['args'])) -
trunk/includes/global.php
r289 r290 19 19 include('global_function.php'); 20 20 include('rss.php'); 21 include_once('system.php'); 21 22 22 23 $Database = new Database($Config['Database']['Host'], $Config['Database']['User'], $Config['Database']['Password']); … … 26 27 $TranslationTree = GetTranslationTree(); 27 28 $LanguageList = GetLanguageList(); 29 30 $System = new System(); 31 $System->Init(); 28 32 29 33 function GetMicrotime() … … 96 100 $Config['Web']['BaseURL'].'index.php' => array(LICENCE_ANONYMOUS, 'Hlavní stránka', 'Domů'), 97 101 'http://wow.zdechov.net/forum/viewforum.php?f=22' => array(LICENCE_ANONYMOUS, 'Diskuze na téma překládání', 'Fórum projektu'), 98 $Config['Web']['BaseURL'].'dictionary.php' => array(LICENCE_ANONYMOUS, 'Slovník WoW výrazů', 'Slovník'), 99 $Config['Web']['BaseURL'].'banners.php' => array(LICENCE_ANONYMOUS, 'Weby odkazující na tento projekt bennerem', 'Odkazují na nás'), 102 $Config['Web']['BaseURL'].'dictionary.php' => array(LICENCE_ANONYMOUS, 'Slovník WoW výrazů', 'Slovníček'), 100 103 $Config['Web']['BaseURL'].'statistic.php' => array(LICENCE_ANONYMOUS, 'Stav dokončení překládů', 'Stav dokončení'), 101 104 $Config['Web']['BaseURL'].'userlist.php?action=nofilter' => array(LICENCE_ANONYMOUS, 'Seznam registrovaných uživatelů', 'Překladatelé'), 102 105 $Config['Web']['BaseURL'].'team.php?search=' => array(LICENCE_ANONYMOUS, 'Seznam překladatelských týmů', 'Týmy'), 103 $Config['Web']['BaseURL'].'download.php' => array(LICENCE_ANONYMOUS, 'Zde si můžete stáhnout přeložené texty', 'Stahování'), 106 $Config['Web']['BaseURL'].'export/' => array(LICENCE_ANONYMOUS, 'Zde si můžete stáhnout přeložené texty', 'Exporty'), 107 $Config['Web']['BaseURL'].'download.php' => array(LICENCE_ANONYMOUS, 'Stahování různých pomocných souborů a programů', 'Soubory'), 104 108 $Config['Web']['BaseURL'].'info.php' => array(LICENCE_ANONYMOUS, 'Informace k překladu hry', 'Informace'), 105 109 $Config['Web']['BaseURL'].'registrace.php' => array(LICENCE_ANONYMOUS, 'Registrace uživatele pro překládání', 'Registrace'), 106 110 $Config['Web']['BaseURL'].'TranslationList.php?action=grouplist' => array(LICENCE_ANONYMOUS, 'Informace o překladových skupinách', 'Zdroje dat'), 111 $Config['Web']['BaseURL'].'banners.php' => array(LICENCE_ANONYMOUS, 'Informace k propagaci tohoto projektu', 'Propagace'), 107 112 $Config['Web']['BaseURL'].'version.php' => array(LICENCE_ANONYMOUS, 'Seznam verzí herního klienta', 'Verze hry'), 108 113 $Config['Web']['BaseURL'].'aowow' => array(LICENCE_ANONYMOUS, 'Vyhledávací databáze podobná WoWHead s překlady', 'AoWoW'), … … 175 180 if(Licence(LICENCE_MODERATOR)) $Name = '<a href="user.php?user='.$Line['ID'].'">'.$Line['user'].'</a>'; 176 181 else $Name = $Line['user']; 177 if($Line['GM'] <> 0) $TextGM = '<small>('.$Moderators[$Line['GM']].')</small>'; 178 else $TextGM = ''; 182 //if($Line['GM'] <> 0) $TextGM = '<small>('.$Moderators[$Line['GM']].')</small>'; 183 //else 184 $TextGM = ''; 179 185 echo('<strong>'.$Name.'</strong>'.$TextGM.'<br />'); 180 186 } -
trunk/includes/global_function.php
r289 r290 62 62 if($PagesMin < ($CurrentPage - $Around)) 63 63 { 64 $Result.= ' .. ';64 $Result.= ' ... '; 65 65 $PagesMin = $CurrentPage - $Around; 66 66 } … … 73 73 } 74 74 } 75 if($PagesMax < ($PageCount - 1)) $Result .= ' .. ';75 if($PagesMax < ($PageCount - 1)) $Result .= ' ... '; 76 76 if($CurrentPage < ($PageCount - 1)) 77 77 { … … 374 374 } 375 375 376 377 376 function GetBuildNumber($Version) 378 377 { … … 459 458 } 460 459 460 function LoadCommandLineParameters() 461 { 462 if(!array_key_exists('REMOTE_ADDR', $_SERVER)) 463 { 464 foreach($_SERVER['argv'] as $Parameter) 465 { 466 if(strpos($Parameter, '=') !== false) 467 { 468 $Index = substr($Parameter, 0, strpos($Parameter, '=')); 469 $Parameter = substr($Parameter, strpos($Parameter, '=') + 1); 470 //echo($Index.' ---- '.$Parameter); 471 $_GET[$Index] = $Parameter; 472 } 473 } 474 } 475 } 476 477 function ShowTabs($Tabs) 478 { 479 $QueryItems = GetQueryStringArray($_SERVER['QUERY_STRING']); 480 481 if(array_key_exists('Tab', $_GET)) $_SESSION['Tab'] = $_GET['Tab']; 482 if(!array_key_exists('Tab', $_SESSION)) $_SESSION['Tab'] = 0; 483 if(($_SESSION['Tab'] < 0) or ($_SESSION['Tab'] > (count($Tabs) - 1))) $_SESSION['Tab'] = 0; 484 echo('<div id="header">'); 485 echo('<ul>'); 486 foreach($Tabs as $Index => $Tab) 487 { 488 $QueryItems['Tab'] = $Index; 489 if($Index == $_SESSION['Tab']) $Selected = ' id="selected"'; 490 else $Selected = ''; 491 echo('<li'.$Selected.'><a href="?'.SetQueryStringArray($QueryItems).'">'.$Tab.'</a></li>'); 492 } 493 echo('</ul></div>'); 494 } 495 496 function CheckBox($Name, $Checked = false, $Id = '', $Class = '', $Disabled = false) 497 { 498 if($Id) $Id = ' id="'.$Id.'"'; else $Id = ''; 499 if($Class) $Class = ' class="'.$Class.'"'; else $Class = ''; 500 if($Checked) $Checked = ' checked="checked"'; else $Checked = ''; 501 if($Disabled) $Disabled = ' disabled="disabled"'; else $Disabled = ''; 502 return('<input type="checkbox" value="checked" name="'.$Name.'"'.$Checked.$Disabled.$Id.$Class.' />'); 503 } 504 505 function RadioButton($Name, $Value, $Checked = false, $OnClick = '', $Disabled = false) 506 { 507 if($Checked) $Checked = ' checked="checked"'; else $Checked = ''; 508 if($OnClick != '') $OnClick = ' onclick="'.$OnClick.'"'; else $OnClick = ''; 509 if($Disabled) $Disabled = ' disabled="disabled"'; else $Disabled = ''; 510 return('<input type="radio" name="'.$Name.'" value="'.$Value.'"'.$Checked.$Disabled.$OnClick.'/>'); 511 } 512 513 function SelectOption($Name, $Text, $Selected = false) 514 { 515 if($Selected) $Selected = ' selected="selected"'; else $Selected = ''; 516 return('<option value="'.$Name.'"'.$Selected.'>'.$Text.'</option>'); 517 } 518 519 461 520 ?> -
trunk/index.php
r282 r290 116 116 ); 117 117 ShowPage(); 118 $Banner = '<a href="'.$Config['Web']['BaseURL'].'"><img src="'.$Config['Web']['BaseURL'].'banners/baner_468_60.jpg" '.119 'alt="baner_'.$Config['Web']['BaseURL'].'" title="Otevřený projekt překládání celé hry World of Warcraft" '.120 'class="banner" height="60" width="468" /></a>';121 122 $BannerSmall = '<a href="'.$Config['Web']['BaseURL'].'"><img src="'.$Config['Web']['BaseURL'].'banners/baner_88_31.jpg" '.123 'alt="baner_'.$Config['Web']['BaseURL'].'" title="Otevřený projekt překládání celé hry World of Warcraft" '.124 'class="banner" height="31" width="88" /></a>';125 126 echo('<strong>Bannery:</strong><br />');127 128 echo($Banner.' <textarea rows="2" cols="30">'.htmlspecialchars($Banner).'</textarea><br />');129 echo($BannerSmall.' <textarea rows="2" cols="30">'.htmlspecialchars($BannerSmall).'</textarea><br />');130 118 131 119 echo('<br />'. -
trunk/style/style.css
r286 r290 3 3 font-size: 14px; 4 4 font-family: Verdana, Arial, SunSans-Regular, Sans-Serif; 5 color: # 564b47;5 color: #362b27; 6 6 padding: 0px; 7 7 margin: 0px; … … 21 21 a:visited 22 22 { 23 color: #c43300;23 color: #c43300; 24 24 } 25 25 26 26 a:hover 27 27 { 28 color: #c 43300;28 color: #c3300; 29 29 } 30 30 … … 345 345 text-align: center; 346 346 } 347 348 #header ul 349 { 350 list-style: none; 351 padding: 0; 352 margin: 0; 353 } 354 355 #header li 356 { 357 float: left; 358 border: 1px solid #bbb; 359 border-bottom-width: 0; 360 margin: 0; 361 } 362 363 #header a 364 { 365 text-decoration: none; 366 display: block; 367 background: #eee; 368 padding: 0.24em 1em; 369 color: #c00; 370 text-align: center; 371 } 372 373 #header a:hover 374 { 375 background: #fdd; 376 } 377 378 #header #selected 379 { 380 border-color: black; 381 } 382 383 #header #selected a 384 { 385 position: relative; 386 top: 1px; 387 background: white; 388 color: black; 389 font-weight: bold; 390 } 391 392 #content 393 { 394 border: 1px solid black; 395 clear: both; 396 padding: 5px; 397 } 398 -
trunk/user.php
r127 r290 25 25 26 26 if(array_key_exists('user', $_GET) and Licence(LICENCE_MODERATOR)) 27 { 28 27 { 29 28 $Query = 'SELECT *, ('; 30 29 foreach($TranslationTree as $Group) 31 30 if($Group['TablePrefix'] != '') 32 31 $Query .= '(SELECT count(*) FROM `'.$Group['TablePrefix'].'` WHERE User = '.$_GET['user'].' AND User <> 0 AND Complete = 1) + '; 33 32 $Query .= '0) as NumberTranslate FROM `user` WHERE ID = '.$_GET['user']; 34 33 $LineUser = mysql_fetch_array($Database->SQLCommand($Query)); … … 36 35 echo('ID: <strong>'.$_GET['user'].'</strong><br />'); 37 36 echo('Jméno: <strong>'.$LineUser['user'].'</strong><br />'); 38 echo('Výchozí jazyk: <strong>'.$L ineUser['Language'].'</strong><br />');37 echo('Výchozí jazyk: <strong>'.$LanguageList[$LineUser['Language']]['Name'].'</strong><br />'); 39 38 echo('Poslední připojení: <strong>'.$LineUser['LastLogin'].'</strong><br />'); 40 39 echo('Poslední IP: <strong>'.$LineUser['LastIP'].'</strong><br />');
Note:
See TracChangeset
for help on using the changeset viewer.