- Timestamp:
- Mar 28, 2010, 6:09:33 PM (15 years ago)
- Location:
- trunk/export
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/export/create_addon.php
r400 r407 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)'; 126 $DbResult2 = $this->Database->query($Query); 127 128 129 if ($this->Database->affected_rows == 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 $DbResult2 = $this->Database->query($Query); 136 137 } 125 $DbResult2 = $this->Database->query($this->BuildQuery($Group)); 138 126 139 127 while($Line = $DbResult2->fetch_assoc()) 140 128 { 141 $en = trim($this->ReplaceEnText($Line[' Original']));142 $cz = $this->ReplaceCzText($Line[ 'Translation']);129 $en = trim($this->ReplaceEnText($Line['En'.$Column['Column']])); 130 $cz = $this->ReplaceCzText($Line[$Column['Column']]); 143 131 if(($en <> '') and ($cz <> '') and ($this->NotCancel($en))) 144 132 { … … 174 162 $Group = $TranslationTree[14]; // client table 175 163 $Column['Column'] = 'Text'; 176 $Query = 'SELECT `T2`.`'.$Column['Column'].'` AS `Translation`, `T3`.`'.$Column['Column'].'` AS `Original`, `T3`.`ShortCut` 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)';177 $DbResult = $this->Database->query($ Query);164 165 $DbResult = $this->Database->query($this->BuildQuery($Group)); 178 166 while($Line = $DbResult->fetch_array()) 179 167 { 180 $Original = $this->my_trim($Line[' Original']);181 $Translated = $this->my_trim($Line[ 'Translation']);182 if 168 $Original = $this->my_trim($Line['En'.$Column['Column']]); 169 $Translated = $this->my_trim($Line[$Column['Column']]); 170 if($this->ClientVersion['Version'] == '2.4.3') 183 171 { 184 172 $Original = str_replace("|Hchannel:%d|h[%s]|h", '[%s]', $Original); -
trunk/export/export.php
r403 r407 41 41 function BuildQuery($Group, $Columns = '') 42 42 { 43 global $TranslationTree; 44 43 45 $Query = 'SELECT * FROM (SELECT `T`.*, '.$Columns.'`User`.`Name` AS `UserName` FROM `'.$Group['TablePrefix'].'` AS `T`'. 44 46 ' JOIN `ExportUser` ON (`ExportUser`.`User`=`T`.`User`) AND (`ExportUser`.`Export`='.$this->Id.') '. … … 46 48 ' JOIN `ExportLanguage` ON (`ExportLanguage`.`Export`='.$this->Id.')'. 47 49 ' WHERE (`Complete` = 1) AND (`VersionStart` <= '.$this->ClientVersion['BuildNumber'].') AND (`VersionEnd` >= '.$this->ClientVersion['BuildNumber'].')'. 48 ' ORDER BY `ExportLanguage`.`Sequence`, `ExportUser`.`Sequence`) AS `TT` GROUP BY `TT`.`Entry`'; 50 ' ORDER BY `ExportLanguage`.`Sequence`, `ExportUser`.`Sequence`) AS `TT` GROUP BY `TT`.`Entry`'; 51 52 $OriginalColumns = ''; 53 foreach($TranslationTree[$Group['Id']]['Items'] as $Column) 54 $OriginalColumns .= ' `T3`.`'.$Column['Column'].'` AS `En'.$Column['Column'].'`, '; 55 $OriginalColumns = substr($OriginalColumns, 0, -2); 56 57 $Query = 'SELECT `T4`.*, '.$OriginalColumns.' FROM ('.$Query.') AS `T4` '. 58 ' LEFT JOIN `'.$Group['TablePrefix'].'` AS `T3` ON (`T3`.`Entry` = `T4`.`Entry`) AND (`T3`.`Language` = 0) AND (`T3`.`VersionStart` = `T4`.`VersionStart`) AND (`T3`.`VersionEnd` = `T4`.`VersionEnd`)'; 59 echo($Query); 49 60 return($Query); 50 61 } 51 62 52 63 function ExportToMangosSQL() 53 64 { … … 82 93 $Buffer .= "\n\n-- ".$Group['Name']."\n\n"; 83 94 $DbResult2 = $this->Database->query($this->BuildQuery($Group)); 95 if($DbResult2->num_rows > 0) 84 96 while($Line = $DbResult2->fetch_array()) 85 97 { … … 269 281 if(!file_exists($this->TempDir.'lua/')) mkdir($this->TempDir.'lua/', 0777, true); 270 282 $File2->CreateFile($this->TempDir.'lua/'.$Group['LuaFileName'].'.lua'); 271 283 284 $DbResult2 = $this->Database->query($this->BuildQuery($Group)); 285 272 286 while(!$File->EOF()) 273 287 { … … 281 295 $Value['Comment'] = substr(trim($LineParts[1]), 3); 282 296 283 $DbResult2 = $this->Database->query($this->BuildQuery($Group));284 297 if($DbResult2->num_rows > 0) 285 298 {
Note:
See TracChangeset
for help on using the changeset viewer.