Changeset 366
- Timestamp:
- Mar 9, 2010, 1:01:14 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 1 deleted
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/TranslationList.php
r365 r366 187 187 global $Database; 188 188 189 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ` group`');189 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `Group`'); 190 190 $DbRow = mysql_fetch_row($DbResult); 191 191 $PageList = GetPageList($DbRow[0]); … … 206 206 echo($Order['Output']); 207 207 208 $ID = $Database->SQLCommand('SELECT * FROM ` group`'.$Order['SQL'].$PageList['SQLLimit']);208 $ID = $Database->SQLCommand('SELECT * FROM `Group`'.$Order['SQL'].$PageList['SQLLimit']); 209 209 while($Group = mysql_fetch_assoc($ID)) 210 210 { -
trunk/action.php
r365 r366 31 31 $Line = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM `Team` WHERE `Name` LIKE "%'.$Search.'%" OR `Description` LIKE "%'.$Search.'%"')); 32 32 echo('<tr><td><a href="team.php?search='.$Search.'">Týmy</a></td><td>'.$Line[0].'</td></tr>'); 33 $Line = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM ` verseclient` WHERE `text` LIKE "%'.$Search.'%"'));33 $Line = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM `CzWoWPackageVersion` WHERE `Text` LIKE "%'.$Search.'%"')); 34 34 echo('<tr><td><a href="download.php?addon">Čeština pro klienta</a></td><td>'.$Line[0].'</td></tr>'); 35 35 echo('<tr><td><a href="aowow/?search='.$Search.'">Vyhledávací databáze AoWoW</a></td></tr>'); -
trunk/dictionary.php
r365 r366 41 41 foreach($TablesColumn as $Table => $Column) 42 42 { 43 $sql = 'SELECT `ID`,'.$Column.',(SELECT `Name` FROM '.$Table.' AS `T` WHERE `O`.` entry` = `T`.`entry` AND `Language` <> 0 LIMIT 1) AS `tran` FROM `'.$Table.'` AS `O` WHERE ';43 $sql = 'SELECT `ID`,'.$Column.',(SELECT `Name` FROM '.$Table.' AS `T` WHERE `O`.`Entry` = `T`.`Entry` AND `Language` <> 0 LIMIT 1) AS `Tran` FROM `'.$Table.'` AS `O` WHERE '; 44 44 $groupby = ' GROUP BY `'.$Column.'`'; 45 45 46 46 $ArrStr = explode(' ', $Text); 47 $where = ' Language= 0 ';48 if ($mode == 1) $where .= ' AND EXISTS(SELECT 1 FROM '.$Table.' AS sub WHERE (sub.Language <> 0) AND (sub.entry = O.entry))';49 if ($mode == 2) $where .= ' AND NOT EXISTS(SELECT 1 FROM '.$Table.' AS sub WHERE (sub.Language <> 0) AND (sub.entry = O.entry))';47 $where = '`Language` = 0 '; 48 if ($mode == 1) $where .= ' AND EXISTS(SELECT 1 FROM `'.$Table.'` AS `Sub` WHERE (`Sub`.`Language` <> 0) AND (`Sub`.`Entry` = `O`.`Entry`))'; 49 if ($mode == 2) $where .= ' AND NOT EXISTS(SELECT 1 FROM `'.$Table.'` AS `Sub` WHERE (`Sub`.`Language` <> 0) AND (`Sub`.`Entry` = `O`.`Entry`))'; 50 50 $where .= ' AND ('; 51 51 -
trunk/download.php
r365 r366 31 31 if (array_key_exists('createverse', $_GET) and Licence(LICENCE_ADMIN)) { 32 32 if (array_key_exists('verse', $_POST)) { //ukládání 33 $Database->SQLCommand('INSERT INTO ` verseclient` (`verse` ,`date` ,`text` ,`User`)33 $Database->SQLCommand('INSERT INTO `CzWoWPackageVersion` (`Version` ,`Date` ,`Text` ,`User`) 34 34 VALUES ( "'.$_POST['verse'].'", NOW( ) , "'.$_POST['text'].'", "'.$_SESSION['UserID'].'");'); 35 35 WriteLog('Nová verze ('.$_POST['verse'].') češtiny pro clienta uložena.', LOG_TYPE_MODERATOR); … … 43 43 $Tables = 'Texty obsažené v addonu: Přeložené/nepřeložené ProcentaPřeložených% 44 44 '; 45 foreach($ExportSetting['groups'] as $Index) $Tables .= GetPercentOfTable($Index, implode(',', $ExportSetting['users-selection']));45 foreach($ExportSetting['groups'] as $Index) $Tables .= GetPercentOfTable($Index, implode(',', $ExportSetting['users-selection'])); 46 46 47 47 $ID = $Database->SQLCommand('SELECT `Name` FROM `User` WHERE `ID` IN('.implode(',', $ExportSetting['users-selection']).')'); … … 62 62 echo('<br />Stažený soubor pouze rozbalte a zkopírujte do kořenové složky wow (C:\Program Files\World Of Warcraft\). Hru spouštějte přes soubor WoWME.exe <br /><br />'. 63 63 '<table class="BaseTable"><tr><th>Verze/datum</th><th>Popis</th></tr>'); 64 $ID = $Database->SQLCommand('SELECT * FROM ` verseclient` ORDER BY `Date` DESC');64 $ID = $Database->SQLCommand('SELECT * FROM `CzWoWPackageVersion` ORDER BY `Date` DESC'); 65 65 while($Line = mysql_fetch_assoc($ID)) 66 66 { 67 67 echo('<tr>'. 68 '<td><strong>'.$Line[' verse'].'</strong> <a href="tmp/Addon/CzWoW_'.$Line['verse'].'.zip">Stáhnout</a> <br />'.$Line['date'].'</td>'.69 '<td>'.str_replace( chr(13),'<br />',$Line['text']).'</td>');68 '<td><strong>'.$Line['Version'].'</strong> <a href="tmp/Addon/CzWoW_'.$Line['Version'].'.zip">Stáhnout</a> <br />'.$Line['Date'].'</td>'. 69 '<td>'.str_replace("\r", '<br />', $Line['Text']).'</td>'); 70 70 echo('</tr>'); 71 71 } -
trunk/export/create_addon.php
r334 r366 104 104 $CreatedFileListCount = array(); 105 105 106 $DbResult = $this->Database->query('SELECT ` group`.* FROM `ExportGroup` JOIN `group` ON `group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id.' AND `group`.`TablePrefix` != ""');106 $DbResult = $this->Database->query('SELECT `Group`.* FROM `ExportGroup` JOIN `Group` ON `Group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id.' AND `Group`.`TablePrefix` != ""'); 107 107 while($Group = $DbResult->fetch_assoc()) 108 108 { … … 123 123 $Buffer = 'CZWOW_'.$Column['AddonFileName'].'_count='.$FileIndex.';CZWOW_'.$Column['AddonFileName'].'_'.$FileIndex.'={'; 124 124 125 $Query = 'SELECT T2.'.$Column['Column'].' AS Translation, T3.'.$Column['Column'].' as Original FROM (SELECT T1.entry, T1.'.$Column['Column'].' FROM (SELECT entry,'.$Column['Column'].' FROM '.$Group['TablePrefix'].' WHERE (Complete = 1) AND VersionStart <= '.$this->ClientVersion['BuildNumber'].' AND VersionEnd >= '.$this->ClientVersion['BuildNumber'].' AND '.$this->WhereLang.' AND '.$this->WhereUsers.$this->OrderByUserList.') AS T1 GROUP BY T1.entry) as T2 JOIN '.$Group['TablePrefix'].' AS T3 ON (T2.entry = T3.entry) AND (T3.Language= 0)';125 $Query = 'SELECT `T2`.`'.$Column['Column'].'` AS `Translation`, `T3`.`'.$Column['Column'].'` AS `Original` FROM (SELECT `T1`.`Entry`, `T1`.`'.$Column['Column'].'` FROM (SELECT `Entry`,`'.$Column['Column'].'` FROM `'.$Group['TablePrefix'].'` WHERE (`Complete` = 1) AND (`VersionStart` <= '.$this->ClientVersion['BuildNumber'].') AND (`VersionEnd` >= '.$this->ClientVersion['BuildNumber'].') AND '.$this->WhereLang.' AND '.$this->WhereUsers.$this->OrderByUserList.') AS `T1` GROUP BY `T1`.`Entry`) AS `T2` JOIN `'.$Group['TablePrefix'].'` AS `T3` ON (`T2`.`Entry` = `T3`.`Entry`) AND (`T3`.`Language` = 0)'; 126 126 $DbResult2 = $this->Database->query($Query); 127 127 128 128 129 129 if ($this->Database->affected_rows == 0) { 130 131 132 133 134 $Query = 'SELECT T2.'.$Column['Column'].' AS Translation, T3.'.$Column['Column'].' as Original FROM (SELECT T1.entry, T1.'.$Column['Column'].' FROM (SELECT entry,'.$Column['Column'].' FROM '.$Group['TablePrefix'].' WHERE (Complete = 1) AND VersionStart <= '.$BuildNumber_max.' AND VersionEnd >= '.$BuildNumber_max.' AND '.$this->WhereLang.' AND '.$this->WhereUsers.$this->OrderByUserList.') AS T1 GROUP BY T1.entry) as T2 JOIN '.$Group['TablePrefix'].' AS T3 ON (T2.entry = T3.entry) AND (T3.Language= 0)';130 $ID = $this->Database->query('SELECT MAX(`VersionEnd`) FROM `'.$Group['TablePrefix'].'`'); 131 $BuildNumber_max = $ID->fetch_assoc(); 132 $BuildNumber_max = $BuildNumber_max['MAX(`VersionEnd`)']; 133 134 $Query = 'SELECT `T2`.`'.$Column['Column'].'` AS `Translation`, `T3`.`'.$Column['Column'].'` AS `Original` FROM (SELECT `T1`.`Entry`, `T1`.`'.$Column['Column'].'` FROM (SELECT `Entry`,`'.$Column['Column'].'` FROM `'.$Group['TablePrefix'].'` WHERE (`Complete` = 1) AND (`VersionStart` <= '.$BuildNumber_max.') AND (`VersionEnd` >= '.$BuildNumber_max.') AND '.$this->WhereLang.' AND '.$this->WhereUsers.$this->OrderByUserList.') AS `T1` GROUP BY `T1`.`Entry`) AS `T2` JOIN `'.$Group['TablePrefix'].'` AS `T3` ON (`T2`.`Entry` = `T3`.`Entry`) AND (`T3`.`Language` = 0)'; 135 135 $DbResult2 = $this->Database->query($Query); 136 137 136 137 } 138 138 139 139 while($Line = $DbResult2->fetch_assoc()) … … 202 202 function MakeReadme() 203 203 { 204 $DbResult = $this->Database->query('SELECT * FROM verseclient ORDER BY DATEDESC');204 $DbResult = $this->Database->query('SELECT * FROM `CzWoWPackageVersion` ORDER BY `Date` DESC'); 205 205 $Line = $DbResult->fetch_assoc(); 206 206 … … 216 216 217 217 Verze: 218 Verze Addonu: '.$Line[' verse'].'218 Verze Addonu: '.$Line['Version'].' 219 219 Tato verze je pro verzi hry '.$this->ClientVersion['Version'].' 220 220 … … 222 222 223 223 '; 224 $DbResult = $Database->query('SELECT * FROM verseclient ORDER BY DATE 225 DESC'); 224 $DbResult = $Database->query('SELECT * FROM `CzWoWPackageVersion` ORDER BY `Date` DESC'); 226 225 while($Line = $DbResult->fetch_assoc()) 227 226 { 228 227 $Buffer .=' 229 Verze: '.$Line[' verse'].'228 Verze: '.$Line['Version'].' 230 229 ============= 231 230 '.$Line['text'].' -
trunk/export/create_mpq.php
r277 r366 2 2 3 3 //wine MPQEditor.exe /console script_create_mpq.txt 4 echo (exec('wine MPQEditor.exe /console script_create_mpq.txt')); 5 echo (exec('mkdir ../tmp/mpq')); 6 echo ('hotovo'); 4 echo(exec('wine MPQEditor.exe /console script_create_mpq.txt')); 5 echo(exec('mkdir ../tmp/mpq')); 6 echo('hotovo'); 7 7 8 ?> -
trunk/export/export.php
r365 r366 64 64 65 65 66 $DbResult = $this->Database->query('SELECT * FROM ` wow_client_version` WHERE `Id`='.$this->Export['ClientVersion']);66 $DbResult = $this->Database->query('SELECT * FROM `ClientVersion` WHERE `Id`='.$this->Export['ClientVersion']); 67 67 $this->ClientVersion = $DbResult->fetch_assoc(); 68 68 } … … 86 86 "-- Generované tabulky: "; 87 87 88 $DbResult = $this->Database->query('SELECT ` group`.* FROM `ExportGroup` JOIN `group` ON `group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id);88 $DbResult = $this->Database->query('SELECT `Group`.* FROM `ExportGroup` JOIN `Group` ON `Group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id); 89 89 while($Group = $DbResult->fetch_assoc()) 90 90 { … … 93 93 $Buffer .= "\n\n"; 94 94 95 $DbResult = $this->Database->query('SELECT ` group`.* FROM `ExportGroup` JOIN `group` ON `group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id);95 $DbResult = $this->Database->query('SELECT `Group`.* FROM `ExportGroup` JOIN `Group` ON `Group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id); 96 96 while($Group = $DbResult->fetch_assoc()) 97 97 { … … 195 195 " <translation>\n"; 196 196 197 $DbResult = $this->Database->query('SELECT ` group`.* FROM `ExportGroup` JOIN `group` ON `group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id);197 $DbResult = $this->Database->query('SELECT `Group`.* FROM `ExportGroup` JOIN `Group` ON `Group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id); 198 198 while($Group = $DbResult->fetch_assoc()) 199 199 { … … 233 233 $this->LoadFilters(); 234 234 235 $DbResult = $this->Database->query('SELECT ` group`.* FROM `ExportGroup` JOIN `group` ON `group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id.' AND `group`.`DBCFileName` != ""');235 $DbResult = $this->Database->query('SELECT `Group`.* FROM `ExportGroup` JOIN `Group` ON `Group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id.' AND `Group`.`DBCFileName` != ""'); 236 236 while($Group = $DbResult->fetch_assoc()) 237 237 { … … 278 278 $this->LoadFilters(); 279 279 280 $DbResult = $this->Database->query('SELECT ` group`.* FROM `ExportGroup` JOIN `group` ON `group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id.' AND `group`.`LuaFileName` != ""');280 $DbResult = $this->Database->query('SELECT `Group`.* FROM `ExportGroup` JOIN `Group` ON `Group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id.' AND `Group`.`LuaFileName` != ""'); 281 281 while($Group = $DbResult->fetch_assoc()) 282 282 { -
trunk/export/export_output.php
r357 r366 190 190 if(array_key_exists('Regenerate', $_POST)) 191 191 { 192 $Database->SQLCommand('UPDATE ExportTask SET TimeStart = NOW(), TimeFinish= NULL');192 $Database->SQLCommand('UPDATE `ExportTask` SET `TimeStart` = NOW(), `TimeFinish` = NULL'); 193 193 echo('Soubor zařazen znovu ke zpracování.<br/><br/>'); 194 194 } 195 $DbResult = $Database->SQLCommand('SELECT * FROM ExportTask WHERE Export= '.$ExportId);195 $DbResult = $Database->SQLCommand('SELECT * FROM `ExportTask` WHERE `Export` = '.$ExportId); 196 196 $ExportTask = mysql_fetch_assoc($DbResult); 197 197 if($ExportTask['TimeFinish'] > $ExportTask['TimeStart']) … … 201 201 $Export->Id = $ExportId; 202 202 $Export->Init(); 203 $DbResult = $System->Database->query('SELECT ` group`.* FROM `ExportGroup` JOIN `group` ON `group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$Export->Id.' AND `group`.`DBCFileName` != ""');203 $DbResult = $System->Database->query('SELECT `Group`.* FROM `ExportGroup` JOIN `Group` ON `Group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$Export->Id.' AND `Group`.`DBCFileName` != ""'); 204 204 while($Group = $DbResult->fetch_assoc()) 205 205 { … … 234 234 echo('<strong>Soubory:</strong><br/>'. 235 235 'Souhrný archív <a href="'.$SaveFilename.'">CzWoW_Lua.zip</a><br />'); 236 $DbResult = $System->Database->query('SELECT ` group`.* FROM `ExportGroup` JOIN `group` ON `group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$Export->Id.' AND `group`.`LuaFileName` != ""');236 $DbResult = $System->Database->query('SELECT `Group`.* FROM `ExportGroup` JOIN `Group` ON `Group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$Export->Id.' AND `Group`.`LuaFileName` != ""'); 237 237 while($Group = $DbResult->fetch_assoc()) 238 238 { -
trunk/export/index.php
r365 r366 127 127 if(array_key_exists('ExportId', $_GET)) 128 128 { 129 $DbRows = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId']);129 $DbRows = $Database->SQLCommand('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 130 130 if(mysql_num_rows($DbRows) > 0) 131 131 { … … 148 148 if(array_key_exists('sel'.$UserId, $_POST)) $Selected = true; 149 149 else $Selected = false; 150 $Condition = ' WHERE Export='.$_GET['ExportId'].' AND User='.$UserId;151 $DbResult = $Database->SQLCommand('SELECT * FROM ExportUser'.$Condition);150 $Condition = ' WHERE `Export`='.$_GET['ExportId'].' AND `User`='.$UserId; 151 $DbResult = $Database->SQLCommand('SELECT * FROM `ExportUser` '.$Condition); 152 152 if(mysql_num_rows($DbResult) > 0) 153 153 { 154 if(!$Selected) $Database->SQLCommand('DELETE FROM ExportUser'.$Condition);155 else $Database->SQLCommand('UPDATE ExportUser SET Sequence='.$Value.$Condition);154 if(!$Selected) $Database->SQLCommand('DELETE FROM `ExportUser` '.$Condition); 155 else $Database->SQLCommand('UPDATE `ExportUser` SET `Sequence`='.$Value.$Condition); 156 156 } else 157 157 { 158 if($Selected) $Database->SQLCommand('INSERT INTO ExportUser (Export, User, Sequence) VALUES ('.$_GET['ExportId'].', '.$UserId.', '.$Value.')');158 if($Selected) $Database->SQLCommand('INSERT INTO `ExportUser` (`Export`, `User`, `Sequence`) VALUES ('.$_GET['ExportId'].', '.$UserId.', '.$Value.')'); 159 159 } 160 160 } … … 163 163 // Recalculate sequence number 164 164 $Database->SQLCommand('SET @I = 0'); 165 $Database->SQLCommand('UPDATE ExportUser SET Sequence = (@I := @I + 1) WHERE Export='.$_GET['ExportId'].' ORDER BY Sequence;');165 $Database->SQLCommand('UPDATE `ExportUser` SET `Sequence` = (@I := @I + 1) WHERE `Export`='.$_GET['ExportId'].' ORDER BY `Sequence`;'); 166 166 } 167 167 } 168 168 169 169 $TableColumns = array( 170 array('Name' => ' user', 'Title' => 'Jméno'),170 array('Name' => 'Name', 'Title' => 'Jméno'), 171 171 array('Name' => 'TranslatedCount', 'Title' => 'Překladů'), 172 172 array('Name' => 'XP', 'Title' => 'Úroveň'), … … 201 201 echo($Order['Output']); 202 202 203 $Query = 'SELECT * FROM ('.$Query.') AS TX'.$Order['SQL'].$PageList['SQLLimit'];203 $Query = 'SELECT * FROM ('.$Query.') AS `TX` '.$Order['SQL'].$PageList['SQLLimit']; 204 204 $Database->SQLCommand('SET @I = 0'); 205 205 $DbResult = $Database->SQLCommand($Query); … … 396 396 } 397 397 398 $Query = 'SELECT ` group`.*, `ExportGroup`.`Id` AS `ExportGroupId` FROM `group` LEFT JOIN `ExportGroup` ON `ExportGroup`.`Export`='.$_GET['ExportId'].' AND `Group`=`group`.`Id`';398 $Query = 'SELECT `Group`.*, `ExportGroup`.`Id` AS `ExportGroupId` FROM `Group` LEFT JOIN `ExportGroup` ON `ExportGroup`.`Export`='.$_GET['ExportId'].' AND `Group`=`Group`.`Id`'; 399 399 400 400 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$Query.') AS X'); … … 505 505 $Export = mysql_fetch_assoc($DbResult); 506 506 507 $Query = 'SELECT ` wow_client_version`.* FROM `ExportVersion` LEFT JOIN `wow_client_version` ON `wow_client_version`.`Id`=`ExportVersion`.`ClientVersion` WHERE `ExportType`='.$Export['OutputType'];507 $Query = 'SELECT `ClientVersion`.* FROM `ExportVersion` LEFT JOIN `ClientVersion` ON `ClientVersion`.`Id`=`ExportVersion`.`ClientVersion` WHERE `ExportType`='.$Export['OutputType']; 508 508 509 509 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ('.$Query.') AS `X`'); -
trunk/export/process_aowow_export.php
r365 r366 64 64 65 65 // Update news date 66 $Database2->query( "UPDATE `aowow_news` SET `text_loc0` = 'Poslední aktualizace dat ".Date ("d. n. Y, H:i:s")." ', `text_loc8` = 'Poslední aktualizace dat ".Date ("d. n. Y, H:i:s")." ' WHERE `aowow_news`.`id` =3");66 $Database2->query('UPDATE `aowow_news` SET `text_loc0` = "Poslední aktualizace dat '.date('d. n. Y, H:i:s').'", `text_loc8` = "Poslední aktualizace dat '.date('d. n. Y, H:i:s').'" WHERE `aowow_news`.`id` =3'); 67 67 68 68 ?> -
trunk/export/process_task.php
r357 r366 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.TimeFinishIS NULL');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 15 while($DbRow = mysql_fetch_assoc($DbResult)) 16 16 { … … 34 34 echo('Hotovo'); 35 35 } else echo('Funkce pro tvorbu Zip souboru není podporována!'); 36 $Database->SQLCommand('UPDATE ExportTask SET TimeFinish=NOW() WHERE Export='.$Export->Id);36 $Database->SQLCommand('UPDATE `ExportTask` SET `TimeFinish`=NOW() WHERE `Export`='.$Export->Id); 37 37 } catch (Exception $e) 38 38 { … … 41 41 } else 42 42 { 43 $Database->SQLCommand('DELETE FROM ExportTask WHERE Export='.$DbRow['Export']);43 $Database->SQLCommand('DELETE FROM `ExportTask` WHERE `Export`='.$DbRow['Export']); 44 44 echo('Export '.$DbRow['Export'].' nenalezen. Jeho úloha smazána.'."\n"); 45 45 } -
trunk/import/cmd.php
r357 r366 20 20 if(strpos($parameter, '=') !== false) 21 21 { 22 $index = substr($parameter, 0,strpos($parameter, '='));23 $parameter = substr($parameter,strpos($parameter, '=')+1);24 //echo ($index.' ---- '.$parameter);22 $index = substr($parameter, 0, strpos($parameter, '=')); 23 $parameter = substr($parameter, strpos($parameter, '=') + 1); 24 //echo ($index.' ---- '.$parameter); 25 25 $_GET[$index] = $parameter; 26 26 } -
trunk/import/import_dbc.php
r365 r366 1 1 <?php 2 /*3 DELETE FROM `gametips` WHERE ID > 266;4 DELETE FROM `spell` WHERE ID > 43672;5 UPDATE `gametips` SET VersionStart = 8606,VersionEnd = 8606;6 UPDATE `spell` SET VersionStart = 8606,VersionEnd = 8606;7 DELETE FROM `Log` WHERE Type = 11;8 */9 10 2 11 12 function ImportDBC($import_version,$GroupId) 3 function ImportDBC($import_version, $GroupId) 13 4 { 14 5 global $Database, $TranslationTree, $Config; 6 15 7 $BuildNumber = GetBuildNumber($import_version); 16 8 17 9 echo('Načítání textů z DBC souborů...'); 18 10 $Group = $TranslationTree[$GroupId]; 19 20 21 11 if(($Group['DBCFileName'] != '') and ($Group['TablePrefix'] != '')) 12 { 13 echo('<br />'.$Group['Name'].'<br />'); 22 14 $DBCFile = new DBCFile(); 23 15 $DBCFile->OpenFile('../source/'.$import_version.'/dbc/'.$Group['DBCFileName'].'.dbc', GetDBCColumns($import_version,$Group['DBCFileName'])); … … 26 18 $Count = 0; 27 19 for($i = 0; $i < $ItemCount; $i++) 20 { 21 foreach($Group['Items'] as $GroupItem) 28 22 { 29 foreach($Group['Items'] as $GroupItem) 30 { 31 $Value[$GroupItem['Column']] = addslashes($DBCFile->GetString($i, GetDBCColumnIndex($import_version,$Group['DBCFileName'],$GroupItem['Column']))); 32 } 23 $Value[$GroupItem['Column']] = addslashes($DBCFile->GetString($i, GetDBCColumnIndex($import_version,$Group['DBCFileName'],$GroupItem['Column']))); 24 } 33 25 34 35 36 37 38 39 26 $Columns = ''; 27 foreach($Group['Items'] as $GroupItem) 28 { 29 $Columns .= ', '.$GroupItem['Column'].' '; 30 } 31 $Columns = substr($Columns, 1); 40 32 41 42 $DbResult2 = $Database->SQLCommand('SELECT VersionEnd, ID, entry, '.$Columns.' FROM '.$Group['TablePrefix'].' WHERE entry='.$ItemId.' AND Language=0 ORDER BY VersionStartDESC LIMIT 1');43 33 $ItemId = $DBCFile->GetUint($i, 0); 34 $DbResult2 = $Database->SQLCommand('SELECT `VersionEnd`, `ID`, `Entry`, '.$Columns.' FROM `'.$Group['TablePrefix'].'` WHERE `Entry`='.$ItemId.' AND `Language`=0 ORDER BY `VersionStart` DESC LIMIT 1'); 35 if(isset($DbResult2) and (mysql_num_rows($DbResult2) > 0)) 44 36 { 45 // Update existed text 46 $DbRow2 = mysql_fetch_assoc($DbResult2); 47 if(HaveSameText($Group, $DbRow2, $Value)) 48 { 49 if ($DbRow2['VersionEnd'] <> $BuildNumber) { 50 $Database->SQLCommand('UPDATE `'.$Group['TablePrefix'].'` SET VersionEnd = "'.$BuildNumber.'" WHERE ID='.$DbRow2['ID']); 51 echo(', '); 52 } else 53 echo('. '); 54 } else 55 { 56 $Columns = 'entry, language, VersionStart, VersionEnd'; 57 $Values = $DbRow2['entry'].', 0, '.$BuildNumber.', '.$BuildNumber; 58 foreach($Group['Items'] as $GroupItem) 59 { 60 $Columns .= ', `'.$GroupItem['Column'].'`'; 61 $Values .= ', "'.$Value[$GroupItem['Column']].'"'; 62 } 63 $Database->SQLCommand('INSERT `'.$Group['TablePrefix'].'` ('.$Columns.') VALUES ('.$Values.')'); 64 echo('# '); 65 WriteLog('Text <a href="form.php?group='.$Group['Id'].'&ID='.mysql_insert_id().'">'.mysql_insert_id().'</a> ('.$DbRow2['entry'].') ze skupiny '.$Group['Name'].' byl v nové verzi '.$import_version.' změněn.', LOG_TYPE_IMPORT); 66 } 67 37 // Update existed text 38 $DbRow2 = mysql_fetch_assoc($DbResult2); 39 if(HaveSameText($Group, $DbRow2, $Value)) 40 { 41 if ($DbRow2['VersionEnd'] <> $BuildNumber) 42 { 43 $Database->SQLCommand('UPDATE `'.$Group['TablePrefix'].'` SET `VersionEnd` = "'.$BuildNumber.'" WHERE `ID`='.$DbRow2['ID']); 44 echo(', '); 45 } else echo('. '); 46 } else 47 { 48 $Columns = '`Entry`, `Language`, `VersionStart`, `VersionEnd`'; 49 $Values = $DbRow2['entry'].', 0, '.$BuildNumber.', '.$BuildNumber; 50 foreach($Group['Items'] as $GroupItem) 51 { 52 $Columns .= ', `'.$GroupItem['Column'].'`'; 53 $Values .= ', "'.$Value[$GroupItem['Column']].'"'; 54 } 55 $Database->SQLCommand('INSERT `'.$Group['TablePrefix'].'` ('.$Columns.') VALUES ('.$Values.')'); 56 echo('# '); 57 WriteLog('Text <a href="form.php?group='.$Group['Id'].'&ID='.mysql_insert_id().'">'.mysql_insert_id().'</a> ('.$DbRow2['entry'].') ze skupiny '.$Group['Name'].' byl v nové verzi '.$import_version.' změněn.', LOG_TYPE_IMPORT); 58 } 68 59 } else 69 60 { 70 71 $Columns = 'entry, language, VersionStart, VersionEnd';72 73 74 75 76 77 78 79 80 81 61 // Insert new text 62 $Columns = '`Entry`, `Language`, `VersionStart`, `VersionEnd`'; 63 $Values = $ItemId.', 0, '.$BuildNumber.', '.$BuildNumber; 64 foreach($Group['Items'] as $GroupItem) 65 { 66 $Columns .= ', `'.$GroupItem['Column'].'`'; 67 $Values .= ', "'.$Value[$GroupItem['Column']].'"'; 68 } 69 $Database->SQLCommand('INSERT `'.$Group['TablePrefix'].'` ('.$Columns.') VALUES ('.$Values.')'); 70 echo('+ '); 71 $NewCount++; 72 WriteLog('Text <a href="form.php?group='.$Group['Id'].'&ID='.mysql_insert_id().'">'.mysql_insert_id().'</a> ('.$ItemId.') ze skupiny '.$Group['Name'].' byl v nové verzi '.$import_version.' přidán.', LOG_TYPE_IMPORT); 82 73 83 74 } 84 85 75 $Count++; 76 } 86 77 echo('<br />Celkem: '.$Count.' Nových: '.$NewCount.'<br />'); 87 $Database->SQLCommand('UPDATE `group` SET LastVersion = "'.$BuildNumber.'", LastImport = NOW() WHERE Id='.$GroupId);78 $Database->SQLCommand('UPDATE `Group` SET `LastVersion` = "'.$BuildNumber.'", `LastImport` = NOW() WHERE `Id`='.$GroupId); 88 79 } 89 80 echo('<strong>Dokončeno.</strong>'); -
trunk/import/import_lua.php
r363 r366 35 35 $Columns = substr($Columns, 1); 36 36 37 $DbResult2 = $Database->SQLCommand('SELECT `VersionEnd`, `ID`, ` entry`, '.$Columns.' FROM '.$Group['TablePrefix'].'WHERE `ShortCut`="'.$Value['ShortCut'].'" AND (`Language`=0) ORDER BY `VersionStart` DESC LIMIT 1');37 $DbResult2 = $Database->SQLCommand('SELECT `VersionEnd`, `ID`, `Entry`, '.$Columns.' FROM `'.$Group['TablePrefix'].'` WHERE `ShortCut`="'.$Value['ShortCut'].'" AND (`Language`=0) ORDER BY `VersionStart` DESC LIMIT 1'); 38 38 if(isset($DbResult2) and (mysql_num_rows($DbResult2) > 0)) 39 39 { … … 50 50 } else 51 51 { 52 $Columns = '` entry`, `language`, `VersionStart`, `VersionEnd`';53 $Values = $DbRow2[' entry'].', 0, '.$BuildNumber.', '.$BuildNumber;52 $Columns = '`Entry`, `Language`, `VersionStart`, `VersionEnd`'; 53 $Values = $DbRow2['Entry'].', 0, '.$BuildNumber.', '.$BuildNumber; 54 54 foreach($Group['Items'] as $GroupItem) 55 55 { … … 59 59 $Database->SQLCommand('INSERT `'.$Group['TablePrefix'].'` ('.$Columns.') VALUES ('.$Values.')'); 60 60 echo('# '); 61 WriteLog('Text <a href="form.php?group='.$Group['Id'].'&ID='.mysql_insert_id().'">'.mysql_insert_id().'</a> ('.$DbRow2[' entry'].') ze skupiny '.$Group['Name'].' byl v nové verzi '.$import_version.' změněn.', LOG_TYPE_IMPORT);61 WriteLog('Text <a href="form.php?group='.$Group['Id'].'&ID='.mysql_insert_id().'">'.mysql_insert_id().'</a> ('.$DbRow2['Entry'].') ze skupiny '.$Group['Name'].' byl v nové verzi '.$import_version.' změněn.', LOG_TYPE_IMPORT); 62 62 } 63 63 } else … … 65 65 // Insert new text 66 66 $Entry = 1; 67 $DbResult = $Database->SQLCommand('SELECT MAX(` entry`) FROM `'.$Group['TablePrefix'].'`');67 $DbResult = $Database->SQLCommand('SELECT MAX(`Entry`) FROM `'.$Group['TablePrefix'].'`'); 68 68 if(mysql_num_rows($DbResult) > 0) 69 69 { … … 71 71 $Entry += $DbRow[0]; 72 72 } 73 $Columns = '` entry`, `language`, `VersionStart`, `VersionEnd`';73 $Columns = '`Entry`, `Language`, `VersionStart`, `VersionEnd`'; 74 74 $Values = $Entry.', 0, '.$BuildNumber.', '.$BuildNumber; 75 75 foreach($Group['Items'] as $GroupItem) … … 87 87 } 88 88 echo('<br />Celkem: '.$Count.' Nových: '.$NewCount.'<br />'); 89 $Database->SQLCommand('UPDATE ` group` SET LastVersion = "'.$BuildNumber.'", LastImport = NOW() WHERE Id='.$Group['Id']);89 $Database->SQLCommand('UPDATE `Group` SET `LastVersion` = "'.$BuildNumber.'", `LastImport` = NOW() WHERE `Id`='.$Group['Id']); 90 90 } 91 91 } -
trunk/import/import_sql_mangos.php
r357 r366 104 104 $Columns = substr($Columns, 1); 105 105 106 if($Group['Id'] == 8)$DbResult2 = $Database->SQLCommand('SELECT VersionEnd, ID, entry, '.$Columns.' FROM '.$Group['TablePrefix'].' WHERE Name="'.$Value['name'].'" AND (Language=0) ORDER BY VersionStartDESC LIMIT 1');107 else $DbResult2 = $Database->SQLCommand('SELECT VersionEnd, ID, entry, '.$Columns.' FROM '.$Group['TablePrefix'].' WHERE entry='.$Value[$Group['MangosTableIndex']].' AND (Language=0) ORDER BY VersionStartDESC LIMIT 1');106 if($Group['Id'] == 8)$DbResult2 = $Database->SQLCommand('SELECT `VersionEnd`, `ID`, `Entry`, '.$Columns.' FROM `'.$Group['TablePrefix'].'` WHERE `Name`="'.$Value['name'].'" AND (`Language`=0) ORDER BY `VersionStart` DESC LIMIT 1'); 107 else $DbResult2 = $Database->SQLCommand('SELECT `VersionEnd`, `ID`, `Entry`, '.$Columns.' FROM `'.$Group['TablePrefix'].'` WHERE `Entry`='.$Value[$Group['MangosTableIndex']].' AND (`Language`=0) ORDER BY `VersionStart` DESC LIMIT 1'); 108 108 if(isset($DbResult2) and (mysql_num_rows($DbResult2) > 0)) 109 109 { … … 114 114 if ($DbRow2['VersionEnd'] <> $BuildNumber) 115 115 { 116 $Database->SQLCommand('UPDATE `'.$Group['TablePrefix'].'` SET VersionEnd = "'.$BuildNumber.'" WHERE ID='.$DbRow2['ID']);116 $Database->SQLCommand('UPDATE `'.$Group['TablePrefix'].'` SET `VersionEnd` = "'.$BuildNumber.'" WHERE `ID`='.$DbRow2['ID']); 117 117 echo(', '); 118 118 } else echo('. '); 119 119 } else 120 120 { 121 $Columns = ' entry, language, VersionStart, VersionEnd';122 $Values = $DbRow2[' entry'].', 0, '.$BuildNumber.', '.$BuildNumber;121 $Columns = '`Entry`, `Language`, `VersionStart`, `VersionEnd`'; 122 $Values = $DbRow2['Entry'].', 0, '.$BuildNumber.', '.$BuildNumber; 123 123 foreach($Group['Items'] as $GroupItem) 124 124 { … … 131 131 $Database->SQLCommand('INSERT `'.$Group['TablePrefix'].'` ('.$Columns.') VALUES ('.$Values.')'); 132 132 echo('# '); 133 WriteLog('Text <a href="form.php?group='.$Group['Id'].'&ID='.mysql_insert_id().'">'.mysql_insert_id().'</a> ('.$DbRow2[' entry'].') ze skupiny '.$Group['Name'].' byl v nové verzi '.$import_version.' změněn.', LOG_TYPE_IMPORT);133 WriteLog('Text <a href="form.php?group='.$Group['Id'].'&ID='.mysql_insert_id().'">'.mysql_insert_id().'</a> ('.$DbRow2['Entry'].') ze skupiny '.$Group['Name'].' byl v nové verzi '.$import_version.' změněn.', LOG_TYPE_IMPORT); 134 134 } else echo('. '); 135 135 } … … 141 141 { 142 142 $Entry = 1; 143 $DbResult = $Database->SQLCommand('SELECT MAX(` entry`) FROM `'.$Group['TablePrefix'].'`');143 $DbResult = $Database->SQLCommand('SELECT MAX(`Entry`) FROM `'.$Group['TablePrefix'].'`'); 144 144 if(mysql_num_rows($DbResult) > 0) 145 145 { … … 151 151 } 152 152 153 $Columns = ' entry, language, VersionStart, VersionEnd';153 $Columns = '`Entry`, `Language`, `VersionStart`, `VersionEnd`'; 154 154 $Values = $Entry.', 0, '.$BuildNumber.', '.$BuildNumber; 155 155 foreach($Group['Items'] as $GroupItem) … … 168 168 } 169 169 echo('<br />Celkem: '.$Count.' Nových: '.$NewCount.'<br />'); 170 $Database->SQLCommand('UPDATE ` group` SET LastVersion = "'.$BuildNumber.'", LastImport = NOW() WHERE Id='.$GroupId);170 $Database->SQLCommand('UPDATE `Group` SET `LastVersion` = "'.$BuildNumber.'", `LastImport` = NOW() WHERE `Id`='.$GroupId); 171 171 } 172 172 -
trunk/import/update_version.php
r215 r366 9 9 { 10 10 echo('<br />'.$Group['Name'].' '); 11 $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');11 $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`'); 12 12 while($DbRow = mysql_fetch_assoc($DbResult)) 13 13 { 14 $Database->SQLCommand('UPDATE '.$Group['TablePrefix'].' SET VersionEnd = '.$DbRow['VersionEnd_orig'].' WHERE ID= '.$DbRow['ID']);14 $Database->SQLCommand('UPDATE `'.$Group['TablePrefix'].'` SET `VersionEnd` = '.$DbRow['VersionEnd_orig'].' WHERE `ID` = '.$DbRow['ID']); 15 15 echo('. '); 16 16 } -
trunk/includes/global_function.php
r365 r366 256 256 257 257 $Result = array(); 258 $DbResult = $Database->SQLCommand('SELECT * FROM ` group` ORDER BY `name`');258 $DbResult = $Database->SQLCommand('SELECT * FROM `Group` ORDER BY `Name`'); 259 259 while($DbRow = mysql_fetch_assoc($DbResult)) 260 260 { … … 262 262 $Result[$DbRow['Id']] = $DbRow; 263 263 } 264 $DbResult = $Database->SQLCommand('SELECT * FROM ` group_item`');264 $DbResult = $Database->SQLCommand('SELECT * FROM `GroupItem`'); 265 265 while($DbRow = mysql_fetch_assoc($DbResult)) 266 266 { … … 378 378 if(isset($BuildNumbers[$Version]) == false) 379 379 { 380 $sql = 'SELECT `BuildNumber` FROM ` wow_client_version` WHERE `Version` = "'.$Version.'"';380 $sql = 'SELECT `BuildNumber` FROM `ClientVersion` WHERE `Version` = "'.$Version.'"'; 381 381 $DbRow = mysql_fetch_assoc($Database->SQLCommand($sql)); 382 382 $BuildNumbers[$Version] = $DbRow['BuildNumber']; … … 391 391 if(isset($VersionsWOW[$BuildNumber]) == false) 392 392 { 393 $sql = 'SELECT `Version` FROM ` wow_client_version` WHERE `BuildNumber` = "'.$BuildNumber.'"';393 $sql = 'SELECT `Version` FROM `ClientVersion` WHERE `BuildNumber` = "'.$BuildNumber.'"'; 394 394 $Version = mysql_fetch_assoc($Database->SQLCommand($sql)); 395 395 $VersionsWOW[$BuildNumber] = $Version['Version']; … … 404 404 if(isset($DBCColumns[$Version][$DBCFileName]) == false) 405 405 { 406 $sql = 'SELECT `DBCColumns_'.$DBCFileName.'` AS `DBCColumns` FROM ` wow_client_version` WHERE `Version` = "'.$Version.'"';406 $sql = 'SELECT `DBCColumns_'.$DBCFileName.'` AS `DBCColumns` FROM `ClientVersion` WHERE `Version` = "'.$Version.'"'; 407 407 $DbRow = mysql_fetch_assoc($Database->SQLCommand($sql)); 408 408 $DBCColumns[$Version][$DBCFileName] = $DbRow['DBCColumns']; … … 417 417 if(isset($DBCColumnIndex[$Version][$DBCFileName][$Column]) == false) 418 418 { 419 $sql = 'SELECT `'.$DBCFileName.'_'.$Column.'` AS `DBCColumns` FROM ` wow_client_version` WHERE `Version` = "'.$Version.'"';419 $sql = 'SELECT `'.$DBCFileName.'_'.$Column.'` AS `DBCColumns` FROM `ClientVersion` WHERE `Version` = "'.$Version.'"'; 420 420 $DbRow = mysql_fetch_assoc($Database->SQLCommand($sql)); 421 421 $DBCColumnIndex[$Version][$DBCFileName][$Column] = $DbRow['DBCColumns']; -
trunk/sql/updates/364.sql
r365 r366 51 51 ALTER TABLE `spell` CHANGE `entry` `Entry` INT( 11 ) NOT NULL; 52 52 ALTER TABLE `transports` CHANGE `entry` `Entry` INT( 11 ) NOT NULL; 53 ALTER TABLE `sd2_script_texts` CHANGE `entry` `Entry` INT( 11 ) NOT NULL;54 ALTER TABLE `sd2_script_texts` CHANGE `entry` `Entry` INT( 11 ) NOT NULL;55 ALTER TABLE `sd2_script_texts` CHANGE `entry` `Entry` INT( 11 ) NOT NULL;56 53 -
trunk/version.php
r295 r366 5 5 ShowPage(); 6 6 7 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM ` wow_client_version`');7 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `ClientVersion`'); 8 8 $DbRow = mysql_fetch_row($DbResult); 9 9 $PageList = GetPageList($DbRow[0]); … … 22 22 echo($Order['Output']); 23 23 24 $DbResult = $Database->SQLCommand('SELECT * FROM wow_client_version '.$Order['SQL'].$PageList['SQLLimit']);24 $DbResult = $Database->SQLCommand('SELECT * FROM ClientVersion '.$Order['SQL'].$PageList['SQLLimit']); 25 25 while($Version = mysql_fetch_assoc($DbResult)) 26 26 {
Note:
See TracChangeset
for help on using the changeset viewer.