Changeset 455 for trunk/export
- Timestamp:
- Apr 13, 2010, 10:03:12 AM (15 years ago)
- Location:
- trunk/export
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note:
See TracChangeset
for help on using the changeset viewer.