- Timestamp:
- Apr 13, 2010, 10:03:12 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Options.php
r376 r455 17 17 if($NewPass == $NewPass2) 18 18 { 19 $DbResult = $ Database->SQLCommand('SELECT `Pass`, '.$User->CryptPasswordSQL('"'.$OldPass.'"', '`Salt`').' AS `Hash` FROM `User` WHERE `ID`= '.$User->Id);20 $DbRow = mysql_fetch_assoc($DbResult);19 $DbResult = $System->Database->query('SELECT `Pass`, '.$User->CryptPasswordSQL('"'.$OldPass.'"', '`Salt`').' AS `Hash` FROM `User` WHERE `ID`= '.$User->Id); 20 $DbRow = $DbResult->fetch_assoc(); 21 21 if($DbRow['Hash'] == $DbRow['Pass']) 22 22 { 23 23 // Update password 24 24 $Salt = $User->GetPasswordSalt(); 25 $ Database->SQLCommand('UPDATE `User` SET `Pass` = '.$User->CryptPasswordSQL('"'.$NewPass.'"', '"'.$Salt.'"').', `Salt`="'.$Salt.'" WHERE `ID` = '.$User->Id);25 $System->Database->query('UPDATE `User` SET `Pass` = '.$User->CryptPasswordSQL('"'.$NewPass.'"', '"'.$Salt.'"').', `Salt`="'.$Salt.'" WHERE `ID` = '.$User->Id); 26 26 echo('Heslo změněno!<br />'); 27 27 } else echo('<br />Staré heslo neodpovídá!<br />'); 28 28 } else echo('<br />Hesla se neshodují!<br />'); 29 29 30 $ Database->SQLCommand('UPDATE `User` SET `Email` = "'.$Email.'", `Language` = "'.$Language.'", `Redirecting` = "'.$Redirecting.'" WHERE `ID` = '.$User->Id);30 $System->Database->query('UPDATE `User` SET `Email` = "'.$Email.'", `Language` = "'.$Language.'", `Redirecting` = "'.$Redirecting.'" WHERE `ID` = '.$User->Id); 31 31 echo('Úprava nastavení proběhla v pořádku, Email: <b>'.$Email.'</b> Uživatel: <b>'.$User->Name.'</b><br />'); 32 32 WriteLog('Úprava nastavení!', LOG_TYPE_USER); … … 84 84 85 85 echo(' <fieldset><legend>Překladatelský tým</legend>'); 86 $ ID = $Database->SQLCommand('SELECT * FROM `Team`');86 $DbResult = $System->Database->query('SELECT * FROM `Team`'); 87 87 echo('<a href="team.php?action=create">Vytvořit tým</a><br />'. 88 88 '<a href="team.php?action=leave">Opustit tým</a><br />'. … … 90 90 '<input type="hidden" name="action" value="gointeam"/>'. 91 91 '<select name="id">'); 92 while($LineTeam = mysql_fetch_assoc($ID))92 while($LineTeam = $DbResult->fetch_assoc()) 93 93 { 94 94 echo('<option value="'.$LineTeam['Id'].'"'); -
trunk/TranslationList.php
r446 r455 249 249 function ShowGroupTypeList() 250 250 { 251 global $ Database, $User;252 253 $DbResult = $ Database->SQLCommand('SELECT COUNT(*) FROM `Group`');254 $DbRow = mysql_fetch_row($DbResult);251 global $System, $User; 252 253 $DbResult = $System->Database->query('SELECT COUNT(*) FROM `Group`'); 254 $DbRow = $DbResult->fetch_row(); 255 255 $PageList = GetPageList($DbRow[0]); 256 256 echo('<h3>Seznam překladových skupin</h3>'); … … 269 269 echo($Order['Output']); 270 270 271 $ ID = $Database->SQLCommand('SELECT * FROM `Group`'.$Order['SQL'].$PageList['SQLLimit']);272 while($Group = mysql_fetch_assoc($ID))271 $DbResult = $System->Database->query('SELECT * FROM `Group`'.$Order['SQL'].$PageList['SQLLimit']); 272 while($Group = $DbResult->fetch_assoc()) 273 273 { 274 274 echo('<tr><td><a href="?group='.$Group['Id'].'&action=filter">'.$Group['Name'].'</a></td><td>'.$Group['SourceType'].'</td><td>'); … … 285 285 function ShowMenu() 286 286 { 287 global $ Database, $User, $TranslationTree;287 global $User, $TranslationTree; 288 288 289 289 $GroupId = GetParameter('group', 0, true); -
trunk/action.php
r436 r455 5 5 function Search() 6 6 { 7 global $ Database, $TranslationTree;7 global $System, $TranslationTree; 8 8 9 9 if(array_key_exists('search', $_GET)) $Search = $_GET['search']; … … 22 22 if($Item['Column'] != '') $sql .= ' OR `'.$Item['Column'].'` LIKE "%'.$Search.'%"'; 23 23 } 24 $Line = mysql_fetch_row($Database->SQLCommand($sql)); 24 $DbResult = $System->Database->query($sql); 25 $Line = $DbResult->fetch_row(); 25 26 echo('<tr><td><a href="TranslationList.php?group='.$Group['Id'].'&user=0&state=0&text='.$Search.'&entry=">'.$Group['Name'].'</a></td><td>'.$Line[0].'</td></tr>'); 26 27 } 27 28 28 $Line = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM `User` WHERE `Name` LIKE "%'.$Search.'%"')); 29 $DbResult = $System->Database->query('SELECT count(*) FROM `User` WHERE `Name` LIKE "%'.$Search.'%"'); 30 $Line = $DbResult->fetch_row(); 29 31 echo('<tr><td><a href="userlist.php?search='.$Search.'">Uživatelé</a></td><td>'.$Line[0].'</td></tr>'); 30 $Line = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM `Team` WHERE `Name` LIKE "%'.$Search.'%" OR `Description` LIKE "%'.$Search.'%"')); 32 33 $DbResult = $System->Database->query('SELECT count(*) FROM `Team` WHERE `Name` LIKE "%'.$Search.'%" OR `Description` LIKE "%'.$Search.'%"'); 34 $Line = $DbResult->fetch_row(); 31 35 echo('<tr><td><a href="team.php?search='.$Search.'">Týmy</a></td><td>'.$Line[0].'</td></tr>'); 32 $Line = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM `CzWoWPackageVersion` WHERE `Text` LIKE "%'.$Search.'%"')); 36 37 $DbResult = $System->Database->query('SELECT count(*) FROM `CzWoWPackageVersion` WHERE `Text` LIKE "%'.$Search.'%"'); 38 $Line = $DbResult->fetch_row(); 33 39 echo('<tr><td><a href="download.php?addon">Čeština pro klienta</a></td><td>'.$Line[0].'</td></tr>'); 34 40 echo('<tr><td><a href="aowow/?search='.$Search.'">Vyhledávací databáze AoWoW</a></td></tr>'); 35 $Line = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM `Dictionary` WHERE (`Text` LIKE "%'.$Search.'%" OR `Description` LIKE "%'.$Search.'%") AND `Language` = 0')); 41 42 $DbResult = $System->Database->query('SELECT count(*) FROM `Dictionary` WHERE (`Text` LIKE "%'.$Search.'%" OR `Description` LIKE "%'.$Search.'%") AND `Language` = 0'); 43 $Line = $DbResult->fetch_row(); 36 44 echo('<tr><td><a href="dictionary.php?search='.$Search.'">Slovníček</a></td><td>'.$Line[0].'</td></tr>'); 37 45 … … 41 49 function DatabaseKit() 42 50 { 43 global $ Database, $TranslationTree, $User;51 global $System, $TranslationTree, $User; 44 52 45 53 if($User->Licence(LICENCE_ADMIN)) … … 61 69 { 62 70 $sql = 'DELETE FROM `Log` WHERE `Type` = '.$_POST['Type']; 63 $ Database->SQLCommand($sql);71 $System->Database->query($sql); 64 72 WriteLog('Vymazán log '.$_POST['Type'], LOG_TYPE_MODERATOR); 65 73 echo(' Vymazán log '.$_POST['Type']); … … 85 93 $sql .= ')'; 86 94 87 $ ID = $Database->SQLCommand($sql);88 while ($Line = mysql_fetch_assoc($ID))95 $DbResult = $System->Database->query($sql); 96 while ($Line = $DbResult->fetch_assoc()) 89 97 { 90 98 $sql = 'UPDATE '.$Table.' SET '; … … 96 104 $sql = substr($sql,0,strlen($sql)-1); 97 105 $sql .= ' WHERE `ID` = '.$Line['ID']; 98 $ Database->SQLCommand($sql);106 $System->Database->query($sql); 99 107 echo ('.'); 100 108 } … … 123 131 FROM `'.$Table.'` AS `Tran` WHERE (`Language` <> 0) AND ((`Take` = 0) OR (`ID` = `Take`) OR NOT EXISTS(SELECT 1 FROM `'.$Table.'` WHERE `ID` = `Tran`.`Take`))'; 124 132 125 $ ID = $Database->SQLCommand($sql);126 while($Line = mysql_fetch_assoc($ID))133 $DbResult = $System->Database->query($sql); 134 while($Line = $DbResult->fetch_assoc()) 127 135 { 128 136 $sql = 'UPDATE `'.$Table.'` SET `Take` = '.$Line['IDOrig'].' WHERE `ID` = '.$Line['ID']; 129 $ Database->SQLCommand($sql);137 $System->Database->query($sql); 130 138 echo('.'); 131 139 } … … 150 158 echo ($Table.' '); 151 159 $sql = 'SELECT `gs_orig`.`ID`, `gs_tran`.`Entry`, `gs_tran`.`ShortCut` AS `ShortCut_tran`, `gs_orig`.`ShortCut` AS `ShortCut_orig` FROM `'.$Table.'` AS `gs_tran` JOIN `'.$Table.'` AS `gs_orig` ON `gs_orig`.`Entry` = `gs_tran`.`Entry` WHERE `gs_tran`.`Language` <> 0 AND `gs_tran`.`ShortCut` <> `gs_orig`.`ShortCut`'; 152 $ ID = $Database->SQLCommand($sql);153 while ($Line = mysql_fetch_assoc($ID))160 $DbResult = $System->Database->query($sql); 161 while ($Line = $DbResult->fetch_assoc()) 154 162 { 155 163 $sql = 'UPDATE `'.$Table.'` SET `ShortCut` = '.$Line['ShortCut_orig'].' WHERE `ID` = '.$Line['ID']; 156 $ Database->SQLCommand($sql);164 $System->Database->query($sql); 157 165 echo ('.'); 158 166 } 159 167 160 168 echo (' <strong>Hotovo</strong> <br />'); 161 if( mysql_num_rows($ID)> 0)162 { 163 WriteLog('Použita oprava DB na sloupec ShortCut '. mysql_num_rows($ID).' řádků z tabulky '.$Table, LOG_TYPE_MODERATOR);164 echo (' Použita oprava DB na sloupec ShortCut '. mysql_num_rows($ID).' řádků z tabulky '.$Table.'<br />');169 if($DbResult->num_rows > 0) 170 { 171 WriteLog('Použita oprava DB na sloupec ShortCut '.$DbResult->num_rows.' řádků z tabulky '.$Table, LOG_TYPE_MODERATOR); 172 echo (' Použita oprava DB na sloupec ShortCut '.$DbResult->num_rows.' řádků z tabulky '.$Table.'<br />'); 165 173 } 166 174 } … … 171 179 function Delete() 172 180 { 173 global $ Database, $User;181 global $System, $User; 174 182 175 183 if($User->Licence(LICENCE_MODERATOR)) 176 184 { 177 185 $TextID = $_GET['ID']; 178 $ Database->SQLCommand('DELETE FROM `'.$Table.'` WHERE `ID` = '.$TextID.' AND `Language` <> 0');186 $System->Database->query('DELETE FROM `'.$Table.'` WHERE `ID` = '.$TextID.' AND `Language` <> 0'); 179 187 echo('Překlad byl smazán!'); 180 188 WriteLog('Překlad byl smazán! <a href="form.php?group='.$GroupID.'&ID='.$TextID.'">'.$TextID.'</a>', LOG_TYPE_MODERATOR); … … 184 192 function ShoutBox() 185 193 { 186 global $Database, $User; 187 188 if(array_key_exists('shoutbox', $_GET)) $shoutbox = $_GET['shoutbox']; 189 else $shoutbox = ''; 190 if($shoutbox == '') 191 { 192 echo('<form action="action.php?action=shoutbox&shoutbox=1" method="post"><fieldset><legend>Nová zpráva kecátka</legend> 193 Uživatel: '); 194 global $System, $User; 195 196 if(!array_key_exists('add', $_POST)) 197 { 198 echo('<form action="action.php?action=shoutbox" method="post">'. 199 '<fieldset><legend>Nová zpráva kecátka</legend> 200 Uživatel: '); 194 201 if($User->Licence(LICENCE_USER)) echo('<b>'.$User->Name.'</b><br />'); 195 else echo('<input type="text" name="user" /><br />');202 else echo('<input type="text" name="user" /><br />'); 196 203 echo('Text zprávy: <br> 197 204 <textarea onkeydown="ResizeTextArea(this)" name="text" cols="40"></textarea> <br /> 198 <input type="submit" value="Odeslat" /><br /></fieldset>205 <input type="submit" name="add" value="Odeslat" /><br /></fieldset> 199 206 </form>'); 200 207 } else … … 202 209 if($User->Licence(LICENCE_USER)) 203 210 { 204 $Text = $_POST['text']; 205 $Database->SQLCommand('INSERT INTO `ShoutBox` ( `User` , `Text` , `Date` , `IP` ) '. 211 if(array_key_exists('text', $_POST)) 212 { 213 $Text = $_POST['text']; 214 $System->Database->query('INSERT INTO `ShoutBox` ( `User` , `Text` , `Date` , `IP` ) '. 206 215 ' VALUES ("'.$User->Name.'", "'.$Text.'", NOW(), "'.$_SERVER['REMOTE_ADDR'].'")'); 207 echo('Zpráva vložena!<br>Budete přesměrováni...'); 208 echo(' 209 <script type="text/javascript" language="JavaScript" charset="utf-8"> 210 setTimeout("parent.location.href=\'index.php\'",1000) 211 </script>'); 212 } else echo('Pro vkládaní musíte byt registrováni!'); 213 } 216 echo('Zpráva vložena!<br/>'); 217 } else echo('Nezadán text pro novou zprávu!<br/>'); 218 } else echo('Pro vkládaní musíte byt registrováni!<br/>'); 219 } 220 echo('<br/>'); 221 ShoutBoxView(); 214 222 } 215 223 216 224 function ShoutBoxView() 217 225 { 218 global $ Database, $User;219 220 $DbResult = $ Database->SQLCommand('SELECT COUNT(*) FROM `ShoutBox`');221 $DbRow = mysql_fetch_row($DbResult);226 global $System, $User; 227 228 $DbResult = $System->Database->query('SELECT COUNT(*) FROM `ShoutBox`'); 229 $DbRow = $DbResult->fetch_row(); 222 230 $PageList = GetPageList($DbRow[0]); 223 231 … … 226 234 if($User->Licence(LICENCE_USER)) echo(' <a href="action.php?action=shoutbox">Vložit</a>'); 227 235 echo('<div class="shoutbox">'); 228 $ ID = $Database->SQLCommand('SELECT * FROM `ShoutBox` ORDER BY `ID` DESC '.$PageList['SQLLimit']);229 while($Line = mysql_fetch_assoc($ID))236 $DbResult = $System->Database->query('SELECT * FROM `ShoutBox` ORDER BY `ID` DESC '.$PageList['SQLLimit']); 237 while($Line = $DbResult->fetch_assoc()) 230 238 echo('<div><strong>'.$Line['User'].'</strong>: '.htmlspecialchars($Line['Text']).'</div>'); 231 239 echo('</div>'); … … 235 243 function ShowNewsHistory() 236 244 { 237 global $ Database, $User;238 239 $DbResult = $ Database->SQLCommand('SELECT COUNT(*) FROM `News`');240 $DbRow = mysql_fetch_row($DbResult);245 global $System, $User; 246 247 $DbResult = $System->Database->query('SELECT COUNT(*) FROM `News`'); 248 $DbRow = $DbResult->fetch_row(); 241 249 $PageList = GetPageList($DbRow[0]); 242 250 … … 245 253 if($User->Licence(LICENCE_USER)) echo(' <a href="admin.php?action=addnew">Vložit</a>'); 246 254 echo('<div class="shoutbox">'); 247 $ ID = $Database->SQLCommand('SELECT `News`.`Time`, `News`.`Text`, `User`.`Name` AS `User` FROM `News` JOIN `User` ON `User`.`ID`=`News`.`User` ORDER BY `News`.`Time` DESC '.$PageList['SQLLimit']);248 while($Line = mysql_fetch_assoc($ID))255 $dbResult = $System->Database->query('SELECT `News`.`Time`, `News`.`Text`, `User`.`Name` AS `User` FROM `News` JOIN `User` ON `User`.`ID`=`News`.`User` ORDER BY `News`.`Time` DESC '.$PageList['SQLLimit']); 256 while($Line = $DbResult->fetch_assoc()) 249 257 echo('<div><strong>'.HumanDate($Line['Time']).'</strong> '.$Line['Text'].' ('.$Line['User'].')</div>'); 250 258 echo('</div>'); -
trunk/admin.php
r417 r455 41 41 function SaveNew() 42 42 { 43 global $ Database, $Config, $User;43 global $System, $Config, $User; 44 44 45 45 if(array_key_exists('text', $_POST)) 46 46 { 47 47 $querty = 'INSERT INTO `News` ( `Time` ,`User` ,`Text`) VALUES ( NOW( ) , '.$User->Id.', "'.$_POST['text'].'")'; 48 $ Database->SQLCommand($querty);48 $System->Database->query($querty); 49 49 echo('Aktualita uložena!'); 50 50 WriteLog('Vložena nová aktualita', LOG_TYPE_ADMINISTRATION); … … 54 54 function DeleteOldUsers() 55 55 { 56 global $ Database;56 global $System; 57 57 58 $DbResult = $ Database->SQLCommand('SELECT COUNT(*) FROM `User`');59 $DbRow2 = mysql_fetch_row($DbResult);58 $DbResult = $System->Database->query('SELECT COUNT(*) FROM `User`'); 59 $DbRow2 = $DbResult->fetch_row(); 60 60 61 61 $Condition = ' WHERE (`TranslatedCount`= 0)'. // Without translated texts … … 67 67 ' AND (NOT EXISTS (SELECT `ID` FROM `ShoutBox` WHERE `User`.`Name` = `ShoutBox`.`User`))'. // Without shoutbox messages 68 68 ''; 69 $DbResult = $ Database->SQLCommand('SELECT COUNT(*) FROM `User`'.$Condition);70 $DbRow = mysql_fetch_row($DbResult);71 $ Database->SQLCommand('DELETE FROM `User`'.$Condition);69 $DbResult = $System->Database->query('SELECT COUNT(*) FROM `User`'.$Condition); 70 $DbRow = $DbResult->fetch_row(); 71 $System->Database->query('DELETE FROM `User`'.$Condition); 72 72 echo('Smazáno '.$DbRow[0].' účtů ze všech '.$DbRow2[0].'<br/>'); 73 73 74 74 // Delete logs without user 75 $DbResult = $ Database->SQLCommand('SELECT COUNT(*) FROM `Log`');76 $DbRow2 = mysql_fetch_row($DbResult);77 $DbResult = $ Database->SQLCommand('SELECT COUNT(*) FROM `Log` WHERE (NOT EXISTS (SELECT `ID` FROM `User` WHERE `User`.`ID` = `Log`.`User`)) AND (`User` != 0)');78 $DbRow = mysql_fetch_row($DbResult);79 $ Database->SQLCommand('DELETE FROM `Log` WHERE (NOT EXISTS (SELECT `ID` FROM `User` WHERE `User`.`ID` = `Log`.`User`)) AND (`User` != 0)');75 $DbResult = $System->Database->query('SELECT COUNT(*) FROM `Log`'); 76 $DbRow2 = $DbResult->fetch_row(); 77 $DbResult = $System->Database->query('SELECT COUNT(*) FROM `Log` WHERE (NOT EXISTS (SELECT `ID` FROM `User` WHERE `User`.`ID` = `Log`.`User`)) AND (`User` != 0)'); 78 $DbRow = $DbResult->fetch_row(); 79 $System->Database->query('DELETE FROM `Log` WHERE (NOT EXISTS (SELECT `ID` FROM `User` WHERE `User`.`ID` = `Log`.`User`)) AND (`User` != 0)'); 80 80 echo('Smazáno '.$DbRow[0].' položek logu ze všech '.$DbRow2[0].'<br/>'); 81 81 82 82 // Delete invalid ExportUser 83 $DbResult = $ Database->SQLCommand('SELECT COUNT(*) FROM `ExportUser`');84 $DbRow2 = mysql_fetch_row($DbResult);85 $DbResult = $ Database->SQLCommand('SELECT COUNT(*) FROM `ExportUser` WHERE (NOT EXISTS (SELECT `Id` FROM `User` WHERE `User`.`ID` = `ExportUser`.`User`))');86 $DbRow = mysql_fetch_row($DbResult);87 $ Database->SQLCommand('DELETE FROM `ExportUser` WHERE (NOT EXISTS (SELECT `Id` FROM `User` WHERE `User`.`ID` = `ExportUser`.`User`))');83 $DbResult = $System->Database->query('SELECT COUNT(*) FROM `ExportUser`'); 84 $DbRow2 = $DbResult->fetch_row(); 85 $DbResult = $System->Database->query('SELECT COUNT(*) FROM `ExportUser` WHERE (NOT EXISTS (SELECT `Id` FROM `User` WHERE `User`.`ID` = `ExportUser`.`User`))'); 86 $DbRow = $DbResult->fetch_row(); 87 $System->Database->query('DELETE FROM `ExportUser` WHERE (NOT EXISTS (SELECT `Id` FROM `User` WHERE `User`.`ID` = `ExportUser`.`User`))'); 88 88 echo('Smazáno '.$DbRow[0].' položek výběru překladatelů u exportů ze všech '.$DbRow2[0].'<br/>'); 89 89 90 90 // Delete all teams without users 91 $DbResult = $ Database->SQLCommand('SELECT COUNT(*) FROM `Team`');92 $DbRow2 = mysql_fetch_row($DbResult);93 $DbResult = $ Database->SQLCommand('SELECT COUNT(*) FROM `Team` WHERE (SELECT COUNT(*) FROM `User` WHERE `User`.`Team` = `Team`.`Id`) = 0');94 $DbRow = mysql_fetch_row($DbResult);95 $ Database->SQLCommand('DELETE FROM `Team` WHERE (SELECT COUNT(*) FROM `User` WHERE `User`.`team` = `Team`.`Id`) = 0');91 $DbResult = $System->Database->query('SELECT COUNT(*) FROM `Team`'); 92 $DbRow2 = $DbResult->fetch_row(); 93 $DbResult = $System->Database->query('SELECT COUNT(*) FROM `Team` WHERE (SELECT COUNT(*) FROM `User` WHERE `User`.`Team` = `Team`.`Id`) = 0'); 94 $DbRow = $DbResult->fetch_row(); 95 $System->Database->query('DELETE FROM `Team` WHERE (SELECT COUNT(*) FROM `User` WHERE `User`.`team` = `Team`.`Id`) = 0'); 96 96 echo('Smazáno '.$DbRow[0].' týmů ze všech '.$DbRow2[0].'<br/>'); 97 97 98 98 // Set new leader for teams where old leader went to other team 99 $ Database->SQLCommand('UPDATE `Team` SET `Leader`=(SELECT `Id` FROM `User` WHERE `User`.`Team`=`Team`.`Id` ORDER BY `User`.`RegistrationTime` LIMIT 1) WHERE `Leader` NOT IN (SELECT `ID` FROM `User` WHERE `User`.`Team`=`Team`.`Id`);');99 $System->Database->query('UPDATE `Team` SET `Leader`=(SELECT `Id` FROM `User` WHERE `User`.`Team`=`Team`.`Id` ORDER BY `User`.`RegistrationTime` LIMIT 1) WHERE `Leader` NOT IN (SELECT `ID` FROM `User` WHERE `User`.`Team`=`Team`.`Id`);'); 100 100 101 101 WriteLog('Smazány staré uživatelské účty', LOG_TYPE_ADMINISTRATION); … … 104 104 function DeleteErrorLog() 105 105 { 106 global $ Database;106 global $System; 107 107 108 $DbResult = $ Database->SQLCommand('SELECT COUNT(*) FROM `Log` WHERE `Type`='.LOG_TYPE_ERROR);109 $DbRow = mysql_fetch_row($DbResult);110 $ Database->SQLCommand('DELETE FROM `Log` WHERE `Type`='.LOG_TYPE_ERROR);108 $DbResult = $System->Database->query('SELECT COUNT(*) FROM `Log` WHERE `Type`='.LOG_TYPE_ERROR); 109 $DbRow = $DbResult->fetch_row(); 110 $System->Database->query('DELETE FROM `Log` WHERE `Type`='.LOG_TYPE_ERROR); 111 111 WriteLog('Vymazány chybové záznamy', LOG_TYPE_ADMINISTRATION); 112 112 echo('Smazáno všech '.$DbRow[0].' chybových záznamů.<br/>'); -
trunk/banners.php
r417 r455 18 18 echo($BannerSmall.' <textarea rows="2" cols="30">'.htmlspecialchars($BannerSmall).'</textarea><br />'); 19 19 20 $ ID = $Database->SQLCommand('SELECT * FROM `Banner` WHERE `Show`=1 AND `DateLast` > (NOW() - INTERVAL 3 MONTH)');20 $DbResult = $System->Database->query('SELECT * FROM `Banner` WHERE `Show`=1 AND `DateLast` > (NOW() - INTERVAL 3 MONTH)'); 21 21 22 22 echo('<br/><strong>Servery odkazující na nás:</strong> <br /> 23 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 />'); 24 while($Line = mysql_fetch_assoc($ID))24 while($Line = $DbResult->fetch_assoc()) 25 25 { 26 26 echo('<a href="'.$Line['LastURL'].'">'.$Line['Web'].'</a> '.$Line['Description'].' <br />'); -
trunk/comparison.php
r365 r455 55 55 } else $WhereID = ''; 56 56 57 $DataID = $ Database->SQLCommand('SELECT * FROM '.$Table.' Where entry = '.$Textentry.' '.$WhereID.' ORDER BY Language');57 $DataID = $System->Database->query('SELECT * FROM '.$Table.' Where entry = '.$Textentry.' '.$WhereID.' ORDER BY Language'); 58 58 $i = 0; 59 while($Line = mysql_fetch_assoc($DataID))59 while($Line = $DataID->fetch_assoc()) 60 60 { 61 61 $BuffLine[$i] = $Line; … … 72 72 foreach($Line as $Index => $LineItem) 73 73 { 74 $LineUser = mysql_fetch_array($Database->SQLCommand('SELECT * FROM `User` WHERE `ID` = '.$LineItem['User'])); 74 $DbResult = $System->Database->query('SELECT * FROM `User` WHERE `ID` = '.$LineItem['User']); 75 $LineUser = $DbResult->fetch_array(); 75 76 echo('<th>'.$LineUser['Name'].'</th>'); 76 77 } -
trunk/dictionary.php
r393 r455 5 5 function WriteTranslatNames($Text,$mode) 6 6 { 7 7 8 8 if ($mode == 0) echo ('..Nalezené názvy jmen věcí, míst, postav'); 9 9 if ($mode == 1) echo ('..Všechny přeložené'); … … 26 26 $buff = GetTranslatNames($Text,$mode,$TablesColumn); 27 27 28 28 // $buff[] = array($Line['ID'],GetIDbyName($Table),$Line[$Column],$Line['Tran']); 29 29 foreach($buff as $Line) { 30 30 if ($mode == 0) … … 73 73 '<a href="?mode=0&group='.$GroupId.'&ID='.$TextID.'" title="Zobrazit pouze přesné výsledky">Přesné</a> '. 74 74 '<a href="?mode=2&group='.$GroupId.'&ID='.$TextID.'" title="Zobrazit všechny nepřeložené">Nepřeložené</a> '); 75 $Line = mysql_fetch_assoc($Database->SQLCommand('SELECT * FROM '.$Table.' Where ID = '.$TextID)); 75 $DbResult = $System->Database->query('SELECT * FROM '.$Table.' Where ID = '.$TextID); 76 $Line = $DbResult->fetch_assoc(); 76 77 if(!$Line) die('Překlad nenalezen.'); 77 78 … … 102 103 if(array_key_exists('Original', $_POST) and array_key_exists('Translated', $_POST) and array_key_exists('Description', $_POST)) 103 104 { 104 $DbResult = $ Database->SQLCommand('SELECT * FROM `Dictionary` WHERE `Text` = "'.$_POST['Original'].'" AND `Language`=0');105 if( mysql_num_rows($DbResult)> 0)106 { 107 $DbRow = mysql_fetch_assoc($DbResult);105 $DbResult = $System->Database->query('SELECT * FROM `Dictionary` WHERE `Text` = "'.$_POST['Original'].'" AND `Language`=0'); 106 if($DbResult->num_rows > 0) 107 { 108 $DbRow = $DbResult->fetch_assoc(); 108 109 $Entry = $DbRow['Entry']; 109 110 } else 110 111 { 111 $DbResult = $ Database->SQLCommand('SELECT MAX(`Entry`) FROM `Dictionary`');112 $DbRow = mysql_fetch_row($DbResult);112 $DbResult = $System->Database->query('SELECT MAX(`Entry`) FROM `Dictionary`'); 113 $DbRow = $DbResult->fetch_row(); 113 114 $Entry = $DbRow[0] + 1; 114 $ Database->SQLCommand('INSERT INTO `Dictionary` ( `Text` , `Entry` , `Description` , `User`, `Language` ) VALUES ("'.$_POST['Original'].'", "'.$Entry.'", "", 0, 0);');115 $System->Database->query('INSERT INTO `Dictionary` ( `Text` , `Entry` , `Description` , `User`, `Language` ) VALUES ("'.$_POST['Original'].'", "'.$Entry.'", "", 0, 0);'); 115 116 } 116 117 117 $DbResult = $ Database->SQLCommand('SELECT `Id` FROM `Dictionary` WHERE `Entry` = '.$Entry.' AND `Language`='.$_SESSION['language'].' AND `User`='.$User->Id);118 $DbResult = $System->Database->query('SELECT `Id` FROM `Dictionary` WHERE `Entry` = '.$Entry.' AND `Language`='.$_SESSION['language'].' AND `User`='.$User->Id); 118 119 if(mysql_num_rows($DbResult) > 0) 119 120 { 120 121 $DbRow = mysql_fetch_assoc($DbResult); 121 $ Database->SQLCommand('UPDATE `Dictionary` SET `Text`="'.$_POST['Translated'].'", `Description` = "'.$_POST['Description'].'" WHERE Id='.$DbRow['Id']);122 $System->Database->query('UPDATE `Dictionary` SET `Text`="'.$_POST['Translated'].'", `Description` = "'.$_POST['Description'].'" WHERE Id='.$DbRow['Id']); 122 123 } else 123 $ Database->SQLCommand('INSERT INTO `Dictionary` ( `Text` , `Entry` , `Description` , `User`, `Language` ) VALUES ("'.$_POST['Translated'].'", "'.$Entry.'", "'.$_POST['Description'].'", '.$User->Id.', '.$_SESSION['language'].')');124 $System->Database->query('INSERT INTO `Dictionary` ( `Text` , `Entry` , `Description` , `User`, `Language` ) VALUES ("'.$_POST['Translated'].'", "'.$Entry.'", "'.$_POST['Description'].'", '.$User->Id.', '.$_SESSION['language'].')'); 124 125 echo('Záznam byl uložen!'); 125 126 } else echo('Nebyly zaslány všechny položky formuláře.'); … … 127 128 if(($_GET['action'] == 'remove') and $User->Licence(LICENCE_USER)) 128 129 { 129 $ Database->SQLCommand('DELETE FROM `Dictionary` WHERE `User`='.$User->Id.' AND `Language`='.$_SESSION['language'].' AND `Entry`='.$_GET['entry']);130 $System->Database->query('DELETE FROM `Dictionary` WHERE `User`='.$User->Id.' AND `Language`='.$_SESSION['language'].' AND `Entry`='.$_GET['entry']); 130 131 } else 131 132 if(($_GET['action'] == 'modify') and $User->Licence(LICENCE_USER)) 132 133 { 133 $DbResult = $ Database->SQLCommand('SELECT * FROM `Dictionary` WHERE `User`='.$User->Id.' AND `Entry`='.$_GET['entry'].' AND `Language`='.$_SESSION['language']);134 $DbRow = mysql_fetch_assoc($DbResult);135 $DbResult = $ Database->SQLCommand('SELECT * FROM `Dictionary` WHERE `User`=0 AND `Entry`='.$_GET['entry'].' AND `Language`=0');136 $DbRow2 = mysql_fetch_assoc($DbResult);134 $DbResult = $System->Database->query('SELECT * FROM `Dictionary` WHERE `User`='.$User->Id.' AND `Entry`='.$_GET['entry'].' AND `Language`='.$_SESSION['language']); 135 $DbRow = $DbResult->fetch_assoc(); 136 $DbResult = $System->Database->query('SELECT * FROM `Dictionary` WHERE `User`=0 AND `Entry`='.$_GET['entry'].' AND `Language`=0'); 137 $DbRow2 = $DbResult->fetch_assoc(); 137 138 echo('<form action="dictionary.php?action=save" method="post">'. 138 139 '<fieldset><legend>Upravení slova</legend>'. … … 177 178 } else $sql = 'SELECT `User`.`Name` AS `UserName`, `ID` AS `UserID`, `T3`.`Entry`, `T3`.`Original`, `T3`.`Translated`, `T3`.`Description` FROM (SELECT `T2`.`User`, `T1`.Language, `T1`.`Text` AS `Original`, `T2`.`Text` AS `Translated`, `T2`.`Description`, `T1`.`Entry` AS `Entry` FROM `Dictionary` AS `T1` JOIN `Dictionary` AS `T2` ON `T2`.`Entry` = `T1`.`Entry` AND `T2`.`Language` = '.$_SESSION['language'].') AS `T3` JOIN `User` ON `User`.`ID` = `T3`.`User` WHERE `T3`.`Language` = 0'; 178 179 179 $DbResult = $ Database->SQLCommand('SELECT COUNT(*) FROM ('.$sql.') AS `T1`');180 $DbRow = mysql_fetch_row($DbResult);180 $DbResult = $System->Database->query('SELECT COUNT(*) FROM ('.$sql.') AS `T1`'); 181 $DbRow = $DbResult->fetch_row(); 181 182 $PageList = GetPageList($DbRow[0]); 182 183 … … 195 196 196 197 $sql_page = $sql.$Order['SQL'].$PageList['SQLLimit']; 197 $ ID = $Database->SQLCommand($sql_page);198 while($Line = mysql_fetch_assoc($ID))198 $DbResult = $System->Database->query($sql_page); 199 while($Line = $DbResult->fetch_assoc()) 199 200 { 200 201 echo('<tr> -
trunk/export/create_addon.php
r451 r455 107 107 while($Group = $DbResult->fetch_assoc()) 108 108 { 109 109 //získání čísla verze pro export 110 110 $ID = $this->Database->query('SELECT LastVersion FROM `Group` WHERE Id = '.$Group['Id']); 111 111 $LastVersion = $ID->fetch_assoc(); … … 163 163 { 164 164 $Buffer .= 'CZWOW_'.$Column['AddonFileName'].'_count=0;'."\n"; 165 166 165 } 166 167 167 file_put_contents($this->TempDir.'CzWoW/'.$CountFiles, $Buffer); 168 168 … … 242 242 243 243 '; 244 $DbResult = $ Database->query('SELECT * FROM `CzWoWPackageVersion` ORDER BY `Date` DESC');244 $DbResult = $System->Database->query('SELECT * FROM `CzWoWPackageVersion` ORDER BY `Date` DESC'); 245 245 while($Line = $DbResult->fetch_assoc()) 246 246 { -
trunk/export/export_output.php
r413 r455 103 103 function OutputAddon($ExportId) 104 104 { 105 global $ Config, $Database, $System;105 global $System; 106 106 107 107 if(function_exists('gzcompress')) … … 176 176 function OutputDBCToFile($ExportId) 177 177 { 178 global $ Database, $System;178 global $System; 179 179 180 180 echo('<form action="?Action=View&Tab=7&ExportId='.$ExportId.'" method="post"><input type="submit" name="Regenerate" value="Přegenerovat"/></form><br />'); 181 181 echo('U DBC souborů export textů funguje jinak, protože generování je náročné, jsou požadavky zařazovány do fronty a postupně zpracovávány.<br />DBC soubory je nutné zabalit do souboru patch-enGB-5.MPQ uvnitř složky "DBFilesClient" a hru spouštět přes program wowme.exe (WoW Model Edit) u verzí klienta starší než 3.2.0. Od této verze již wowme není potřeba. Zabalit je můžete pomocí programu <a href="../download/mpqediten32.zip">Ladik\'s MPQ Editor</a>. Stav vygenerování můžete sledovat na této stránce.<br /><br />'); 182 182 183 $DbResult = $ Database->SQLCommand('SELECT * FROM ExportTask WHERE Export = '.$ExportId);184 if( mysql_num_rows($DbResult)== 0)185 { 186 $ Database->SQLCommand('INSERT INTO ExportTask (`Export` ,`TimeStart` ) VALUES ('.$ExportId.', NOW())');183 $DbResult = $System->Database->query('SELECT * FROM ExportTask WHERE Export = '.$ExportId); 184 if($DbResult->num_rows == 0) 185 { 186 $System->Database->query('INSERT INTO ExportTask (`Export` ,`TimeStart` ) VALUES ('.$ExportId.', NOW())'); 187 187 WriteLog('Zadání úlohy pro vygenerování dbc souboru', LOG_TYPE_DOWNLOAD); 188 188 } … … 190 190 if(array_key_exists('Regenerate', $_POST)) 191 191 { 192 $ Database->SQLCommand('UPDATE ExportTask SET TimeStart = NOW(), TimeFinish = NULL WHERE Export = '.$ExportId);192 $System->Database->query('UPDATE ExportTask SET TimeStart = NOW(), TimeFinish = NULL WHERE Export = '.$ExportId); 193 193 echo('Soubor zařazen znovu ke zpracování.<br/><br/>'); 194 194 } 195 $DbResult = $ Database->SQLCommand('SELECT * FROM `ExportTask` WHERE `Export` = '.$ExportId);196 $ExportTask = mysql_fetch_assoc($DbResult);195 $DbResult = $System->Database->query('SELECT * FROM `ExportTask` WHERE `Export` = '.$ExportId); 196 $ExportTask = $DbResult->fetch_assoc(); 197 197 if($ExportTask['TimeFinish'] > $ExportTask['TimeStart']) 198 198 { -
trunk/export/index.php
r440 r455 6 6 function ExportList() 7 7 { 8 global $ Database, $User;8 global $System, $User; 9 9 10 10 echo('<a href="?Action=ViewList">Všechny</a>'); … … 22 22 } 23 23 24 $DbResult = $ Database->SQLCommand('SELECT COUNT(*) FROM `Export` '.$Filter);25 $DbRow = mysql_fetch_row($DbResult);24 $DbResult = $System->Database->query('SELECT COUNT(*) FROM `Export` '.$Filter); 25 $DbRow = $DbResult->fetch_row(); 26 26 $PageList = GetPageList($DbRow[0]); 27 27 … … 44 44 echo($Order['Output']); 45 45 46 $DbResult = $ Database->SQLCommand('SELECT `User`.`Name` AS `UserName`, `Export`.`Id`, `Export`.`TimeCreate`, `Export`.`Title`, `Export`.`User`, `Export`.`UsedCount`, (SELECT Version FROM `ClientVersion` WHERE `ClientVersion`.`Id`=`Export`.`ClientVersion`) AS `ClientVersion`,(SELECT Name FROM `ExportOutputType` WHERE `ExportOutputType`.`Id`=`Export`.`OutputType`) AS `OutputType`, (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))46 $DbResult = $System->Database->query('SELECT `User`.`Name` AS `UserName`, `Export`.`Id`, `Export`.`TimeCreate`, `Export`.`Title`, `Export`.`User`, `Export`.`UsedCount`, (SELECT Version FROM `ClientVersion` WHERE `ClientVersion`.`Id`=`Export`.`ClientVersion`) AS `ClientVersion`,(SELECT Name FROM `ExportOutputType` WHERE `ExportOutputType`.`Id`=`Export`.`OutputType`) AS `OutputType`, (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 = $DbResult->fetch_assoc()) 48 48 { 49 49 $Action = '<a href="?Action=View&ExportId='.$Export['Id'].'&Tab=0">Zobrazit</a> <a href="?Action=View&ExportId='.$Export['Id'].'&Tab=7">Exportovat</a>'; … … 59 59 function ExportCreate() 60 60 { 61 global $ Database, $Config, $User;61 global $System, $User; 62 62 63 63 if($User->Licence(LICENCE_USER)) 64 64 { 65 $DbResult = $ Database->SQLCommand('SELECT COUNT(*) FROM `Export` WHERE `User`='.$User->Id);66 $DbRow = mysql_fetch_row($DbResult);67 if($DbRow[0] < $ Config['MaxExportPerUser'])65 $DbResult = $System->Database->query('SELECT COUNT(*) FROM `Export` WHERE `User`='.$User->Id); 66 $DbRow = $DbResult->fetch_row(); 67 if($DbRow[0] < $System->Config['MaxExportPerUser']) 68 68 { 69 69 echo('<form action="?Action=CreateFinish" method="post">'. … … 73 73 '<tr><td colspan="2"><input type="submit" value="Vytvořit" /></td></tr>'. 74 74 '</table></fieldset></form>'); 75 } else echo('Nemůžete vytvářet další export. Max. počet na uživatele je '.$ Config['MaxExportPerUser'].'.');75 } else echo('Nemůžete vytvářet další export. Max. počet na uživatele je '.$System->Config['MaxExportPerUser'].'.'); 76 76 } else echo('Nemáte oprávnění'); 77 77 } … … 79 79 function ExportCreateFinish() 80 80 { 81 global $ Database, $Config, $User, $System;81 global $User, $System; 82 82 83 83 if($User->Licence(LICENCE_USER)) … … 85 85 if(array_key_exists('Title', $_POST) and array_key_exists('Description', $_POST)) 86 86 { 87 $DbResult = $ Database->SQLCommand('SELECT COUNT(*) FROM `Export` WHERE `User`='.$User->Id);88 $DbRow = mysql_fetch_row($DbResult);89 if($DbRow[0] < $ Config['MaxExportPerUser'])87 $DbResult = $System->Database->query('SELECT COUNT(*) FROM `Export` WHERE `User`='.$User->Id); 88 $DbRow = $DbResult->fetch_row(); 89 if($DbRow[0] < $System->Config['MaxExportPerUser']) 90 90 { 91 $ Database->SQLCommand('INSERT INTO `Export` (`Title`, `User`, `TimeCreate`, `WithDiacritic`, `Description`) VALUES ("'.$_POST['Title'].'", '.$User->Id.', NOW(), 1, "'.$_POST['Description'].'")');92 $ExportId = mysql_insert_id();91 $System->Database->query('INSERT INTO `Export` (`Title`, `User`, `TimeCreate`, `WithDiacritic`, `Description`) VALUES ("'.$_POST['Title'].'", '.$User->Id.', NOW(), 1, "'.$_POST['Description'].'")'); 92 $ExportId = $System->database->insert_id; 93 93 echo('Nový export vytvořen.<br/>Přímý odkaz na tento export: <a href="?Action=View&ExportId='.$ExportId.'">zde</a><br/><br/>'); 94 94 WriteLog('Vytvořen nový export <a href="'.$System->Link('/export/?Action=View&ExportId='.$ExportId).'">'.$ExportId.'</a>.', LOG_TYPE_EXPORT); 95 95 $_GET['Filter'] = 'my'; 96 96 ExportList(); 97 } else echo('Nemůžete vytvářet další export. Max. počet na uživatele je '.$ Config['MaxExportPerUser'].'.');97 } else echo('Nemůžete vytvářet další export. Max. počet na uživatele je '.$System->Config['MaxExportPerUser'].'.'); 98 98 } else echo('Chybí údaje formuláře'); 99 99 } else echo('Nemáte oprávnění'); … … 102 102 function ExportDelete() 103 103 { 104 global $ Database, $User;104 global $System, $User; 105 105 106 106 if($User->Licence(LICENCE_USER)) 107 107 { 108 $ DbResult = $Database->SQLCommand('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId'].' AND `User`='.$User->Id);109 $ Database->SQLCommand('DELETE FROM `Export` WHERE `Id`='.$_GET['ExportId']);108 $System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId'].' AND `User`='.$User->Id); 109 $System->Database->query('DELETE FROM `Export` WHERE `Id`='.$_GET['ExportId']); 110 110 DeleteDirectory('../tmp/Export/'.$_GET['ExportId'].'/'); 111 111 echo('Export smazán.<br/><br/>'); … … 118 118 function ExportViewTranslators() 119 119 { 120 global $ Database, $TranslationTree, $Config, $User, $System;120 global $TranslationTree, $User, $System; 121 121 122 122 $DisabledInput = array(false => ' disabled="disabled"', true => ''); 123 $DbR ows = $Database->SQLCommand('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']);124 $Export = mysql_fetch_assoc($DbRows);123 $DbResult = $System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 124 $Export = $DbResult->fetch_assoc(); 125 125 if($User->Licence(LICENCE_USER) and ($User->Id == $Export['User'])) $Editable = true; 126 126 else $Editable = false; … … 140 140 else $Selected = false; 141 141 $Condition = ' WHERE `Export`='.$_GET['ExportId'].' AND `User`='.$UserId; 142 $DbResult = $ Database->SQLCommand('SELECT * FROM `ExportUser` '.$Condition);143 if( mysql_num_rows($DbResult)> 0)142 $DbResult = $System->Database->query('SELECT * FROM `ExportUser` '.$Condition); 143 if($DbResult->num_rows > 0) 144 144 { 145 if(!$Selected) $ Database->SQLCommand('DELETE FROM `ExportUser` '.$Condition);146 else $ Database->SQLCommand('UPDATE `ExportUser` SET `Sequence`='.$Value.$Condition);145 if(!$Selected) $System->Database->query('DELETE FROM `ExportUser` '.$Condition); 146 else $System->Database->query('UPDATE `ExportUser` SET `Sequence`='.$Value.$Condition); 147 147 } else 148 148 { 149 if($Selected) $ Database->SQLCommand('INSERT INTO `ExportUser` (`Export`, `User`, `Sequence`) VALUES ('.$_GET['ExportId'].', '.$UserId.', '.$Value.')');149 if($Selected) $System->Database->query('INSERT INTO `ExportUser` (`Export`, `User`, `Sequence`) VALUES ('.$_GET['ExportId'].', '.$UserId.', '.$Value.')'); 150 150 } 151 151 } … … 153 153 154 154 // Recalculate sequence number 155 $ Database->SQLCommand('SET @I = 0');156 $ Database->SQLCommand('UPDATE `ExportUser` SET `Sequence` = (@I := @I + 1) WHERE `Export`='.$_GET['ExportId'].' ORDER BY `Sequence`;');155 $System->Database->query('SET @I = 0'); 156 $System->Database->query('UPDATE `ExportUser` SET `Sequence` = (@I := @I + 1) WHERE `Export`='.$_GET['ExportId'].' ORDER BY `Sequence`;'); 157 157 } 158 158 } … … 174 174 $Query .=' WHERE `T`.`TranslatedCount` > 0 ORDER BY COALESCE(`ExportUser`.`Sequence`, 100000000)'.$InitialOrder.') AS `TT`'; 175 175 176 $DbResult = $ Database->SQLCommand('SELECT COUNT(*) FROM ('.$Query.') AS `X`');177 $DbRow = mysql_fetch_row($DbResult);176 $DbResult = $System->Database->query('SELECT COUNT(*) FROM ('.$Query.') AS `X`'); 177 $DbRow = $DbResult->fetch_row(); 178 178 $PageList = GetPageList($DbRow[0]); 179 179 … … 194 194 195 195 $Query = 'SELECT * FROM ('.$Query.') AS `TX` '.$Order['SQL'].$PageList['SQLLimit']; 196 $ Database->SQLCommand('SET @I = 0');197 $DbResult = $ Database->SQLCommand($Query);198 while($UserLine = mysql_fetch_assoc($DbResult))196 $System->Database->query('SET @I = 0'); 197 $DbResult = $System->Database->query($Query); 198 while($UserLine = $DbResult->fetch_assoc()) 199 199 { 200 200 $XP = GetLevelMinMax($UserLine['XP']); … … 216 216 function ExportViewGeneral() 217 217 { 218 global $ Database, $User;218 global $System, $User; 219 219 220 220 $DisabledInput = array(false => ' disabled="disabled"', true => ''); 221 221 $DisabledTextArea = array(false => ' readonly="yes"', true => ''); 222 222 echo('<h3>Obecná nastavení</h3>'); 223 $DbRows = $ Database->SQLCommand('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']);224 $Export = mysql_fetch_assoc($DbRows);223 $DbRows = $System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 224 $Export = $DbRows->fetch_assoc(); 225 225 if($User->Licence(LICENCE_USER) and ($User->Id == $Export['User'])) $Editable = true; 226 226 else $Editable = false; … … 229 229 if(array_key_exists('WithDiacritic', $_POST)) $WithDiacritic = 1; 230 230 else $WithDiacritic = 0; 231 $ Database->SQLCommand('UPDATE `Export` SET `Title`="'.$_POST['Title'].'", `Description`="'.$_POST['Description'].'", `WithDiacritic`='.$WithDiacritic.' WHERE Id='.$Export['Id']);231 $System->Database->query('UPDATE `Export` SET `Title`="'.$_POST['Title'].'", `Description`="'.$_POST['Description'].'", `WithDiacritic`='.$WithDiacritic.' WHERE Id='.$Export['Id']); 232 232 $Export['Title'] = $_POST['Title']; 233 233 $Export['Description'] = $_POST['Description']; … … 250 250 function ExportViewLanguages() 251 251 { 252 global $ Database, $TranslationTree, $Config, $User;252 global $System, $TranslationTree, $User; 253 253 254 254 $DisabledInput = array(false => ' disabled="disabled"', true => ''); 255 $DbRows = $ Database->SQLCommand('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']);256 $Export = mysql_fetch_assoc($DbRows);255 $DbRows = $System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 256 $Export = $DbRows->fetch_assoc(); 257 257 if($User->Licence(LICENCE_USER) and ($User->Id == $Export['User'])) $Editable = true; 258 258 else $Editable = false; … … 272 272 else $Selected = false; 273 273 $Condition = ' WHERE Export='.$_GET['ExportId'].' AND `Language`='.$LanguageId; 274 $DbResult = $ Database->SQLCommand('SELECT * FROM `ExportLanguage` '.$Condition);275 if( mysql_num_rows($DbResult)> 0)274 $DbResult = $System->Database->query('SELECT * FROM `ExportLanguage` '.$Condition); 275 if($DbResult->num_rows > 0) 276 276 { 277 if(!$Selected) $ Database->SQLCommand('DELETE FROM `ExportLanguage` '.$Condition);278 else $ Database->SQLCommand('UPDATE `ExportLanguage` SET `Sequence`='.$Value.$Condition);277 if(!$Selected) $System->Database->query('DELETE FROM `ExportLanguage` '.$Condition); 278 else $System->Database->query('UPDATE `ExportLanguage` SET `Sequence`='.$Value.$Condition); 279 279 } else 280 280 { 281 if($Selected) $ Database->SQLCommand('INSERT INTO `ExportLanguage` (`Export`, `Language`, `Sequence`) VALUES ('.$_GET['ExportId'].', '.$LanguageId.', '.$Value.')');281 if($Selected) $System->Database->query('INSERT INTO `ExportLanguage` (`Export`, `Language`, `Sequence`) VALUES ('.$_GET['ExportId'].', '.$LanguageId.', '.$Value.')'); 282 282 } 283 283 } … … 285 285 286 286 // Recalculate sequence number 287 $ Database->SQLCommand('SET @I = 0');288 $ Database->SQLCommand('UPDATE `ExportLanguage` SET `Sequence` = (@I := @I + 1) WHERE `Export`='.$_GET['ExportId'].' ORDER BY `Sequence`;');287 $System->Database->query('SET @I = 0'); 288 $System->Database->query('UPDATE `ExportLanguage` SET `Sequence` = (@I := @I + 1) WHERE `Export`='.$_GET['ExportId'].' ORDER BY `Sequence`;'); 289 289 } 290 290 } … … 294 294 $Query .=' WHERE `Language`.`Enabled` = 1 ORDER BY COALESCE(`Sequence`, 100)'; 295 295 296 $DbResult = $ Database->SQLCommand('SELECT COUNT(*) FROM ('.$Query.') AS X');297 $DbRow = mysql_fetch_row($DbResult);296 $DbResult = $System->Database->query('SELECT COUNT(*) FROM ('.$Query.') AS X'); 297 $DbRow = $DbResult->fetch_row(); 298 298 $PageList = GetPageList($DbRow[0]); 299 299 … … 319 319 320 320 $Query = 'SELECT * FROM ('.$Query.') AS TX '.$Order['SQL'].$PageList['SQLLimit']; 321 $ Database->SQLCommand('SET @I = 0');322 $DbResult = $ Database->SQLCommand($Query);323 while($Langugage = mysql_fetch_assoc($DbResult))321 $System->Database->query('SET @I = 0'); 322 $DbResult = $System->Database->query($Query); 323 while($Langugage = $DbResult->fetch_assoc()) 324 324 { 325 325 $Checked = $Langugage['Sequence'] != ''; … … 337 337 function ExportViewGroups() 338 338 { 339 global $ Database, $TranslationTree, $Config, $User;339 global $System, $TranslationTree, $User; 340 340 341 341 $DisabledInput = array(false => ' disabled="disabled"', true => ''); 342 $DbRows = $ Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId']);343 $Export = mysql_fetch_assoc($DbRows);342 $DbRows = $System->Database->query('SELECT * FROM Export WHERE Id='.$_GET['ExportId']); 343 $Export = $DbRows->fetch_assoc(); 344 344 if($User->Licence(LICENCE_USER) and ($User->Id == $Export['User'])) $Editable = true; 345 345 else $Editable = false; … … 359 359 else $Selected = false; 360 360 $Condition = ' WHERE `Export`='.$_GET['ExportId'].' AND `Group`='.$GroupId; 361 $DbResult = $ Database->SQLCommand('SELECT * FROM `ExportGroup` '.$Condition);362 if( mysql_num_rows($DbResult)> 0)361 $DbResult = $System->Database->query('SELECT * FROM `ExportGroup` '.$Condition); 362 if($DbResult->num_rows > 0) 363 363 { 364 if(!$Selected) $ Database->SQLCommand('DELETE FROM `ExportGroup` '.$Condition);364 if(!$Selected) $System->Database->query('DELETE FROM `ExportGroup` '.$Condition); 365 365 } else 366 366 { 367 if($Selected) $ Database->SQLCommand('INSERT INTO `ExportGroup` (`Export`, `Group`) VALUES ('.$_GET['ExportId'].', '.$GroupId.')');367 if($Selected) $System->Database->query('INSERT INTO `ExportGroup` (`Export`, `Group`) VALUES ('.$_GET['ExportId'].', '.$GroupId.')'); 368 368 } 369 369 } … … 374 374 $Query = 'SELECT `Group`.*, `ExportGroup`.`Id` AS `ExportGroupId` FROM `Group` LEFT JOIN `ExportGroup` ON `ExportGroup`.`Export`='.$_GET['ExportId'].' AND `Group`=`Group`.`Id`'; 375 375 376 $DbResult = $ Database->SQLCommand('SELECT COUNT(*) FROM ('.$Query.') AS X');377 $DbRow = mysql_fetch_row($DbResult);376 $DbResult = $System->Database->query('SELECT COUNT(*) FROM ('.$Query.') AS X'); 377 $DbRow = $DbResult->fetch_row(); 378 378 $PageList = GetPageList($DbRow[0]); 379 379 … … 401 401 402 402 $Query = 'SELECT * FROM ('.$Query.') AS TX '.$Order['SQL'].$PageList['SQLLimit']; 403 $DbResult = $ Database->SQLCommand($Query);404 while($Group = mysql_fetch_assoc($DbResult))403 $DbResult = $System->Database->query($Query); 404 while($Group = $DbResult->fetch_assoc()) 405 405 { 406 406 $Checked = $Group['ExportGroupId'] != ''; … … 420 420 function ExportViewOutputFormat() 421 421 { 422 global $ Database, $User;422 global $System, $User; 423 423 424 424 $DisabledInput = array(false => ' disabled="disabled"', true => ''); 425 425 if(array_key_exists('ExportId', $_GET)) 426 426 { 427 $DbRows = $ Database->SQLCommand('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']);428 if( mysql_num_rows($DbRows)> 0)427 $DbRows = $System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 428 if($DbRows->num_rows > 0) 429 429 { 430 $Export = mysql_fetch_assoc($DbRows);430 $Export = $DbRows->fetch_assoc(); 431 431 if($User->Licence(LICENCE_USER) and ($User->Id == $Export['User'])) $Editable = true; 432 432 else $Editable = false; … … 434 434 if(array_key_exists('OutputType', $_POST)) 435 435 { 436 $ Database->SQLCommand('UPDATE Export SET OutputType='.$_POST['OutputType'].' WHERE Id='.$_GET['ExportId']);437 } 438 439 $DbResult = $ Database->SQLCommand('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']);440 $Export = mysql_fetch_assoc($DbResult);436 $System->Database->query('UPDATE Export SET OutputType='.$_POST['OutputType'].' WHERE Id='.$_GET['ExportId']); 437 } 438 439 $DbResult = $System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 440 $Export = $DbResult->fetch_assoc(); 441 441 442 442 echo('<h3>Formát generovaného výstupu</h3>'); … … 447 447 '<br />'); 448 448 } 449 $DbResult = $ Database->SQLCommand('SELECT * FROM `ExportOutputType` ORDER BY `Name`');450 while($ExportFormat = mysql_fetch_assoc($DbResult))449 $DbResult = $System->Database->query('SELECT * FROM `ExportOutputType` ORDER BY `Name`'); 450 while($ExportFormat = $DbResult->fetch_assoc()) 451 451 { 452 452 echo(RadioButton('OutputType', $ExportFormat['Id'], $Export['OutputType'] == $ExportFormat['Id'], '', !$Editable).' '.$ExportFormat['Name'].'<br/>'); … … 459 459 function ExportViewVersion() 460 460 { 461 global $ Database, $Config, $User;461 global $System, $User; 462 462 463 463 $DisabledInput = array(false => ' disabled="disabled"', true => ''); 464 $DbRows = $ Database->SQLCommand('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']);465 $Export = mysql_fetch_assoc($DbRows);464 $DbRows = $System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 465 $Export = $DbRows->fetch_assoc(); 466 466 if($User->Licence(LICENCE_USER) and ($User->Id == $Export['User'])) $Editable = true; 467 467 else $Editable = false; … … 469 469 if(array_key_exists('ClientVersion', $_POST)) 470 470 { 471 $ Database->SQLCommand('UPDATE `Export` SET `ClientVersion`='.$_POST['ClientVersion'].' WHERE `Id`='.$_GET['ExportId']);472 } 473 474 $DbResult = $ Database->SQLCommand('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']);475 $Export = mysql_fetch_assoc($DbResult);471 $System->Database->query('UPDATE `Export` SET `ClientVersion`='.$_POST['ClientVersion'].' WHERE `Id`='.$_GET['ExportId']); 472 } 473 474 $DbResult = $System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 475 $Export = $DbResult->fetch_assoc(); 476 476 477 477 $Query = 'SELECT `ClientVersion`.* FROM `ExportVersion` LEFT JOIN `ClientVersion` ON `ClientVersion`.`Id`=`ExportVersion`.`ClientVersion` WHERE `ExportType`='.$Export['OutputType']; 478 478 479 $DbResult = $ Database->SQLCommand('SELECT COUNT(*) FROM ('.$Query.') AS `X`');480 $DbRow = mysql_fetch_row($DbResult);479 $DbResult = $System->Database->query('SELECT COUNT(*) FROM ('.$Query.') AS `X`'); 480 $DbRow = $DbResult->fetch_row(); 481 481 $PageList = GetPageList($DbRow[0]); 482 482 … … 503 503 504 504 $Query = 'SELECT * FROM ('.$Query.') AS `TX` '.$Order['SQL'].$PageList['SQLLimit']; 505 $DbResult = $ Database->SQLCommand($Query);506 while($Version = mysql_fetch_assoc($DbResult))505 $DbResult = $System->Database->query($Query); 506 while($Version = $DbResult->fetch_assoc()) 507 507 { 508 508 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 … … 517 517 function ExportViewOutput() 518 518 { 519 global $ Database;520 521 $DbResult = $ Database->SQLCommand('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']);522 $Export = mysql_fetch_assoc($DbResult);523 $DbResult = $ Database->SQLCommand('SELECT * FROM `ExportOutputType` WHERE `Id`='.$Export['OutputType']);524 if( mysql_num_rows($DbResult)> 0)525 { 526 $DbResult = $ Database->SQLCommand('SELECT * FROM `ExportVersion` WHERE `ExportType`='.$Export[ 'OutputType'].' AND `ClientVersion`='.$Export['ClientVersion']);527 if( mysql_num_rows($DbResult)> 0)519 global $System; 520 521 $DbResult = $System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 522 $Export = $DbResult->fetch_assoc(); 523 $DbResult = $System->Database->query('SELECT * FROM `ExportOutputType` WHERE `Id`='.$Export['OutputType']); 524 if($DbResult->num_rows > 0) 525 { 526 $DbResult = $System->Database->query('SELECT * FROM `ExportVersion` WHERE `ExportType`='.$Export[ 'OutputType'].' AND `ClientVersion`='.$Export['ClientVersion']); 527 if($DbResult->num_rows > 0) 528 528 { 529 $ Database->SQLCommand('UPDATE Export SET UsedCount = UsedCount + 1 WHERE Id='.$Export['Id']);529 $System->Database->query('UPDATE Export SET UsedCount = UsedCount + 1 WHERE Id='.$Export['Id']); 530 530 ExportOutput($Export['Id'], $Export['OutputType']); 531 531 } else echo('Nebyla vybrána požadovaná verze klienta'); … … 535 535 function ExportViewStat() 536 536 { 537 global $ Database, $System;537 global $System; 538 538 539 539 $Export = new Export($System); … … 547 547 $Query = ''; 548 548 $UnionItems = array(); 549 $DbResult = $ Database->SQLCommand($GroupListQuery);550 while($DbRow = mysql_fetch_assoc($DbResult))549 $DbResult = $System->Database->query($GroupListQuery); 550 while($DbRow = $DbResult->fetch_assoc()) 551 551 { 552 552 $UnionItems[] = 'SELECT (SELECT COUNT(DISTINCT(`Entry`)) FROM ('. … … 563 563 $Query = substr($Query, 0, - 6); 564 564 565 $DbResult = $ Database->SQLCommand('SELECT COUNT(*) FROM ('.$GroupListQuery.') AS `T`');566 $DbRow = mysql_fetch_row($DbResult);565 $DbResult = $System->Database->query('SELECT COUNT(*) FROM ('.$GroupListQuery.') AS `T`'); 566 $DbRow = $DbResult->fetch_row(); 567 567 $PageList = GetPageList($DbRow[0]); 568 568 echo('<h3>Statistika dokončení vybraných skupin</h3>'); … … 584 584 if(count($UnionItems) > 0) 585 585 { 586 $ID = $ Database->SQLCommand('SELECT *, ROUND(`Translated` / `Total` * 100, 2) AS `Percent` FROM ('.implode(' UNION ALL ', $UnionItems).') AS `C3` '.$Order['SQL'].$PageList['SQLLimit']);587 while($Group = mysql_fetch_assoc($ID))586 $ID = $System->Database->query('SELECT *, ROUND(`Translated` / `Total` * 100, 2) AS `Percent` FROM ('.implode(' UNION ALL ', $UnionItems).') AS `C3` '.$Order['SQL'].$PageList['SQLLimit']); 587 while($Group = $ID->fetch_assoc()) 588 588 { 589 589 echo('<tr><td>'.$Group['Name'].'</td><td>'.$Group['Translated'].'</td><td>'.$Group['Total'].'</td><td>'.ProgressBar(150, $Group['Percent']).'</td></tr>'); … … 601 601 function ExportView() 602 602 { 603 global $ Database;603 global $System; 604 604 605 605 if(array_key_exists('ExportId', $_GET) and is_numeric($_GET['ExportId'])) 606 606 { 607 $DbResult = $ Database->SQLCommand('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']);608 if( mysql_num_rows($DbResult)> 0)607 $DbResult = $System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 608 if($DbResult->num_rows > 0) 609 609 { 610 $Export = mysql_fetch_assoc($DbResult);611 612 $DbResult = $ Database->SQLCommand('SELECT * FROM `User` WHERE `ID`='.$Export['User']);613 $UserLine = mysql_fetch_assoc($DbResult);610 $Export = $DbResult->fetch_assoc(); 611 612 $DbResult = $System->Database->query('SELECT * FROM `User` WHERE `ID`='.$Export['User']); 613 $UserLine = $DbResult->fetch_assoc(); 614 614 echo('Export <strong><a href="?Action=View&Tab=6&ExportId='.$Export['Id'].'">'.$_GET['ExportId'].'</a></strong> překladatele <strong>'.$UserLine['Name'].'</strong> s označením <strong>'.$Export['Title'].'</strong>'); 615 615 ShowTabs(array('Obecné', 'Překladatelé', 'Překlady', 'Jazyky', 'Formát', 'Verze', 'Statistika', 'Výstup')); -
trunk/export/process_aowow_export.php
r377 r455 16 16 // Rebuild user selection 17 17 $UserSelection = array(); 18 $DbResult = $ Database->SQLCommand('SELECT `ID`, `XP` FROM `User`');19 while($DbRow = mysql_fetch_assoc($DbResult))18 $DbResult = $System->Database->query('SELECT `ID`, `XP` FROM `User`'); 19 while($DbRow = $DbResult->fetch_assoc()) 20 20 { 21 21 $UserSelection[$DbRow['ID']] = $DbRow['XP']; … … 27 27 foreach($UserSelection as $ID => $XP) 28 28 { 29 $DbResult = $ Database->SQLCommand('SELECT `Id` FROM `ExportUser` WHERE `Export` = '.$Config['AoWoWExportId'].' AND `User` = '.$ID);30 if( mysql_num_rows($DbResult)> 0)29 $DbResult = $System->Database->query('SELECT `Id` FROM `ExportUser` WHERE `Export` = '.$Config['AoWoWExportId'].' AND `User` = '.$ID); 30 if($DbResult->num_rows > 0) 31 31 $Query = 'UPDATE `ExportUser` SET `Sequence` = '.$Sequence.' WHERE `Export` = '.$Config['AoWoWExportId'].' AND `User` = '.$ID; 32 32 else $Query = 'INSERT INTO `ExportUser` (`Export`, `User`, `Sequence`) VALUES ('.$Config['AoWoWExportId'].', '.$ID.', '.$Sequence.')'; 33 $ Database->SQLCommand($Query);33 $System->Database->query($Query); 34 34 $Sequence++; 35 35 } -
trunk/export/process_task.php
r403 r455 12 12 while(1) 13 13 { 14 $DbResult = $ Database->SQLCommand('SELECT `ExportTask`.`Export`, `Export`.`Id` AS `ExportId` FROM `ExportTask` LEFT JOIN `Export` ON `Export`.`Id` = `ExportTask`.`Export` WHERE `ExportTask`.`TimeFinish` IS NULL');15 while($DbRow = mysql_fetch_assoc($DbResult))14 $DbResult = $System->Database->query('SELECT `ExportTask`.`Export`, `Export`.`Id` AS `ExportId` FROM `ExportTask` LEFT JOIN `Export` ON `Export`.`Id` = `ExportTask`.`Export` WHERE `ExportTask`.`TimeFinish` IS NULL'); 15 while($DbRow = $DbResult->fetch_assoc()) 16 16 { 17 17 echo(StrFTime("%d/%m/%Y %H:%M:%S", time()).': Generování DBC souborů pro export '.$DbRow['ExportId'].'.. '."\n"); … … 44 44 echo('Hotovo'."\n"); 45 45 } else echo('Funkce pro tvorbu Zip souboru není podporována!'."\n"); 46 $ Database->SQLCommand('UPDATE `ExportTask` SET `TimeFinish`=NOW() WHERE `Export`='.$Export->Id);46 $System->Database->query('UPDATE `ExportTask` SET `TimeFinish`=NOW() WHERE `Export`='.$Export->Id); 47 47 } catch (Exception $e) 48 48 { … … 51 51 } else 52 52 { 53 $ Database->SQLCommand('DELETE FROM `ExportTask` WHERE `Export`='.$DbRow['Export']);53 $System->Database->query('DELETE FROM `ExportTask` WHERE `Export`='.$DbRow['Export']); 54 54 echo('Export '.$DbRow['Export'].' nenalezen. Jeho úloha smazána.'."\n"); 55 55 } -
trunk/form.php
r443 r455 30 30 $TextID = $_GET['ID'] * 1; 31 31 32 $DbResult = $ Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE `ID` = '.$TextID);33 $Line = mysql_fetch_assoc($DbResult);32 $DbResult = $System->Database->query('SELECT * FROM `'.$Table.'` WHERE `ID` = '.$TextID); 33 $Line = $DbResult->fetch_assoc(); 34 34 if(!$Line) ErrorMessage('Překlad nenalezen.'); 35 35 36 $DbResult = $ Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE (`Language` = 0) AND (`Entry` = '.$Line['Entry'].') AND (`VersionEnd` = '.$Line['VersionEnd'].') LIMIT 1');37 $LineAJ = mysql_fetch_assoc($DbResult);36 $DbResult = $System->Database->query('SELECT * FROM `'.$Table.'` WHERE (`Language` = 0) AND (`Entry` = '.$Line['Entry'].') AND (`VersionEnd` = '.$Line['VersionEnd'].') LIMIT 1'); 37 $LineAJ = $DbResult->fetch_assoc(); 38 38 if(!$Line) ErrorMessage('Anglický originál k překladu nenalezen.'); 39 39 40 $IDUser = $ Database->SQLCommand('SELECT * FROM `User` WHERE `ID` = '.$Line['User']);41 $LineUser = mysql_fetch_array($IDUser);40 $IDUser = $System->Database->query('SELECT * FROM `User` WHERE `ID` = '.$Line['User']); 41 $LineUser = $IDUser->fetch_array(); 42 42 43 43 echo('Skupina: <strong>'.$TranslationTree[$GroupId]['Name'].'</strong><br />'); … … 47 47 if(($Line['Take'] <> 0) and ($Line['Take'] <> $Line['ID'])) 48 48 { 49 $Language = mysql_fetch_assoc($Database->SQLCommand('SELECT `Language`,`VersionStart`,`VersionEnd` FROM `'.$Table.'` WHERE `ID` = '.$Line['Take'])); 49 $DbResult = $System->Database->query('SELECT `Language`,`VersionStart`,`VersionEnd` FROM `'.$Table.'` WHERE `ID` = '.$Line['Take']); 50 $Language = $DbResult->fetch_assoc(); 50 51 // echo $Language['Language'].' '.$Line['Take']; 51 52 if($Language['Language'] <> 0) … … 63 64 echo('<br />'); 64 65 65 $DbResult = $ Database->SQLCommand('SELECT COUNT(*) FROM `'.$Table.'` WHERE (`Entry` = '.$Line['Entry'].') AND (`Language` <> 0) AND (`Complete` = 1)');66 $Version = mysql_fetch_row($DbResult);66 $DbResult = $System->Database->query('SELECT COUNT(*) FROM `'.$Table.'` WHERE (`Entry` = '.$Line['Entry'].') AND (`Language` <> 0) AND (`Complete` = 1)'); 67 $Version = $DbResult->fetch_row(); 67 68 $Version = $Version[0]; 68 69 if($Version > 0) … … 75 76 <option value="-1">Vyberte text k porovnání</option> 76 77 <option value="-1">Zobrazit/porovnat všechny</option>'); 77 $DataID = $ Database->SQLCommand('SELECT *, (SELECT `User`.`Name` AS `UserName` FROM `User` WHERE `User`.`ID` = `'.$Table.'`.`User`) AS `UserName` FROM `'.$Table.'` WHERE (`Entry` = '.$Line['Entry'].') AND (`ID` <> '.$Line['ID'].') AND (`Complete` = 1)');78 while($version = mysql_fetch_array($DataID))78 $DataID = $System->Database->query('SELECT *, (SELECT `User`.`Name` AS `UserName` FROM `User` WHERE `User`.`ID` = `'.$Table.'`.`User`) AS `UserName` FROM `'.$Table.'` WHERE (`Entry` = '.$Line['Entry'].') AND (`ID` <> '.$Line['ID'].') AND (`Complete` = 1)'); 79 while($version = $DataID->fetch_array()) 79 80 { 80 81 if ($version['ID'] == $Line['Take']) echo('<option value="'.$version['ID'].'">'.$version['ID'].' - '.$version['User'].' (převzato)</option>'); -
trunk/img_level.php
r404 r455 57 57 function GetXPFromTranslation($UserId) 58 58 { 59 global $ Database, $TranslationTree, $xp_from_word, $from_diakrit;59 global $System, $TranslationTree, $xp_from_word, $from_diakrit; 60 60 61 61 $xp = 0; … … 71 71 $GroupBy = substr($GroupBy, 0, -2); 72 72 73 $IDtran = $ Database->SQLCommand('SELECT * FROM `'.$Group['TablePrefix'].'` WHERE (`User` = '.$UserId.') AND (`Complete` = 1) '.$GroupBy);74 while($Line = mysql_fetch_array($IDtran))73 $IDtran = $System->Database->query('SELECT * FROM `'.$Group['TablePrefix'].'` WHERE (`User` = '.$UserId.') AND (`Complete` = 1) '.$GroupBy); 74 while($Line = $IDtran->fetch_array()) 75 75 { 76 $DbResult = $ Database->SQLCommand('SELECT * FROM `'.$Group['TablePrefix'].'` WHERE `ID` = '.$Line['Take']);77 $LineComparison = mysql_fetch_assoc($DbResult);76 $DbResult = $System->Database->query('SELECT * FROM `'.$Group['TablePrefix'].'` WHERE `ID` = '.$Line['Take']); 77 $LineComparison = $DbResult->fetch_assoc(); 78 78 $xp_translation = 0; 79 79 $translated = true; … … 103 103 function ImgLevelUpdate() 104 104 { 105 global $ Database, $TranslationTree;105 global $System, $TranslationTree; 106 106 107 107 // Hlavní kod pro uživatele 108 $ ID = $Database->SQLCommand('SELECT `ID`, `Name` FROM `User` WHERE `NeedUpdate` = 1');109 while($LineUser = mysql_fetch_array($ID))108 $DbResult = $System->Database->query('SELECT `ID`, `Name` FROM `User` WHERE `NeedUpdate` = 1'); 109 while($LineUser = $DbResult->fetch_array()) 110 110 { 111 111 // Build TranslatedCount query … … 120 120 121 121 $xp = GetXPFromTranslation($LineUser['ID']); 122 $ Database->SQLCommand('UPDATE `User` SET `XP` = '.$xp.', `TranslatedCount` = '.$TranslatedCount.' WHERE `User`.`ID` = '.$LineUser['ID']);122 $System->Database->query('UPDATE `User` SET `XP` = '.$xp.', `TranslatedCount` = '.$TranslatedCount.' WHERE `User`.`ID` = '.$LineUser['ID']); 123 123 CreateImg('user', $LineUser['Name'], $xp); 124 124 } 125 125 126 126 // Hlavní kod pro překladatelské týmy 127 $ ID = $Database->SQLCommand('SELECT `ID`, `Name`, (SELECT AVG(`XP`) FROM `User` WHERE `Team` = `Team`.`Id`) AS `Average` FROM `Team` WHERE `ID` IN (SELECT `Team` FROM `User` WHERE `NeedUpdate` = 1)');128 while($LineTeam = mysql_fetch_array($ID))127 $DbResult = $System->Database->query('SELECT `ID`, `Name`, (SELECT AVG(`XP`) FROM `User` WHERE `Team` = `Team`.`Id`) AS `Average` FROM `Team` WHERE `ID` IN (SELECT `Team` FROM `User` WHERE `NeedUpdate` = 1)'); 128 while($LineTeam = $DbResult->fetch_array()) 129 129 { 130 130 CreateImg('team', $LineTeam['Name'], substr($LineTeam['Average'], 0, strpos($LineTeam['Average'],'.'))); //vytváření obrázku 131 131 } 132 $ Database->SQLCommand('UPDATE `User` SET `NeedUpdate` = 0');132 $System->Database->query('UPDATE `User` SET `NeedUpdate` = 0'); 133 133 } 134 134 135 135 function ImgLevelShow() 136 136 { 137 global $ Database;137 global $System; 138 138 139 139 // Do update for all users 140 $ Database->SQLCommand('UPDATE `User` SET `NeedUpdate` = 1');140 $System->Database->query('UPDATE `User` SET `NeedUpdate` = 1'); 141 141 ImgLevelUpdate(); 142 142 143 143 echo('<strong>Uživatelé</strong><br/>'); 144 $ID = $ Database->SQLCommand('SELECT `ID`, `Name` FROM `User`');145 while($LineUser = mysql_fetch_array($ID))144 $ID = $System->Database->query('SELECT `ID`, `Name` FROM `User`'); 145 while($LineUser = $ID->fetch_array()) 146 146 { 147 147 echo('<img src="tmp/user/'.$LineUser['Name'].'/level.png" /> '.$LineUser['Name'].'<br />'); … … 149 149 150 150 echo('<br/><strong>Týmy</strong><br/>'); 151 $ID = $ Database->SQLCommand('SELECT `ID`, `Name` FROM `Team`');152 while($LineTeam = mysql_fetch_array($ID))151 $ID = $System->Database->query('SELECT `ID`, `Name` FROM `Team`'); 152 while($LineTeam = $ID->fetch_array()) 153 153 { 154 154 echo('<img src="tmp/team/'.$LineTeam['Name'].'/level.png" /> '.$LineTeam['Name'].'<br />'); -
trunk/img_statistic.php
r402 r455 19 19 20 20 21 $DbResult = $ Database->SQLCommand('SELECT MAX(`VersionEnd`) FROM '.$Group['TablePrefix']);22 $ID = mysql_fetch_row($DbResult);21 $DbResult = $System->Database->query('SELECT MAX(`VersionEnd`) FROM '.$Group['TablePrefix']); 22 $ID = $DbResult->fetch_row(); 23 23 $BuildNumber_max = $ID[0]; 24 24 if($BuildNumber_max == '') $BuildNumber_max = 0; // Empty result, no items in this group 25 25 26 26 $where = '(`VersionEnd` = '.$BuildNumber_max.') AND (`Language` <> 0) AND (`Complete` = 1) '.$team.$language; 27 $ID = mysql_fetch_row($Database->SQLCommand('SELECT COUNT(DISTINCT(`Entry`)) FROM `'.$Group['TablePrefix'].'` WHERE '.$where)); 27 $DbResult = $System->Database->query('SELECT COUNT(DISTINCT(`Entry`)) FROM `'.$Group['TablePrefix'].'` WHERE '.$where); 28 $ID = $DbResult->fetch_row(); 28 29 $NumberTranslate = $ID[0]; 29 30 30 $DbResult = $ Database->SQLCommand('SELECT COUNT(DISTINCT(`Entry`)) FROM `'.$Group['TablePrefix'].'` WHERE (`VersionEnd` = '.$BuildNumber_max.') AND (`Language` = 0)');31 $ID = mysql_fetch_row($DbResult);31 $DbResult = $System->Database->query('SELECT COUNT(DISTINCT(`Entry`)) FROM `'.$Group['TablePrefix'].'` WHERE (`VersionEnd` = '.$BuildNumber_max.') AND (`Language` = 0)'); 32 $ID = $DbResult->fetch_row(); 32 33 $NumberAJ = $ID[0]; 33 34 -
trunk/import/import.php
r443 r455 6 6 var $Group; 7 7 var $NewItemCount; 8 var $System; 9 10 function __construct($System) 11 { 12 $this->System = &$System; 13 } 8 14 9 15 function SetVersion($Version) … … 16 22 17 23 function InsertItem($Value) 18 { 19 global $Database; 20 24 { 21 25 $Columns = ''; 22 26 foreach($this->Group['Items'] as $GroupItem) … … 28 32 //print_r($Value); 29 33 30 $DbResult2 = $ Database->SQLCommand('SELECT `VersionEnd`, `ID`, `Entry`, '.$Columns.' FROM `'.$this->Group['TablePrefix'].'` WHERE '.$Where.' AND (`Language`=0) ORDER BY `VersionStart` DESC LIMIT 1');34 $DbResult2 = $this->System->Database->query('SELECT `VersionEnd`, `ID`, `Entry`, '.$Columns.' FROM `'.$this->Group['TablePrefix'].'` WHERE '.$Where.' AND (`Language`=0) ORDER BY `VersionStart` DESC LIMIT 1'); 31 35 //echo('SELECT `VersionEnd`, `ID`, `Entry`, '.$Columns.' FROM `'.$this->Group['TablePrefix'].'` WHERE '.$Where.' AND (`Language`=0) ORDER BY `VersionStart` DESC LIMIT 1'); 32 if(isset($DbResult2) and ( mysql_num_rows($DbResult2)> 0))36 if(isset($DbResult2) and ($DbResult2->num_rows > 0)) 33 37 { 34 38 // Update existed text 35 $DbRow2 = mysql_fetch_assoc($DbResult2);39 $DbRow2 = $DbResult2->fetch_assoc(); 36 40 if($this->HaveSameText($this->Group, $DbRow2, $Value)) 37 41 { 38 42 if($DbRow2['VersionEnd'] <> $this->Version['BuildNumber']) 39 43 { 40 $ Database->SQLCommand('UPDATE `'.$this->Group['TablePrefix'].'` SET `VersionEnd` = "'.$this->Version['BuildNumber'].'" WHERE `ID`='.$DbRow2['ID']);44 $this->System->Database->query('UPDATE `'.$this->Group['TablePrefix'].'` SET `VersionEnd` = "'.$this->Version['BuildNumber'].'" WHERE `ID`='.$DbRow2['ID']); 41 45 echo(', '); 42 46 } else echo('. '); … … 50 54 $Values .= ', "'.$Value[$GroupItem['Column']].'"'; 51 55 } 52 $ Database->SQLCommand('INSERT `'.$this->Group['TablePrefix'].'` ('.$Columns.') VALUES ('.$Values.')');56 $this->System->Database->query('INSERT `'.$this->Group['TablePrefix'].'` ('.$Columns.') VALUES ('.$Values.')'); 53 57 echo('# '); 54 WriteLog('Text <a href="form.php?group='.$this->Group['Id'].'&ID='.mysql_insert_id().'">'.mysql_insert_id().'</a> ('.$DbRow2['Entry'].') ze skupiny '.$this->Group['Name'].' byl v nové verzi '.$this->Version['Version'].' změněn.', LOG_TYPE_IMPORT); 58 $InsertId = $this->System->Database->insert_id; 59 WriteLog('Text <a href="form.php?group='.$this->Group['Id'].'&ID='.$InsertId.'">'.$InsertId.'</a> ('.$DbRow2['Entry'].') ze skupiny '.$this->Group['Name'].' byl v nové verzi '.$this->Version['Version'].' změněn.', LOG_TYPE_IMPORT); 55 60 } 56 61 } else … … 62 67 // Get new unused Entry for tables without numeric id 63 68 $Value['Entry'] = 1; 64 $DbResult = $ Database->SQLCommand('SELECT MAX(`Entry`) FROM `'.$this->Group['TablePrefix'].'`');65 if( mysql_num_rows($DbResult)> 0)66 { 67 $DbRow = mysql_fetch_row($DbResult);69 $DbResult = $this->System->Database->query('SELECT MAX(`Entry`) FROM `'.$this->Group['TablePrefix'].'`'); 70 if($DbResult->num_rows > 0) 71 { 72 $DbRow = $DbResult->fetch_row(); 68 73 $Value['Entry'] += $DbRow[0]; 69 74 } … … 76 81 $Values .= ', "'.$Value[$GroupItem['Column']].'"'; 77 82 } 78 $Database->SQLCommand('INSERT `'.$this->Group['TablePrefix'].'` ('.$Columns.') VALUES ('.$Values.')'); 83 $this->System->Database->query('INSERT `'.$this->Group['TablePrefix'].'` ('.$Columns.') VALUES ('.$Values.')'); 84 $InsertId = $this->System->Database->insert_id; 79 85 echo('+ '); 80 86 $this->NewItemCount++; 81 WriteLog('Text <a href="form.php?group='.$this->Group['Id'].'&ID='. mysql_insert_id().'">'.mysql_insert_id().'</a> ('.$Value['Entry'].') ze skupiny '.$this->Group['Name'].' byl v nové verzi '.$this->Version['Version'].' přidán.', LOG_TYPE_IMPORT);87 WriteLog('Text <a href="form.php?group='.$this->Group['Id'].'&ID='.$InsertId.'">'.$InsertId.'</a> ('.$Value['Entry'].') ze skupiny '.$this->Group['Name'].' byl v nové verzi '.$this->Version['Version'].' přidán.', LOG_TYPE_IMPORT); 82 88 } 83 89 } … … 85 91 function ImportLUA() 86 92 { 87 global $ Database, $TranslationTree, $PatchVersion, $Config;93 global $TranslationTree, $PatchVersion; 88 94 89 95 echo('Načítání textů z LUA souboru...'); … … 126 132 } 127 133 echo('<br />Celkem: '.$Count.' Nových: '.$this->NewItemCount.'<br />'); 128 $ Database->SQLCommand('UPDATE `Group` SET `LastVersion` = "'.$this->Version['BuildNumber'].'", `LastImport` = NOW() WHERE `Id`='.$this->Group['Id']);134 $this->System->Database->query('UPDATE `Group` SET `LastVersion` = "'.$this->Version['BuildNumber'].'", `LastImport` = NOW() WHERE `Id`='.$this->Group['Id']); 129 135 } else echo('Již importován pro verzi '.$this->Version['Version']); 130 136 } else echo('Není definováno jméno zdrojového souboru'); … … 134 140 function UpdateTranslated() 135 141 { 136 global $ Database, $TranslationTree, $PatchVersion, $Config;142 global $TranslationTree, $PatchVersion, $Config; 137 143 138 144 echo('<br /><br />Začínám se synchronizací VersionEnd u přeložených textů<br />'); … … 140 146 { 141 147 echo('<br />'.$Group['Name'].' '); 142 $DbResult = $ Database->SQLCommand('SELECT `gs_tran`.`ID`, `gs_tran`.`VersionEnd` AS `VersionEnd_tran`, `gs_orig`.`VersionEnd` AS `VersionEnd_orig` FROM `'.$Group['TablePrefix'].'` AS `gs_tran` JOIN `'.$Group['TablePrefix'].'` AS `gs_orig` ON `gs_orig`.`ID` = `gs_tran`.`Take` WHERE `gs_tran`.`VersionEnd` <> `gs_orig`.`VersionEnd`');143 while($DbRow = mysql_fetch_assoc($DbResult))148 $DbResult = $this->System->Database->query('SELECT `gs_tran`.`ID`, `gs_tran`.`VersionEnd` AS `VersionEnd_tran`, `gs_orig`.`VersionEnd` AS `VersionEnd_orig` FROM `'.$Group['TablePrefix'].'` AS `gs_tran` JOIN `'.$Group['TablePrefix'].'` AS `gs_orig` ON `gs_orig`.`ID` = `gs_tran`.`Take` WHERE `gs_tran`.`VersionEnd` <> `gs_orig`.`VersionEnd`'); 149 while($DbRow = $DbResult->fetch_assoc()) 144 150 { 145 $ Database->SQLCommand('UPDATE `'.$Group['TablePrefix'].'` SET `VersionEnd` = '.$DbRow['VersionEnd_orig'].' WHERE `ID` = '.$DbRow['ID']);151 $this->System->Database->query('UPDATE `'.$Group['TablePrefix'].'` SET `VersionEnd` = '.$DbRow['VersionEnd_orig'].' WHERE `ID` = '.$DbRow['ID']); 146 152 echo('. '); 147 153 } … … 253 259 function ImportSQL() 254 260 { 255 global $ Database, $TranslationTree, $PatchVersion, $Config;261 global $TranslationTree, $PatchVersion; 256 262 257 263 $File = new FileStream(); … … 357 363 } 358 364 echo('<br />Celkem: '.$Count.' Nových: '.$this->NewItemCount.'<br />'); 359 $ Database->SQLCommand('UPDATE `Group` SET `LastVersion` = "'.$this->Version['BuildNumber'].'", `LastImport` = NOW() WHERE `Id`='.$this->Group['Id']);365 $this->System->Database->query('UPDATE `Group` SET `LastVersion` = "'.$this->Version['BuildNumber'].'", `LastImport` = NOW() WHERE `Id`='.$this->Group['Id']); 360 366 } 361 367 } -
trunk/import/index.php
r443 r455 34 34 function ShowImportGroup() 35 35 { 36 global $ Config;36 global $System; 37 37 38 38 if(array_key_exists('id', $_GET)) … … 41 41 42 42 $GroupId = (int)$_GET['id']; 43 $Import = new Import( );44 $Import->SetVersion($ Config['Web']['GameVersion']);43 $Import = new Import($System); 44 $Import->SetVersion($System->Config['Web']['GameVersion']); 45 45 $Import->ImportGroup($GroupId); 46 46 … … 52 52 function ShowMenu() 53 53 { 54 global $TranslationTree, $ Database, $Config;54 global $TranslationTree, $System; 55 55 56 56 echo('</div><div><strong>Import zdrojů:</strong></div>'); … … 58 58 echo('<div><a href="?action=instructions">Instrukce pro přípravu zdrojových souborů</a></div>'); 59 59 echo('<div><a href="?action=update_translated">Zaktualizovat verze přeložených</a></div><br/>'); 60 echo('Verze klienta použitá pro import: <strong>'.$ Config['Web']['GameVersion'].'</strong>');61 $DbResult = $ Database->SQLCommand('SELECT COUNT(*) FROM `Group`');62 $DbRow = mysql_fetch_row($DbResult);60 echo('Verze klienta použitá pro import: <strong>'.$System->Config['Web']['GameVersion'].'</strong>'); 61 $DbResult = $System->Database->query('SELECT COUNT(*) FROM `Group`'); 62 $DbRow = $DbResult->fetch_row(); 63 63 $PageList = GetPageList($DbRow[0]); 64 64 echo('<h3>Seznam překladových skupin</h3>'); … … 78 78 echo($Order['Output']); 79 79 80 $ ID = $Database->SQLCommand('SELECT * FROM `Group`'.$Order['SQL'].$PageList['SQLLimit']);81 while($Group = mysql_fetch_assoc($ID))80 $DbResult = $System->Database->query('SELECT * FROM `Group`'.$Order['SQL'].$PageList['SQLLimit']); 81 while($Group = $DbResult->fetch_assoc()) 82 82 { 83 83 echo('<tr><td>'.$Group['Name'].'</td><td>'.$Group['SourceType'].'</td><td>'); … … 92 92 function UpdateTranslated() 93 93 { 94 global $System; 95 94 96 echo('<div style="font-size: xx-small;">'); 95 $Import = new Import( );97 $Import = new Import($System); 96 98 $Import->UpdateTranslated(); 97 99 echo('</div>'); -
trunk/includes/Database.php
r420 r455 17 17 function open() 18 18 { 19 parent:: __construct($this->HostName, $this->UserName, $this->Password, $this->Schema);19 parent::real_connect($this->HostName, $this->UserName, $this->Password, $this->Schema); 20 20 $this->charset($this->Charset); 21 21 } -
trunk/includes/global.php
r454 r455 15 15 16 16 include_once(dirname(__FILE__).'/config.php'); 17 include_once(dirname(__FILE__).'/error.php'); 18 include_once(dirname(__FILE__).'/databaseconection.php'); 17 include_once(dirname(__FILE__).'/Database.php'); 19 18 include_once(dirname(__FILE__).'/global_function.php'); 20 19 include_once(dirname(__FILE__).'/rss.php'); … … 22 21 include_once(dirname(__FILE__).'/user.php'); 23 22 24 $Database = new Database($Config['Database']['Host'], $Config['Database']['User'], $Config['Database']['Password']);25 $Database->SQLCommand('SET NAMES '.$Config['Database']['Charset']);26 $Database->SelectDatabase($Config['Database']['Database']);27 28 $TranslationTree = GetTranslationTree();29 $LanguageList = GetLanguageList();30 31 23 $System = new System(); 32 24 $System->Init(); 33 25 $User = new User($System); 34 26 27 include_once(dirname(__FILE__).'/error.php'); 28 29 $TranslationTree = GetTranslationTree(); 30 $LanguageList = GetLanguageList(); 31 35 32 function GetMicrotime() 36 33 { … … 41 38 function ShowShoutbox() 42 39 { 43 global $ Database, $Config, $User, $System;40 global $System, $Config, $User, $System; 44 41 45 42 echo('<strong><a href="'.$System->Link('/action.php?action=ShoutBoxView').'">Kecátko:</a></strong>'); … … 47 44 echo(' <a href="'.$System->Link('/action.php?action=shoutbox').'">Vložit</a>'); 48 45 echo('<div class="box"><table>'); 49 $ ID = $Database->SQLCommand('SELECT * FROM `ShoutBox` ORDER BY `ID` DESC LIMIT 30');50 while($Line = mysql_fetch_assoc($ID))46 $DbResult = $System->Database->query('SELECT * FROM `ShoutBox` ORDER BY `ID` DESC LIMIT 30'); 47 while($Line = $DbResult->fetch_assoc()) 51 48 echo('<tr><td><strong>'.$Line['User'].'</strong>: '.htmlspecialchars($Line['Text']).'</td></tr>'); 52 49 echo('</table></div>'); … … 55 52 function ShowTopBar() 56 53 { 57 global $Config, $ Database, $User, $System;54 global $Config, $System, $User, $System; 58 55 59 56 echo('<div class="Menu">'); … … 61 58 if($User->Licence(LICENCE_USER)) 62 59 { 63 $DbResult = $ Database->SQLCommand('SELECT `Id`, `Name` FROM `Team` WHERE `Id`='.$User->Team);64 $Team = mysql_fetch_assoc($DbResult);60 $DbResult = $System->Database->query('SELECT `Id`, `Name` FROM `Team` WHERE `Id`='.$User->Team); 61 $Team = $DbResult->fetch_assoc(); 65 62 66 63 //echo('<span class="MenuItem">Moje překlady: <a href="">Dokončené</a> <a href="">Rozpracované</a> <a href="">Exporty</a> Tým: <a href="">'.$Team['name'].'</a></span>'); … … 159 156 function ShowTranslatedMenu() 160 157 { 161 global $TranslationTree, $ Config, $Database, $User, $System;158 global $TranslationTree, $User, $System; 162 159 163 160 echo('<strong>Překladové skupiny:</strong><br /><div id="TranslationMenu">'); … … 182 179 function ShowOnlineUserList() 183 180 { 184 global $ Database, $Moderators, $User;181 global $System, $Moderators, $User; 185 182 186 183 echo('Online překladatelé:<br />'); 187 $ ID = $Database->SQLCommand('SELECT `Name`, `GM`, `ID` FROM `User` WHERE `LastLogin` >= NOW() - 300 AND ((`LastLogout` < `LastLogin`) OR (ISNULL(`LastLogout`)))');188 while($DbUser = mysql_fetch_assoc($ID))184 $DbResult = $System->Database->query('SELECT `Name`, `GM`, `ID` FROM `User` WHERE `LastLogin` >= NOW() - 300 AND ((`LastLogout` < `LastLogin`) OR (ISNULL(`LastLogout`)))'); 185 while($DbUser = $DbResult->fetch_assoc()) 189 186 { 190 187 if($User->Licence(LICENCE_MODERATOR)) $Name = '<a href="user.php?user='.$DbUser['ID'].'">'.$DbUser['Name'].'</a>'; … … 197 194 function ShowPage() 198 195 { 199 global $User, $ Config, $Database, $RSSChannels, $PageFooterRequested, $System;200 201 echo('<?xml version="1.0" encoding="'.$ Config['Web']['Charset'].'"?>196 global $User, $RSSChannels, $PageFooterRequested, $System; 197 198 echo('<?xml version="1.0" encoding="'.$System->Config['Web']['Charset'].'"?> 202 199 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 203 200 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cz">'. 204 201 '<head>'. 205 '<meta http-equiv="content-type" content="application/xhtml+xml; charset='.$ Config['Web']['Charset'].'" />'.202 '<meta http-equiv="content-type" content="application/xhtml+xml; charset='.$System->Config['Web']['Charset'].'" />'. 206 203 '<meta name="keywords" content="wow, quest, questy, questů, preklad, mangos, překlad, překládání, přeložený, přeložení, čeština, world of warcraft, open source, free, addon" />'. 207 '<meta name="description" content="'.$ Config['Web']['Title'].'" />'.204 '<meta name="description" content="'.$System->Config['Web']['Title'].'" />'. 208 205 '<meta name="robots" content="all" />'. 209 206 '<link rel="stylesheet" href="'.$System->Link('/style/style.css').'" type="text/css" media="all" />'. … … 213 210 foreach($RSSChannels as $Channel) 214 211 echo(' <link rel="alternate" title="'.$Channel['Title'].'" href="'.$Channel['URL'].'" type="application/rss+xml" />'); 215 echo('<title>'.$ Config['Web']['Title'].'</title>212 echo('<title>'.$System->Config['Web']['Title'].'</title> 216 213 </head> 217 214 <body>'); … … 268 265 function ShowFooter() 269 266 { 270 global $ Database, $Config, $ScriptStartTime, $PageFooterRequested, $User;267 global $System, $ScriptStartTime, $PageFooterRequested, $User; 271 268 272 269 if(isset($PageFooterRequested)) … … 291 288 292 289 echo('</td></tr>'); 293 if($ Config['Web']['ShowRuntimeInfo'] == true) echo('<tr><td colspan="3" style="text-align: center;">Doba generování: '.$ScriptGenerateDuration.' s / '.ini_get('max_execution_time').' s Použitá paměť: '.HumanSize(memory_get_peak_usage(FALSE)).' / '.ini_get('memory_limit').'B <a href="http://validator.w3.org/check?uri='.htmlentities('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].'?'.$_SERVER['QUERY_STRING']).'">HTML validator</a></td></tr>');290 if($System->Config['Web']['ShowRuntimeInfo'] == true) echo('<tr><td colspan="3" style="text-align: center;">Doba generování: '.$ScriptGenerateDuration.' s / '.ini_get('max_execution_time').' s Použitá paměť: '.HumanSize(memory_get_peak_usage(FALSE)).' / '.ini_get('memory_limit').'B <a href="http://validator.w3.org/check?uri='.htmlentities('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].'?'.$_SERVER['QUERY_STRING']).'">HTML validator</a></td></tr>'); 294 291 echo('</table>'. 295 292 '</body>'. 296 293 '</html>'); 297 $Database->Disconnect();298 294 $User->Store(); 299 295 } -
trunk/includes/global_function.php
r443 r455 36 36 function GetPageList($TotalCount) 37 37 { 38 global $ Database, $Config;38 global $System; 39 39 40 40 $QueryItems = GetQueryStringArray($_SERVER['QUERY_STRING']); 41 41 42 $ItemPerPage = $ Config['Web']['ItemsPerPage'];43 $Around = round($ Config['Web']['VisiblePagingItems'] / 2);42 $ItemPerPage = $System->Config['Web']['ItemsPerPage']; 43 $Around = round($System->Config['Web']['VisiblePagingItems'] / 2); 44 44 $Result = ''; 45 45 $PageCount = floor($TotalCount / $ItemPerPage) + 1; … … 218 218 function GetLanguageList() 219 219 { 220 global $ Database;220 global $System; 221 221 222 222 $Result = array(); 223 $DbResult = $ Database->SQLCommand('SELECT * FROM `Language` WHERE `Enabled` = 1');224 while($DbRow = mysql_fetch_assoc($DbResult))223 $DbResult = $System->Database->query('SELECT * FROM `Language` WHERE `Enabled` = 1'); 224 while($DbRow = $DbResult->fetch_assoc()) 225 225 $Result[$DbRow['Id']] = $DbRow; 226 226 return($Result); … … 229 229 function GetTranslationTree() 230 230 { 231 global $ Database;231 global $System; 232 232 233 233 $Result = array(); 234 $DbResult = $ Database->SQLCommand('SELECT *, UNIX_TIMESTAMP(`LastImport`) AS `LastImportTime` FROM `Group` ORDER BY `Name`');235 while($DbRow = mysql_fetch_assoc($DbResult))234 $DbResult = $System->Database->query('SELECT *, UNIX_TIMESTAMP(`LastImport`) AS `LastImportTime` FROM `Group` ORDER BY `Name`'); 235 while($DbRow = $DbResult->fetch_assoc()) 236 236 { 237 237 $DbRow['Items'] = array(); 238 238 $Result[$DbRow['Id']] = $DbRow; 239 239 } 240 $DbResult = $ Database->SQLCommand('SELECT * FROM `GroupItem` ORDER BY `Group`, `Sequence`');241 while($DbRow = mysql_fetch_assoc($DbResult))240 $DbResult = $System->Database->query('SELECT * FROM `GroupItem` ORDER BY `Group`, `Sequence`'); 241 while($DbRow = $DbResult->fetch_assoc()) 242 242 { 243 243 $Result[$DbRow['Group']]['Items'][] = $DbRow; … … 250 250 function WriteLog($Text, $Type) 251 251 { 252 global $ Database, $Config, $User;252 global $System, $User; 253 253 254 254 if(!isset($_SERVER['REMOTE_ADDR'])) $IP = 'Konzole'; 255 255 else $IP = addslashes($_SERVER['REMOTE_ADDR']); 256 256 257 $Database->SelectDatabase($Config['Database']['Database']); 257 if(isset($User->Id)) $UserId = $User->Id; 258 else $UserId = 0; 258 259 $Query = 'INSERT INTO `Log` ( `User` , `Type` , `Text` , `Date` , `IP` ) 259 VALUES ('.$User ->Id.', '.$Type.', "'.addslashes($Text).'", NOW(), "'.$IP.'")';260 $ Database->SQLCommand($Query);260 VALUES ('.$UserId.', '.$Type.', "'.addslashes($Text).'", NOW(), "'.$IP.'")'; 261 $System->Database->query($Query); 261 262 } 262 263 … … 273 274 function FollowingTran($TextID, $Table, $GroupId, $Prev = false) 274 275 { 275 global $ Database;276 global $System; 276 277 277 278 if($Prev) … … 283 284 } 284 285 285 $Next = mysql_fetch_assoc($Database->SQLCommand($sql)); 286 $DbResult = $System->Database->query($sql); 287 $Next = $DbResult->fetch_assoc(); 286 288 if($Next) 287 289 { 288 290 if($Prev) echo('<a href="form.php?group='.$GroupId.'&ID='.$Next['ID'].'">Předcházející '.$Next['ID'].'</a> '); 289 291 else echo('<a href="form.php?group='.$GroupId.'&ID='.$Next['ID'].'">Následující '.$Next['ID'].'</a> '); 290 return 'form.php?group='.$GroupId.'&ID='.$Next['ID'];292 return('form.php?group='.$GroupId.'&ID='.$Next['ID']); 291 293 } 292 294 } … … 294 296 function GetBuildNumber($Version) 295 297 { 296 global $ Database, $BuildNumbers;298 global $System, $BuildNumbers; 297 299 298 300 if(isset($BuildNumbers[$Version]) == false) 299 301 { 300 302 $sql = 'SELECT `BuildNumber` FROM `ClientVersion` WHERE `Version` = "'.$Version.'"'; 301 $DbRow = mysql_fetch_assoc($Database->SQLCommand($sql)); 303 $DbResult = $System->Database->query($sql); 304 $DbRow = $DbResult->fetch_assoc(); 302 305 $BuildNumbers[$Version] = $DbRow['BuildNumber']; 303 306 } … … 307 310 function GetVersionWOW($BuildNumber) 308 311 { 309 global $ Database, $VersionsWOW;312 global $System, $VersionsWOW; 310 313 311 314 if(isset($VersionsWOW[$BuildNumber]) == false) 312 315 { 313 316 $sql = 'SELECT `Version` FROM `ClientVersion` WHERE `BuildNumber` = "'.$BuildNumber.'"'; 314 $Version = mysql_fetch_assoc($Database->SQLCommand($sql)); 317 $DbResult = $System->Database->query($sql); 318 $Version = $DbResult->fetch_assoc(); 315 319 $VersionsWOW[$BuildNumber] = $Version['Version']; 316 320 } … … 442 446 } 443 447 444 445 448 function GetTranslatNames($Text,$mode,$TablesColumn) 446 449 { 447 global $ Database;450 global $System; 448 451 449 452 /* $TablesID = array('gameobject' => 5, … … 482 485 } 483 486 } 484 $where = substr($where, 0,strlen($where)-4);487 $where = substr($where, 0, strlen($where) - 4); 485 488 $where .= ')'; 486 489 if ($SqlOK) { 487 $ ID = $Database->SQLCommand($sql.$where.$groupby);490 $DbResult = $System->Database->query($sql.$where.$groupby); 488 491 // echo ($sql.'|'.$where.'|'.$groupby); 489 while($Line = mysql_fetch_assoc($ID)) { 490 $buff[] = array($Line['ID'],GetIDbyName($Table),$Line[$Column],$Line['Tran']); 492 while($Line = $DbResult->fetch_assoc()) 493 { 494 $buff[] = array($Line['ID'], GetIDbyName($Table), $Line[$Column], $Line['Tran']); 491 495 } 492 496 } -
trunk/includes/system.php
r426 r455 1 1 <?php 2 2 3 //include_once('database.php');3 include_once('Database.php'); 4 4 5 5 class Module … … 22 22 var $Config; 23 23 24 function __construct() 25 { 26 $this->Database = new Database(); 27 $this->Config = array(); 28 } 29 24 30 function Init() 25 31 { 26 32 include('config.php'); 27 33 $this->Config = $Config; 28 $this->Database = new mysqli($this->Config['Database']['Host'], $this->Config['Database']['User'], $this->Config['Database']['Password'], $this->Config['Database']['Database']); 29 $this->Database->query('SET NAMES '.$this->Config['Database']['Charset']); 34 $this->Database->HostName = $this->Config['Database']['Host']; 35 $this->Database->UserName = $this->Config['Database']['User']; 36 $this->Database->Password = $this->Config['Database']['Password']; 37 $this->Database->Schema = $this->Config['Database']['Database']; 38 $this->Database->Charset = $this->Config['Database']['Charset']; 39 $this->Database->ShowSQLQuery = $this->Config['Web']['ShowSQLQuery']; 40 $this->Database->ShowSQLError = $this->Config['Web']['ShowSQLError']; 41 $this->Database->open(); 30 42 } 31 43 -
trunk/index.php
r436 r455 13 13 function ShowNews() 14 14 { 15 global $ Database;15 global $System; 16 16 17 17 $Output = '<strong>Změny systému:</strong><div class="NewsBox">'; 18 $DbResult = $ Database->SQLCommand('SELECT `News`.`Time`, `User`.`Name`, `News`.`Text` FROM `News` JOIN `User` ON `User`.`ID` = `News`.`User` ORDER BY `Time` DESC LIMIT 10');19 while($DbRow = mysql_fetch_assoc($DbResult))18 $DbResult = $System->Database->query('SELECT `News`.`Time`, `User`.`Name`, `News`.`Text` FROM `News` JOIN `User` ON `User`.`ID` = `News`.`User` ORDER BY `Time` DESC LIMIT 10'); 19 while($DbRow = $DbResult->fetch_assoc()) 20 20 $Output .= '<div><strong>'.$DbRow['Name'].' ('.HumanDate($DbRow['Time']).')</strong> <br />'.$DbRow['Text'].'</div>'; 21 21 $Output .= '<a href="action.php?action=news">Všechny zprávy</a>'; … … 56 56 function ShowRSSChannel() 57 57 { 58 global $ Database, $Config, $System;58 global $System, $Config, $System; 59 59 60 60 $Items = array(); 61 61 if($_GET['rss'] == 'news') 62 62 { 63 $DbResult = $ Database->SQLCommand('SELECT UNIX_TIMESTAMP(`News`.`Time`) AS `UnixTime`, `News`.`Time`, `User`.`Name`, `News`.`Text` FROM `News` JOIN `User` ON `User`.`ID` = `News`.`User` ORDER BY `Time` DESC LIMIT 10');64 while($DbRow = mysql_fetch_assoc($DbResult))63 $DbResult = $System->Database->query('SELECT UNIX_TIMESTAMP(`News`.`Time`) AS `UnixTime`, `News`.`Time`, `User`.`Name`, `News`.`Text` FROM `News` JOIN `User` ON `User`.`ID` = `News`.`User` ORDER BY `Time` DESC LIMIT 10'); 64 while($DbRow = $DbResult->fetch_assoc()) 65 65 { 66 66 $Items[] = array … … 83 83 if($_GET['rss'] == 'translation') 84 84 { 85 $DbResult = $ Database->SQLCommand('SELECT UNIX_TIMESTAMP(`Date`) AS `Date`, `User`.`Name` AS `UserName`, `Text` FROM `Log` JOIN `User` ON `User`.`ID` = `Log`.`User` WHERE `Type` = 1 ORDER BY `Date` DESC LIMIT 100');86 while($DbRow = mysql_fetch_assoc($DbResult))85 $DbResult = $System->Database->query('SELECT UNIX_TIMESTAMP(`Date`) AS `Date`, `User`.`Name` AS `UserName`, `Text` FROM `Log` JOIN `User` ON `User`.`ID` = `Log`.`User` WHERE `Type` = 1 ORDER BY `Date` DESC LIMIT 100'); 86 while($DbRow = $DbResult->fetch_assoc()) 87 87 { 88 88 $Items[] = array … … 107 107 $TitleLength = 50; 108 108 mb_internal_encoding('utf-8'); 109 $DbResult = $ Database->SQLCommand('SELECT UNIX_TIMESTAMP(`Date`) AS `UnixDate`, `User`, `Text` FROM `ShoutBox` ORDER BY `ID` DESC LIMIT 20');110 while($DbRow = mysql_fetch_assoc($DbResult))109 $DbResult = $Sytem->Database->query('SELECT UNIX_TIMESTAMP(`Date`) AS `UnixDate`, `User`, `Text` FROM `ShoutBox` ORDER BY `ID` DESC LIMIT 20'); 110 while($DbRow = $DbResult->fetch_assoc()) 111 111 { 112 112 $Title = mb_substr($DbRow['Text'], 0, $TitleLength); -
trunk/log.php
r444 r455 9 9 else $Where = ''; 10 10 $sql = 'SELECT *, UNIX_TIMESTAMP(`Date`) AS `TimeCreate`, (SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `Log`.`User`) AS `User` FROM `Log`'.$Where.' ORDER BY `Date` DESC LIMIT 100'; 11 $ ID = $Database->SQLCommand($sql);12 while($Line = mysql_fetch_assoc($ID))11 $DbResult = $System->Database->query($sql); 12 while($Line = $DbResult->fetch_assoc()) 13 13 { 14 $DbResult = $Database->SQLCommand('SELECT * FROM `LogType` WHERE `Id`='.$Line['Type']);15 $LogType = mysql_fetch_assoc($DbResult);14 $DbResult2 = $System->Database->query('SELECT * FROM `LogType` WHERE `Id`='.$Line['Type']); 15 $LogType = $DbResult2->fetch_assoc(); 16 16 17 17 $Items[] = array … … 49 49 echo('<strong>Filtr: </strong>'); 50 50 echo('<span style="color:black"><a href="log.php?type=" title="Bez filtrování">Všechny</a></span> '); 51 $DbResult = $ Database->SQLCommand('SELECT * FROM `LogType`');52 while($LogType = mysql_fetch_assoc($DbResult))51 $DbResult = $System->Database->query('SELECT * FROM `LogType`'); 52 while($LogType = $DbResult->fetch_assoc()) 53 53 { 54 54 echo('<a href="log.php?type='.$LogType['Id'].'" style="color:'.$LogType['Color'].'" title="'.$LogType['Name'].'">'.$LogType['Name'].'</a> '); … … 66 66 //if(($Where != '') and (array_key_exists('group', $_SESSION))) $Where .= ' AND text LIKE "%'.$TranslationTree[$_SESSION['group']]['Name'].'%"'; 67 67 68 $DbResult = $ Database->SQLCommand('SELECT COUNT(*) FROM `Log` '.$Where);69 $DbRow = mysql_fetch_row($DbResult);68 $DbResult = $System->Database->query('SELECT COUNT(*) FROM `Log` '.$Where); 69 $DbRow = $DbResult->fetch_row(); 70 70 $PageList = GetPageList($DbRow[0]); 71 71 … … 84 84 $sql = 'SELECT *, `LogType`.`Color` AS `LogColor`, (SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `Log`.`User`) AS `UserName` FROM `Log` LEFT JOIN `LogType` ON `LogType`.`Id`=`Log`.`Type` '.$Where.$Order['SQL'].$PageList['SQLLimit']; 85 85 //echo($sql); 86 $ ID = $Database->SQLCommand($sql);87 while($Line = mysql_fetch_assoc($ID))86 $DbResult = $System->Database->query($sql); 87 while($Line = $DbResult->fetch_assoc()) 88 88 { 89 89 echo('<tr><td>'.$Line['Date'].'</td><td><span style="color: '.$Line['LogColor'].'">'.$Line['Text'].'</span></td><td>'.$Line['UserName'].'</td><td>'.$Line['IP'].'</td></tr>'); -
trunk/registrace.php
r420 r455 22 22 if($Pass == $Pass2) 23 23 { 24 $Line = mysql_fetch_row($Database->SQLCommand('SELECT * FROM `User` WHERE `Name` = "'.$UserName.'"')); 24 $DbResult = $System->Database->query('SELECT * FROM `User` WHERE `Name` = "'.$UserName.'"'); 25 $Line = $DbResult->fetch_row(); 25 26 if(!$Line) 26 27 { 27 28 $Salt = $User->GetPasswordSalt(); 28 $ Database->SQLCommand('INSERT INTO `User` (`Name` , `Pass` , `Salt`, `LastIP` , `LastLogin` , `Email` , `Language` , `Team` , `NeedUpdate`, `RegistrationTime` ) VALUES ("'.$UserName.'", '.$User->CryptPasswordSQL('"'.$Pass.'"', '"'.$Salt.'"').', "'.$Salt.'", "'.$_SERVER['REMOTE_ADDR'].'", NOW(), "'.$Email.'", '.$Language.', '.$Team.', 1, NOW())');29 $System->Database->query('INSERT INTO `User` (`Name` , `Pass` , `Salt`, `LastIP` , `LastLogin` , `Email` , `Language` , `Team` , `NeedUpdate`, `RegistrationTime` ) VALUES ("'.$UserName.'", '.$User->CryptPasswordSQL('"'.$Pass.'"', '"'.$Salt.'"').', "'.$Salt.'", "'.$_SERVER['REMOTE_ADDR'].'", NOW(), "'.$Email.'", '.$Language.', '.$Team.', 1, NOW())'); 29 30 $Message = 'Registrace proběhla úspěšně.<br /><br/>'. 30 'Přečtěte si pozorně <a href="'.$System->Link('/info.php').' </a>">pokyny pro překladání</a> a můžete pak hned začít překládat.';31 'Přečtěte si pozorně <a href="'.$System->Link('/info.php').'">pokyny pro překladání</a> a můžete pak hned začít překládat.'; 31 32 $User->Login($UserName, $Pass); 32 33 WriteLog('Uživatel se zaregistroval: '.$UserName, LOG_TYPE_USER); … … 74 75 <td><select name="Team"><option value="0">Žádného</option> 75 76 '); 76 $ ID = $Database->SQLCommand('SELECT `Name`, `Id` FROM `Team`');77 while($Line = mysql_fetch_assoc($ID))77 $DbResult = $System->Database->query('SELECT `Name`, `Id` FROM `Team`'); 78 while($Line = $DbResult->fetch_assoc()) 78 79 { 79 80 echo('<option value="0'.$Line['Id'].'">'.$Line['Name'].'</option>'); -
trunk/save.php
r436 r455 155 155 $next = FollowingTran($TextID, $Table, $GroupId); 156 156 echo('<br /><br />'); 157 $redirecting = mysql_fetch_assoc($Database->SQLCommand('SELECT `Redirecting` FROM `User` WHERE `ID`='.$User->Id)); 157 $DbResult = $System->Database->query('SELECT `Redirecting` FROM `User` WHERE `ID`='.$User->Id) 158 $redirecting = $DbResult->fetch_assoc(); 158 159 159 160 switch($redirecting['Redirecting']) … … 181 182 182 183 // Aktualizace informace o nutnosti načíst XP 183 $ Database->SQLCommand('UPDATE `User` SET `NeedUpdate` = 1 WHERE `ID` = '.$User->Id);184 $System->Database->query('UPDATE `User` SET `NeedUpdate` = 1 WHERE `ID` = '.$User->Id); 184 185 } else echo('Položka nenalezena'); 185 186 } else -
trunk/statistic.php
r450 r455 8 8 function ShowStatTable() 9 9 { 10 global $ Database, $Config;10 global $System; 11 11 12 12 $LanguageId = LoadLanguageIdParameter(); … … 15 15 $GroupListQuery = 'SELECT `Group`.* FROM `Group`'; 16 16 $Query = ''; 17 $DbResult = $ Database->SQLCommand($GroupListQuery);18 while($DbRow = mysql_fetch_assoc($DbResult))17 $DbResult = $System->Database->query($GroupListQuery); 18 while($DbRow = $DbResult->fetch_assoc()) 19 19 { 20 20 $Query .= 'SELECT (SELECT COUNT(DISTINCT(`Entry`)) FROM ('. … … 29 29 $Query = substr($Query, 0, - 6); 30 30 31 $DbResult = $ Database->SQLCommand('SELECT COUNT(*) FROM ('.$GroupListQuery.') AS `T`');32 $DbRow = mysql_fetch_row($DbResult);31 $DbResult = $System->Database->query('SELECT COUNT(*) FROM ('.$GroupListQuery.') AS `T`'); 32 $DbRow = $DbResult->fetch_row(); 33 33 $PageList = GetPageList($DbRow[0]); 34 34 echo($PageList['Output']); … … 47 47 $Translated = 0; 48 48 $Total = 0; 49 $ ID = $Database->SQLCommand('SELECT *, ROUND(`Translated` / `Total` * 100, 2) AS `Percent` FROM ('.$Query.') AS `C3` '.$Order['SQL'].$PageList['SQLLimit']);50 while($Group = mysql_fetch_assoc($ID))49 $DbResult = $System->Database->query('SELECT *, ROUND(`Translated` / `Total` * 100, 2) AS `Percent` FROM ('.$Query.') AS `C3` '.$Order['SQL'].$PageList['SQLLimit']); 50 while($Group = $DbResult->fetch_assoc()) 51 51 { 52 52 echo('<tr><td>'.$Group['Name'].'</td><td>'.$Group['Translated'].'</td><td>'.$Group['Total'].'</td><td>'.ProgressBar(150, $Group['Percent']).'</td></tr>'); … … 83 83 <div>Počet stáhnutí přeložených textů v SQL souboru: <strong>'); 84 84 85 $ID = $ Database->SQLCommand('SELECT count(distinct(`IP`)) FROM `Log` WHERE `Type` = 2');86 $Line = mysql_fetch_row($ID);85 $ID = $System->Database->query('SELECT count(distinct(`IP`)) FROM `Log` WHERE `Type` = 2'); 86 $Line = $ID->fetch_row(); 87 87 echo($Line[0]); 88 88 … … 90 90 <div>Počet stáhnutí: <strong>'); 91 91 92 $ID = $ Database->SQLCommand('SELECT count(distinct(`IP`)) FROM `Log` WHERE `Type` = 0');93 $Line = mysql_fetch_row($ID);92 $ID = $System->Database->query('SELECT count(distinct(`IP`)) FROM `Log` WHERE `Type` = 0'); 93 $Line = $ID->fetch_row(); 94 94 echo($Line[0]); 95 95 -
trunk/team.php
r411 r455 8 8 function ShowTeamList() 9 9 { 10 global $Config, $ Database, $User;10 global $Config, $System, $User; 11 11 12 12 echo('<h3>Seznam překladatelských týmů</h3>'); 13 13 echo('Týmy jsou seskupení překladatelů, kteří se hlásí k něčemu společnému jako např. WoW serveru, způsobu překladu, ke stejnému hernímu spolku, aj. Být členem týmu samo o sobě nemá žádný zásadní důsledek a spíše to může pomoci se lépe orientovat mezi překladateli někomu, kdo sestavuje export.<br/>'); 14 $DbResult = $ Database->SQLCommand('SELECT COUNT(*) FROM `Team`');15 $DbRow = mysql_fetch_row($DbResult);14 $DbResult = $System->Database->query('SELECT COUNT(*) FROM `Team`'); 15 $DbRow = $DbResult->fetch_row(); 16 16 $PageList = GetPageList($DbRow[0]); 17 17 … … 35 35 if (array_key_exists('search', $_GET) and ($_GET['search'] == '')) $_SESSION['search'] = ''; 36 36 37 $ ID = $Database->SQLCommand('SELECT *, (SELECT COUNT(*) FROM `User` WHERE `User`.`Team` = `Team`.`Id`) AS `NumberUser`, (SELECT `Name` FROM `User` WHERE `User`.`ID`=`Team`.`Leader`) AS `LeaderName` FROM `Team` '.$_SESSION['search'].$Order['SQL'].$PageList['SQLLimit']);38 while($Team = mysql_fetch_assoc($ID))37 $DbResult = $System->Database->query('SELECT *, (SELECT COUNT(*) FROM `User` WHERE `User`.`Team` = `Team`.`Id`) AS `NumberUser`, (SELECT `Name` FROM `User` WHERE `User`.`ID`=`Team`.`Leader`) AS `LeaderName` FROM `Team` '.$_SESSION['search'].$Order['SQL'].$PageList['SQLLimit']); 38 while($Team = $DbResult->fetch_assoc()) 39 39 { 40 40 echo('<tr>'. … … 61 61 function TeamJoin() 62 62 { 63 global $ Database, $User;63 global $System, $User; 64 64 65 65 if($User->Licence(LICENCE_USER)) … … 67 67 if(array_key_exists('id', $_GET)) 68 68 { 69 $ Database->SQLCommand('UPDATE `User` SET `Team` = '.$_GET['id'].' WHERE `ID` = '.$User->Id);69 $System->Database->query('UPDATE `User` SET `Team` = '.$_GET['id'].' WHERE `ID` = '.$User->Id); 70 70 echo('<strong>Vstoupil jsi do týmu</strong><br /><br />'); 71 71 WriteLog('Uživatel vstoupil do týmu '.$_GET['id'], LOG_TYPE_USER); 72 72 73 73 // Delete all teams without users 74 $ Database->SQLCommand('DELETE FROM `Team` WHERE (SELECT COUNT(*) FROM `User` WHERE `User`.`Team` = `Team`.`Id`) = 0');74 $System->Database->query('DELETE FROM `Team` WHERE (SELECT COUNT(*) FROM `User` WHERE `User`.`Team` = `Team`.`Id`) = 0'); 75 75 76 76 // Set new leader for teams where old leader went to other team 77 $ Database->SQLCommand('UPDATE `Team` SET `Leader`=(SELECT `Id` FROM `User` WHERE `User`.`Team`=`Team`.`Id` ORDER BY `User`.`RegistrationTime` LIMIT 1) WHERE `Leader` NOT IN (SELECT `ID` FROM `User` WHERE `User`.`Team`=`Team`.`Id`);');77 $System->Database->query('UPDATE `Team` SET `Leader`=(SELECT `Id` FROM `User` WHERE `User`.`Team`=`Team`.`Id` ORDER BY `User`.`RegistrationTime` LIMIT 1) WHERE `Leader` NOT IN (SELECT `ID` FROM `User` WHERE `User`.`Team`=`Team`.`Id`);'); 78 78 79 79 ShowTeamList(); … … 84 84 function TeamCreateFinish() 85 85 { 86 global $ Database, $User;86 global $System, $User; 87 87 88 88 if($User->Licence(LICENCE_USER)) … … 90 90 if(array_key_exists('Name', $_POST) and array_key_exists('Description', $_POST)) 91 91 { 92 $DbResult = $ Database->SQLCommand('SELECT COUNT(*) FROM `Team` WHERE `Name` = "'.trim($_POST['Name']).'"');93 $DbRow = mysql_fetch_row($DbResult);92 $DbResult = $System->Database->query('SELECT COUNT(*) FROM `Team` WHERE `Name` = "'.trim($_POST['Name']).'"'); 93 $DbRow = $DbResult->fetch_row(); 94 94 $Count = $DbRow[0]; 95 95 if(($Count == 0) and ($_POST['Name'] != '')) 96 96 { 97 $ Database->SQLCommand('INSERT INTO `Team` (`Name` ,`Description`, `URL`, `TimeCreate`,`Leader`) VALUES ("'.trim($_POST['Name']).'", "'.trim($_POST['Description']).'", "'.$_POST['URL'].'", NOW(), '.$User->Id.')');98 $ Database->SQLCommand('UPDATE `User` SET `Team` = '.mysql_insert_id().' WHERE `ID` = '.$User->Id);97 $System->Database->query('INSERT INTO `Team` (`Name` ,`Description`, `URL`, `TimeCreate`,`Leader`) VALUES ("'.trim($_POST['Name']).'", "'.trim($_POST['Description']).'", "'.$_POST['URL'].'", NOW(), '.$User->Id.')'); 98 $System->Database->query('UPDATE `User` SET `Team` = '.mysql_insert_id().' WHERE `ID` = '.$User->Id); 99 99 echo('<strong>Překladatelský tým vytvořen</strong><br /><br />'); 100 100 WriteLog('Překladatelský tým vytvořen '.$_POST['Name'], LOG_TYPE_USER); 101 101 102 102 // Delete all teams without users 103 $ Database->SQLCommand('DELETE FROM `Team` WHERE (SELECT COUNT(*) FROM `User` WHERE `User`.`Team` = `Team`.`Id`) = 0');103 $System->Database->query('DELETE FROM `Team` WHERE (SELECT COUNT(*) FROM `User` WHERE `User`.`Team` = `Team`.`Id`) = 0'); 104 104 } else echo('Již existuje tým se stejným jménem'); 105 105 } else echo('Chybí údaje formuláře'); … … 110 110 function TeamModify() 111 111 { 112 global $ Database, $User;112 global $System, $User; 113 113 114 114 if($User->Licence(LICENCE_USER)) … … 116 116 if(array_key_exists('id', $_GET)) 117 117 { 118 $DbResult = $ Database->SQLCommand('SELECT * FROM `Team` WHERE `Id`='.$_GET['id'].' AND `Leader`='.$User->Id);119 if( mysql_num_rows($DbResult)> 0)120 { 121 $Team = mysql_fetch_assoc($DbResult);118 $DbResult = $System->Database->query('SELECT * FROM `Team` WHERE `Id`='.$_GET['id'].' AND `Leader`='.$User->Id); 119 if($DbResult->num_rows > 0) 120 { 121 $Team = $DbResult->fetch_assoc(); 122 122 echo('<form action="?action=finish_modify&id='.$_GET['id'].'" method="post">'. 123 123 '<fieldset><legend>Nastavení týmu</legend>'. … … 134 134 function TeamModifyFinish() 135 135 { 136 global $ Database, $User;136 global $System, $User; 137 137 138 138 if($User->Licence(LICENCE_USER)) … … 140 140 if(array_key_exists('id', $_GET) and array_key_exists('Name', $_POST) and array_key_exists('Description', $_POST) and array_key_exists('URL', $_POST)) 141 141 { 142 $DbResult = $ Database->SQLCommand('SELECT * FROM `Team` WHERE `Id`='.$_GET['id'].' AND `Leader`='.$User->Id);143 if( mysql_num_rows($DbResult)> 0)144 { 145 $Team = mysql_fetch_assoc($DbResult);146 $DbResult = $ Database->SQLCommand('SELECT COUNT(*) FROM `Team` WHERE `Name` = "'.trim($_POST['Name']).'"');147 $DbRow = mysql_fetch_row($DbResult);142 $DbResult = $System->Database->query('SELECT * FROM `Team` WHERE `Id`='.$_GET['id'].' AND `Leader`='.$User->Id); 143 if($DbResult->num_rows > 0) 144 { 145 $Team = $DbResult->fetch_assoc(); 146 $DbResult = $System->Database->query('SELECT COUNT(*) FROM `Team` WHERE `Name` = "'.trim($_POST['Name']).'"'); 147 $DbRow = $DbResult->fetch_row(); 148 148 $Count = $DbRow[0]; 149 149 if(($Count == 0) and ($_POST['Name'] != '')) 150 150 { 151 $ Database->SQLCommand('UPDATE `Team` SET `Name`="'.$_POST['Name'].'", `Description`="'.$_POST['Description'].'", `URL`="'.$_POST['URL'].'" WHERE Id='.$Team['Id']);151 $System->Database->query('UPDATE `Team` SET `Name`="'.$_POST['Name'].'", `Description`="'.$_POST['Description'].'", `URL`="'.$_POST['URL'].'" WHERE Id='.$Team['Id']); 152 152 echo('Nastavení týmu uloženo.<br/>'); 153 153 WriteLog('Překladatelský tým upraven '.$_POST['Name'], LOG_TYPE_USER); … … 177 177 function TeamShow() 178 178 { 179 global $ Database, $TranslationTree, $User, $Config;179 global $System, $TranslationTree, $User, $Config; 180 180 181 181 if(array_key_exists('id', $_GET) and is_numeric($_GET['id'])) … … 183 183 ImgLevelUpdate(); 184 184 185 $DbResult = $ Database->SQLCommand('SELECT *, (SELECT COUNT(*) FROM `User` WHERE `Team` = `Team`.`Id`) AS `NumberUser`, (SELECT SUM(`TranslatedCount`) FROM `User` WHERE `team` = `Team`.`Id`) AS `NumberTranslate` FROM `Team` WHERE `Id`='.$_GET['id']);186 if( mysql_num_rows($DbResult)> 0)187 { 188 $Team = mysql_fetch_assoc($DbResult);189 $DbResult = $Database->SQLCommand('SELECT `Name` FROM `User` WHERE `ID`='.$Team['Leader']);190 if( mysql_num_rows($DbResult)> 0)191 { 192 $Leader = mysql_fetch_assoc($DbResult);185 $DbResult = $System->Database->query('SELECT *, (SELECT COUNT(*) FROM `User` WHERE `Team` = `Team`.`Id`) AS `NumberUser`, (SELECT SUM(`TranslatedCount`) FROM `User` WHERE `team` = `Team`.`Id`) AS `NumberTranslate` FROM `Team` WHERE `Id`='.$_GET['id']); 186 if($DbResult->num_rows > 0) 187 { 188 $Team = $DbResult->fetch_assoc(); 189 $DbResult2 = $System->Database->query('SELECT `Name` FROM `User` WHERE `ID`='.$Team['Leader']); 190 if($DbResult2->num_rows > 0) 191 { 192 $Leader = $DbResult2->fetch_assoc(); 193 193 $Leader = $Leader['Name']; 194 194 } else $Leader = ''; … … 210 210 $GroupListQuery = 'SELECT `Group`.* FROM `Group`'; 211 211 $Query = ''; 212 $DbResult = $ Database->SQLCommand($GroupListQuery);213 while($DbRow = mysql_fetch_assoc($DbResult))212 $DbResult = $System->Database->query($GroupListQuery); 213 while($DbRow = $DbResult->fetch_assoc()) 214 214 { 215 215 $Query .= 'SELECT (SELECT COUNT(DISTINCT(`Entry`)) FROM ('. … … 224 224 $Query = substr($Query, 0, - 6); 225 225 226 $DbResult = $ Database->SQLCommand('SELECT COUNT(*) FROM ('.$GroupListQuery.') AS `T`');227 $DbRow = mysql_fetch_row($DbResult);226 $DbResult = $System->Database->query('SELECT COUNT(*) FROM ('.$GroupListQuery.') AS `T`'); 227 $DbRow = $DbResult->fetch_row(); 228 228 $PageList = GetPageList($DbRow[0]); 229 229 echo($PageList['Output']); … … 242 242 $Translated = 0; 243 243 $Total = 0; 244 $ ID = $Database->SQLCommand('SELECT *, ROUND(`Translated` / `Total` * 100, 2) AS `Percent` FROM ('.$Query.') AS `C3` '.$Order['SQL'].$PageList['SQLLimit']);245 while($Group = mysql_fetch_assoc($ID))244 $DbResult = $System->Database->query('SELECT *, ROUND(`Translated` / `Total` * 100, 2) AS `Percent` FROM ('.$Query.') AS `C3` '.$Order['SQL'].$PageList['SQLLimit']); 245 while($Group = $DbResult->fetch_assoc()) 246 246 { 247 247 echo('<tr><td>'.$Group['Name'].'</td><td>'.$Group['Translated'].'</td><td>'.$Group['Total'].'</td><td>'.ProgressBar(150, $Group['Percent']).'</td></tr>'); … … 259 259 function TeamLeave() 260 260 { 261 global $ Database, $User;262 263 if($User->Licence(LICENCE_USER)) 264 { 265 $ Database->SQLCommand('UPDATE `User` SET `Team` = 0 WHERE `ID` = '.$User->Id);261 global $System, $User; 262 263 if($User->Licence(LICENCE_USER)) 264 { 265 $System->Database->query('UPDATE `User` SET `Team` = 0 WHERE `ID` = '.$User->Id); 266 266 echo('<strong>Nyní nejste členem žádného týmu</strong><br /><br />'); 267 267 WriteLog('Uživatel vystoupil z týmu', LOG_TYPE_USER); 268 268 269 269 // Delete all teams without users 270 $ Database->SQLCommand('DELETE FROM `Team` WHERE (SELECT COUNT(*) FROM `User` WHERE `User`.`Team` = `Team`.`Id`) = 0');270 $System->Database->query('DELETE FROM `Team` WHERE (SELECT COUNT(*) FROM `User` WHERE `User`.`Team` = `Team`.`Id`) = 0'); 271 271 272 272 // Set new leader for teams where old leader went to other team 273 $ Database->SQLCommand('UPDATE `Team` SET `Leader`=(SELECT `Id` FROM `User` WHERE `User`.`Team`=`Team`.`Id` ORDER BY `User`.`RegistrationTime` LIMIT 1) WHERE `Leader` NOT IN (SELECT `ID` FROM `User` WHERE `User`.`Team`=`Team`.`Id`);');273 $System->Database->query('UPDATE `Team` SET `Leader`=(SELECT `Id` FROM `User` WHERE `User`.`Team`=`Team`.`Id` ORDER BY `User`.`RegistrationTime` LIMIT 1) WHERE `Leader` NOT IN (SELECT `ID` FROM `User` WHERE `User`.`Team`=`Team`.`Id`);'); 274 274 275 275 ShowTeamList(); -
trunk/user.php
r436 r455 24 24 { 25 25 $Query = 'SELECT * FROM `User` WHERE `ID` = '.$_GET['user']; 26 $UserLine = mysql_fetch_array($Database->SQLCommand($Query)); 26 $DbResult = $System->Database->query($Query); 27 $UserLine = $DbResult->fetch_array(); 27 28 28 29 echo('ID: <strong>'.$UserLine['ID'].'</strong><br />'); -
trunk/userlist.php
r436 r455 26 26 //if($_SESSION['Where'] <> '') echo(' <a href="?action=nofilter">Zrušit filtr uživatelů</a><br />'); 27 27 28 $DbResult = $ Database->SQLCommand('SELECT COUNT(*) FROM `User`'.$_SESSION['Where']);29 $DbRow = mysql_fetch_row($DbResult);28 $DbResult = $System->Database->query('SELECT COUNT(*) FROM `User`'.$_SESSION['Where']); 29 $DbRow = $DbResult->fetch_row(); 30 30 $PageList = GetPageList($DbRow[0]); 31 31 … … 48 48 $Query = 'SELECT `ID`, `User`.`Name`, `LastLogin`, `GM`, `XP`, `TranslatedCount`, `RegistrationTime` FROM `User` '.$_SESSION['Where'].$Order['SQL'].$PageList['SQLLimit']; 49 49 50 $ ID = $Database->SQLCommand($Query);51 while($Line = mysql_fetch_assoc($ID))50 $DbResult = $System->Database->query($Query); 51 while($Line = $DbResult->fetch_assoc()) 52 52 { 53 53 if($User->Licence(LICENCE_MODERATOR)) -
trunk/version.php
r366 r455 5 5 ShowPage(); 6 6 7 $DbResult = $ Database->SQLCommand('SELECT COUNT(*) FROM `ClientVersion`');8 $DbRow = mysql_fetch_row($DbResult);7 $DbResult = $System->Database->query('SELECT COUNT(*) FROM `ClientVersion`'); 8 $DbRow = $DbResult->fetch_row(); 9 9 $PageList = GetPageList($DbRow[0]); 10 10 … … 22 22 echo($Order['Output']); 23 23 24 $DbResult = $ Database->SQLCommand('SELECT * FROM ClientVersion '.$Order['SQL'].$PageList['SQLLimit']);25 while($Version = mysql_fetch_assoc($DbResult))24 $DbResult = $System->Database->query('SELECT * FROM ClientVersion '.$Order['SQL'].$PageList['SQLLimit']); 25 while($Version = $DbResult->fetch_assoc()) 26 26 { 27 27 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></tr>');
Note:
See TracChangeset
for help on using the changeset viewer.