Changeset 407 for trunk/export/export.php
- Timestamp:
- Mar 28, 2010, 6:09:33 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.