Changeset 214
- Timestamp:
- Jun 22, 2009, 9:22:20 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/TranslationList.php
r210 r214 128 128 129 129 WritePages('?group='.$GroupId.'&action=notran', 'AS items WHERE items.Language = 0 AND 130 NOT EXISTS(SELECT 1 FROM '.$Table.' AS sub WHERE sub.Language <> 0 AND sub.entry = items.entry) ');130 NOT EXISTS(SELECT 1 FROM '.$Table.' AS sub WHERE sub.Language <> 0 AND sub.entry = items.entry) AND VersionEnd = "'.GetBuildNumber($Config['Web']['GameVersion']).'"'); 131 131 132 132 WriteQuests('SELECT * FROM '.$Table.' AS items WHERE (items.Language = 0) AND 133 NOT EXISTS(SELECT 1 FROM '.$Table.' AS sub WHERE (sub.Language <> 0) AND (sub.entry = items.entry)) ', $_SESSION['limitx'].','.$_SESSION['limity'], 'notran');133 NOT EXISTS(SELECT 1 FROM '.$Table.' AS sub WHERE (sub.Language <> 0) AND (sub.entry = items.entry)) AND VersionEnd = "'.GetBuildNumber($Config['Web']['GameVersion']).'"', $_SESSION['limitx'].','.$_SESSION['limity'], 'notran'); 134 134 } else 135 135 if($Action == 'nocomplete') … … 141 141 WritePages('?group='.$GroupId.'&action=notran', 'AS items WHERE items.Language = 0 AND 142 142 NOT EXISTS(SELECT 1 FROM '.$Table.' AS sub WHERE (sub.Language <> 0) AND (sub.entry = items.entry) AND (sub.Complete = 1)) AND 143 EXISTS(SELECT 1 FROM '.$Table.' AS sub WHERE sub.Language <> 0 AND sub.entry = items.entry AND (sub.Complete = 0)) ');143 EXISTS(SELECT 1 FROM '.$Table.' AS sub WHERE sub.Language <> 0 AND sub.entry = items.entry AND (sub.Complete = 0)) AND VersionEnd = "'.GetBuildNumber($Config['Web']['GameVersion']).'"'); 144 144 145 145 WriteQuests('SELECT * FROM '.$Table.' AS items WHERE (items.Language = 0) AND 146 146 NOT EXISTS(SELECT 1 FROM '.$Table.' AS sub WHERE (sub.Language <> 0) AND (sub.entry = items.entry) AND (sub.Complete = 1)) AND 147 EXISTS(SELECT 1 FROM '.$Table.' AS sub WHERE (sub.Language <> 0) AND (sub.entry = items.entry) AND (sub.Complete = 0)) ', $_SESSION['limitx'].','.$_SESSION['limity'], 'nocomplete');147 EXISTS(SELECT 1 FROM '.$Table.' AS sub WHERE (sub.Language <> 0) AND (sub.entry = items.entry) AND (sub.Complete = 0)) AND VersionEnd = "'.GetBuildNumber($Config['Web']['GameVersion']).'"', $_SESSION['limitx'].','.$_SESSION['limity'], 'nocomplete'); 148 148 } else 149 149 if($Action == 'Translate') -
trunk/export/create_addon.php
r200 r214 69 69 $string = ReplaceVarInText($string); 70 70 return($string); 71 } 72 73 function NotCancel($string) 74 { 75 //echo (strpos($string,'<html>')); 76 if (strpos($string,'<html>') > -1) { 77 return(false); 78 } else { 79 return(true); 80 } 71 81 } 72 82 … … 125 135 $en = trim(ReplaceEnText($Line['Original'])); 126 136 $cz = ReplaceCzText($Line['Translation']); 127 if(($en <> '') and ($cz <> '') )137 if(($en <> '') and ($cz <> '') and (NotCancel($en))) 128 138 { 129 139 $Buffer .= "\n".'["'.$en.'"]="'.$cz.'",'; -
trunk/export/index.php
r200 r214 151 151 case 'AoWoWImport': 152 152 require_once('../aowow/configs/config.php'); 153 echo('<div style="font-size: xx-small;">'); 153 154 echo('Gewneruji SQL kód '); 154 155 $AoWoWSQL = ExportToAoWoWSQL($ExportSetting); … … 190 191 $Database->SelectDatabase($Config['Database']['Database']); 191 192 $Database->SQLCommand('SET NAMES '.$Config['Database']['Charset']); 193 echo('</div>'); 192 194 WriteLog('Plnění AoWoW databáze překladem', 4); 193 195 break; -
trunk/form.php
r198 r214 28 28 if(($Line['Take'] <> 0) and ($Line['Take'] <> $Line['ID'])) 29 29 { 30 $Language = mysql_fetch_assoc($Database->SQLCommand('SELECT Language FROM '.$Table.' Where ID = '.$Line['Take']));30 $Language = mysql_fetch_assoc($Database->SQLCommand('SELECT Language,VersionStart,VersionEnd FROM '.$Table.' Where ID = '.$Line['Take'])); 31 31 // echo $Language['Language'].' '.$Line['Take']; 32 32 if($Language['Language'] <> 0) … … 37 37 { 38 38 if($Line['Complete'] == 1) echo(' <b>Hotov</b><br />'); 39 else echo(' <b> Uložen v rozepsaných</b> <br />');39 else echo(' <b> Uložen v rozepsaných</b> '); 40 40 } else 41 41 { 42 echo(' <b>Anglická, původní verze</b> <br />');42 echo(' <b>Anglická, původní verze</b> '); 43 43 } 44 echo (GetVersionWOW($Line['VersionStart']).' - '.GetVersionWOW($Line['VersionEnd'])); 45 echo('<br />'); 44 46 45 47 $version = mysql_fetch_array($Database->SQLCommand('SELECT count(*) FROM '.$Table.' Where entry = '.$Line['entry'].' AND Language <> 0')); -
trunk/import/index.php
r195 r214 3 3 include('../includes/global.php'); 4 4 include('../includes/dbc.php'); 5 6 function ImportSQLMangos() 7 { 8 global $Database, $TranslationTree, $Config; 9 10 echo('Načítání textů z databáze MaNGOSu...'); 11 foreach($TranslationTree as $Group) 12 { 13 if(($Group['MangosTable'] != '') and ($Group['TablePrefix'] != '')) 14 { 15 echo('<br />'.$Group['Name'].'<br />'); 16 $DbName = $Config['Database']['MangosPrefix'].$Group['MangosDatabase']; 17 $Columns = '`'.$DbName.'`.`'.$Group['MangosTable'].'`.`'.$Group['MangosTableIndex'].'`'; 18 $Where = ''; 19 foreach($Group['Items'] as $GroupItem) 20 { 21 $Columns .= ', `'.$DbName.'`.`'.$Group['MangosTable'].'`.`'.$GroupItem['MangosColumn'].'` AS `'.$GroupItem['Column'].'`'; 22 $Where .= ' OR `'.$DbName.'`.`'.$Group['MangosTable'].'`.`'.$GroupItem['MangosColumn'].'` != "" '; 23 } 24 $Where = substr($Where, 4); 25 $Query = 'SELECT '.$Columns.' FROM `'.$DbName.'`.`'.$Group['MangosTable'].'` WHERE '.$Where; 26 //echo($Query.'<br />'); 27 $Count = 0; 28 $NewCount = 0; 29 $DbResult = $Database->SQLCommand($Query); 30 while($DbRow = mysql_fetch_assoc($DbResult)) 31 { 32 //echo('SELECT ID FROM '.$Group['TablePrefix'].' WHERE entry='.$DbRow[$Group['MangosTableIndex']].' AND Language=0'."<br>"); 33 $DbResult2 = $Database->SQLCommand('SELECT ID FROM '.$Group['TablePrefix'].' WHERE entry='.$DbRow[$Group['MangosTableIndex']].' AND Language=0'); 34 if(isset($DbResult2) and (mysql_num_rows($DbResult2) > 0)) 35 { 36 $DbRow2 = mysql_fetch_assoc($DbResult2); 37 //echo($DbRow2['ID']); 38 $ColumnsValues = ''; 39 foreach($Group['Items'] as $GroupItem) 40 { 41 $ColumnsValues .= ', `'.$GroupItem['Column'].'`="'.addslashes($DbRow[$GroupItem['Column']]).'"'; 42 } 43 $ColumnsValues = substr($ColumnsValues, 2); 44 echo('. '); //'UPDATE `'.$Group['TablePrefix'].'` SET '.$ColumnsValues.' WHERE ID='.$DbRow2['ID']."<br>"); 45 //print_r($DbRow2); 46 $Database->SQLCommand('UPDATE `'.$Group['TablePrefix'].'` SET '.$ColumnsValues.' WHERE ID='.$DbRow2['ID']); 47 } else 48 { 49 $Columns = 'entry, language'; 50 $Values = $DbRow[$Group['MangosTableIndex']].', 0'; 51 foreach($Group['Items'] as $GroupItem) 52 { 53 $Columns .= ', `'.$GroupItem['Column'].'`'; 54 $Values .= ', "'.addslashes($DbRow[$GroupItem['Column']]).'"'; 55 } 56 //$Columns = substr($Columns, 2); 57 //$Values = substr($Values, 2); 58 $Database->SQLCommand('INSERT `'.$Group['TablePrefix'].'` ('.$Columns.') VALUES ('.$Values.')'); 59 echo('# '); 60 //echo('INSERT `'.$Group['TablePrefix'].'` ('.$Columns.') VALUES ('.$Values.')'."<br>"); 61 $NewCount++; 62 } 63 $Count++; 64 } 65 echo('<br />Celkem: '.$Count.' Nových: '.$NewCount.'<br />'); 66 } 67 } 68 echo('Dokončeno.</div>'); 69 } 70 71 function ImportDBC() 72 { 73 global $Database, $TranslationTree, $Config; 74 75 echo('Načítání textů z DBC souborů...'); 76 foreach($TranslationTree as $Group) 77 { 78 if(($Group['DBCFileName'] != '') and ($Group['TablePrefix'] != '')) 79 { 80 echo('<br />'.$Group['Name'].'<br />'); 81 $DBCFile = new DBCFile(); 82 $DBCFile->OpenFile('../source/'.$Config['Web']['GameVersion'].'/dbc/'.$Group['DBCFileName'].'.dbc', $Group['DBCColumns']); 83 $ItemCount = $DBCFile->GetRecordCount(); 84 $NewCount = 0; 85 $Count = 0; 86 for($i = 0; $i < $ItemCount; $i++) 87 { 88 $ItemId = $DBCFile->GetUint($i, 0); 89 $DbResult2 = $Database->SQLCommand('SELECT ID FROM '.$Group['TablePrefix'].' WHERE entry='.$ItemId.' AND Language=0'); 90 if(isset($DbResult2) and (mysql_num_rows($DbResult2) > 0)) 91 { 92 $DbRow2 = mysql_fetch_assoc($DbResult2); 93 //echo($DbRow2['ID']); 94 $ColumnsValues = ''; 95 foreach($Group['Items'] as $GroupItem) 96 { 97 $ColumnsValues .= ', `'.$GroupItem['Column'].'`="'.addslashes($DBCFile->GetString($i, $GroupItem['DBCColumnIndex'])).'"'; 98 } 99 $ColumnsValues = substr($ColumnsValues, 2); 100 echo('. '); //'UPDATE `'.$Group['TablePrefix'].'` SET '.$ColumnsValues.' WHERE ID='.$DbRow2['ID']."<br>"); 101 //print_r($DbRow2); 102 $Database->SQLCommand('UPDATE `'.$Group['TablePrefix'].'` SET '.$ColumnsValues.' WHERE ID='.$DbRow2['ID']); 103 } else 104 { 105 $Columns = 'entry, language'; 106 $Values = $ItemId.', 0'; 107 foreach($Group['Items'] as $GroupItem) 108 { 109 $Columns .= ', `'.$GroupItem['Column'].'`'; 110 $Values .= ', "'.addslashes($DBCFile->GetString($i, $GroupItem['DBCColumnIndex'])).'"'; 111 } 112 //$Columns = substr($Columns, 2); 113 //$Values = substr($Values, 2); 114 $Database->SQLCommand('INSERT `'.$Group['TablePrefix'].'` ('.$Columns.') VALUES ('.$Values.')'); 115 echo('# '); 116 //echo('INSERT `'.$Group['TablePrefix'].'` ('.$Columns.') VALUES ('.$Values.')'."<br>"); 117 $NewCount++; 118 } 119 $Count++; 120 } 121 echo('<br />Celkem: '.$Count.' Nových: '.$NewCount.'<br />'); 122 } 123 } 124 echo('Dokončeno.</div>'); 125 } 126 127 function ImportLUA() 128 { 129 global $Database, $TranslationTree, $PatchVersion, $Config; 130 131 echo('Načítání textů z LUA souborů...'); 132 foreach($TranslationTree as $Group) 133 { 134 if(($Group['LuaFileName'] != '') and ($Group['TablePrefix'] != '')) 135 { 136 echo('<br />'.$Group['Name'].'<br />'); 137 $File = new FileStream(); 138 $File->OpenFile('../source/'.$Config['Web']['GameVersion'].'/lua/'.$Group['LuaFileName'].'.lua'); 139 $NewCount = 0; 140 $Count = 0; 141 while(!$File->EOF()) 142 { 143 $Line = $File->ReadLine(); 144 if(strpos($Line, '=') !== false) 145 { 146 $LineParts = explode(';', $Line); 147 $LineParts2 = explode('=', $LineParts[0]); 148 $Value['ShortCut'] = trim($LineParts2[0]); 149 $Value['Text'] = substr(trim($LineParts2[1]), 1, -1); 150 $Value['Comment'] = addslashes(substr(trim($LineParts[1]), 3)); 151 152 $DbResult2 = $Database->SQLCommand('SELECT ID FROM '.$Group['TablePrefix'].' WHERE ShortCut="'.$Value['ShortCut'].'" AND (Language=0)'); 153 if(isset($DbResult2) and (mysql_num_rows($DbResult2) > 0)) 154 { 155 $ColumnsValues = ''; 156 foreach($Group['Items'] as $GroupItem) 157 { 158 $ColumnsValues .= ', `'.$GroupItem['Column'].'`="'.$Value[$GroupItem['Column']].'"'; 159 } 160 $ColumnsValues = substr($ColumnsValues, 2); 161 162 $DbRow2 = mysql_fetch_assoc($DbResult2); 163 echo('. '); //'UPDATE `'.$Group['TablePrefix'].'` SET '.$ColumnsValues.' WHERE ID='.$DbRow2['ID']."<br>"); 164 $Database->SQLCommand('UPDATE `'.$Group['TablePrefix'].'` SET '.$ColumnsValues.' WHERE ID='.$DbRow2['ID']); 165 } else 166 { 167 $Entry = 1; 168 $DbResult = $Database->SQLCommand('SELECT MAX(`entry`) FROM `'.$Group['TablePrefix'].'`'); 169 if(mysql_num_rows($DbResult) > 0) 170 { 171 $DbRow = mysql_fetch_row($DbResult); 172 $Entry += $DbRow[0]; 173 } 174 175 $Columns = 'entry, language, ShortCut'; 176 $Values = $Entry.', 0, "'.$Value['ShortCut'].'"'; 177 foreach($Group['Items'] as $GroupItem) 178 { 179 $Columns .= ', `'.$GroupItem['Column'].'`'; 180 $Values .= ', "'.$Value[$GroupItem['Column']].'"'; 181 } 182 $Database->SQLCommand('INSERT `'.$Group['TablePrefix'].'` ('.$Columns.') VALUES ('.$Values.')'); 183 echo('# '); 184 $NewCount++; 185 } 186 }; 187 $Count++; 188 } 189 echo('<br />Celkem: '.$Count.' Nových: '.$NewCount.'<br />'); 190 } 191 } 192 echo('Dokončeno.</div>'); 193 } 5 include('import_lua.php'); 6 include('import_sql_mangos.php'); 7 include('import_dbc.php'); 8 include('update_version.php'); 194 9 195 10 ShowPage(); … … 220 35 break; 221 36 case 'lua': 222 ImportLUA(); 37 ImportLUA($Config['Web']['GameVersion']); //$Config['Web']['GameVersion'] 38 UpdateVersion(); 223 39 break; 224 40 case 'xml': … … 229 45 } 230 46 WriteLog('Plnění databáze', 4); 47 echo('</div>'); 48 231 49 } 232 50 -
trunk/includes/global_function.php
r199 r214 177 177 array('4', 'Moderátor', 'orange', 'Operace administrátorů a moderátorů'), 178 178 array('10', 'Chyby', 'red', 'Zachycené chybové hlášení'), 179 array('11', 'Import', '#A020F0', 'Záznam změn při importu'), 179 180 ); 180 181 … … 223 224 } 224 225 225 $Next = mysql_fetch_a rray($Database->SQLCommand($sql));226 $Next = mysql_fetch_assoc($Database->SQLCommand($sql)); 226 227 if($Next) 227 228 { … … 232 233 } 233 234 235 function GetBuildNumber($Version) 236 { 237 global $Database; 238 239 $sql = 'SELECT BuildNumber FROM `wow_client_version` WHERE Version = "'.$Version.'"'; 240 $BuildNumber = mysql_fetch_assoc($Database->SQLCommand($sql)); 241 return($BuildNumber['BuildNumber']); 242 } 243 244 function GetVersionWOW($BuildNumber) 245 { 246 global $Database; 247 248 $sql = 'SELECT Version FROM `wow_client_version` WHERE BuildNumber = "'.$BuildNumber.'"'; 249 $Version = mysql_fetch_assoc($Database->SQLCommand($sql)); 250 return($Version['Version']); 251 } 252 234 253 ?> -
trunk/log.php
r213 r214 52 52 foreach($LogTypes as $Index => $LogItem) 53 53 { 54 echo('< span style="color:'.$LogItem[2].'"><a href="log.php?type='.$LogItem[0].'" title="'.$LogItem[3].'">'.$LogItem[1].'</a></span> ');54 echo('<a href="log.php?type='.$LogItem[0].'" style="color:'.$LogItem[2].'" title="'.$LogItem[3].'">'.$LogItem[1].'</a> '); 55 55 } 56 56 -
trunk/save.php
r209 r214 26 26 27 27 $LineAJ = mysql_fetch_array($Database->SQLCommand('SELECT * FROM '.$Table.' WHERE Language = 0 AND entry = '.$entry)); 28 $Line = mysql_fetch_array($Database->SQLCommand('SELECT * FROM '.$Table.' WHERE user='.$UserID.' AND entry = '.$entry)); 28 $LineTake = mysql_fetch_array($Database->SQLCommand('SELECT VersionEnd,VersionStart FROM '.$Table.' WHERE ID = '.$TextID)); 29 $Line = mysql_fetch_array($Database->SQLCommand('SELECT * FROM '.$Table.' WHERE user='.$UserID.' AND entry = '.$entry.' 30 AND VersionStart = '.$LineTake['VersionStart'].' AND VersionEnd = '.$LineTake['VersionEnd'])); 29 31 if(!$Line) 30 32 { 31 $Columns = '`Language` , `User` , `Complete` , `Take` ';32 $Values = $Language.','.$UserID.','.$complete.','.$TextID ;33 $Columns = '`Language` , `User` , `Complete` , `Take` , `VersionStart` , `VersionEnd`'; 34 $Values = $Language.','.$UserID.','.$complete.','.$TextID.','.$LineTake['VersionStart'].','.$LineTake['VersionEnd']; 33 35 foreach($TranslationTree[$GroupId]['Items'] as $GroupItem) 34 36 { … … 60 62 while($SameTranLine = mysql_fetch_assoc($SameTranID)) 61 63 { 62 $Line = mysql_fetch_array($Database->SQLCommand('SELECT * FROM '.$Table.' WHERE user='.$UserID.' AND entry = '.$SameTranLine['entry'])); 64 $Line = mysql_fetch_array($Database->SQLCommand('SELECT * FROM '.$Table.' WHERE user='.$UserID.' AND entry = '.$SameTranLine['entry'].' 65 AND VersionStart = '.$LineTake['VersionStart'].' AND VersionEnd = '.$LineTake['VersionEnd'])); 63 66 if(!$Line) { 64 67 if ($GroupItem['Column'] <> 'ShortCut')
Note:
See TracChangeset
for help on using the changeset viewer.