Changeset 292 for trunk/export/export.php
- Timestamp:
- Dec 27, 2009, 8:19:32 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/export/export.php
r291 r292 60 60 } 61 61 62 if( $_SESSION['UserID'] != '')62 if(isset($_SESSION) and ($_SESSION['UserID'] != '')) 63 63 { 64 64 $DbResult = $this->Database->query('SELECT user FROM `user` WHERE ID='.$_SESSION['UserID']); … … 234 234 $this->LoadFilters(); 235 235 236 $TempDir = $this->Config['Web']['TempFolder'].$_SESSION['User'].'/dbc/'; 237 if(!file_exists($TempDir)) mkdir($TempDir, 0777, true); 238 239 240 foreach($TranslationTree as $Group) 241 if(in_array($Group['Id'], $Setting['groups']) and ($Group['DBCFileName'] != '')) 242 { 236 $DbResult = $this->Database->query('SELECT `group`.* FROM `ExportGroup` JOIN `group` ON `group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id.' AND `group`.`DBCFileName` != ""'); 237 while($Group = $DbResult->fetch_assoc()) 238 { 243 239 echo($Group['Name'].'... '); 244 240 $DBCFile = new DBCFile(); 245 $DBCFile->OpenFile('../source/'.$ Setting['Version'].'/dbc/'.$Group['DBCFileName'].'.dbc', GetDBCColumns($Setting['Version'],$Group['DBCFileName']));241 $DBCFile->OpenFile('../source/'.$this->ClientVersion['Version'].'/dbc/'.$Group['DBCFileName'].'.dbc', GetDBCColumns($Setting['Version'], $Group['DBCFileName'])); 246 242 $DBCFile2 = new DBCFile(); 247 $DBCFile2->CreateFile($ TempDir.$Group['DBCFileName'].'.dbc', GetDBCColumns($Setting['Version'],$Group['DBCFileName']));243 $DBCFile2->CreateFile($this->TempDir.$Group['DBCFileName'].'.dbc', GetDBCColumns($this->ClientVersion['Version'], $Group['DBCFileName'])); 248 244 $Count = $DBCFile->GetRecordCount(); 249 245 //if($Group['DBCFileName'] == 'Spell') $Count = 1000; … … 253 249 { 254 250 $Line = $DBCFile->GetLine($I); 255 $Query = 'SELECT * FROM (SELECT * FROM '.$Group['TablePrefix'].' WHERE (Complete = 1) AND '.$ WhereLang.' AND '.$WhereUsers.' AND (entry='.$Line[0].') AND VersionStart <= '.GetBuildNumber($Setting['Version']).' AND VersionEnd >= '.GetBuildNumber($Setting['Version']).' ORDER BY FIELD(User, '.$SelectedUsers.')) AS T GROUP BY T.entry';256 $DbResult = $this->Database->query($Query);257 if($DbResult ->num_rows > 0)258 { 259 $DbRow = $DbResult ->fetch_assoc();251 $Query = 'SELECT * FROM (SELECT * FROM '.$Group['TablePrefix'].' WHERE (Complete = 1) AND '.$this->WhereLang.' AND '.$this->WhereUsers.' AND (entry='.$Line[0].') AND VersionStart <= '.$this->ClientVersion['BuildNumber'].' AND VersionEnd >= '.$this->ClientVersion['BuildNumber'].' ORDER BY FIELD(User, '.$this->SelectedUsers.')) AS T GROUP BY T.entry'; 252 $DbResult2 = $this->Database->query($Query); 253 if($DbResult2->num_rows > 0) 254 { 255 $DbRow = $DbResult2->fetch_assoc(); 260 256 // if($Setting['Diacritics'] != 1) $Buffer = utf2ascii($Buffer); 261 257 262 foreach($ Group['Items'] as $GroupItem)263 if(GetDBCColumnIndex($ Setting['Version'], $Group['DBCFileName'], $GroupItem['Column']) != '')264 $Line[GetDBCColumnIndex($this-> Export['ClientVersion'], $Group['DBCFileName'],$GroupItem['Column'])] = $DbRow[$GroupItem['Column']];258 foreach($TranslationTree[$Group['Id']]['Items'] as $GroupItem) 259 if(GetDBCColumnIndex($this->ClientVersion['Version'], $Group['DBCFileName'], $GroupItem['Column']) != '') 260 $Line[GetDBCColumnIndex($this->ClientVersion['Version'], $Group['DBCFileName'],$GroupItem['Column'])] = $DbRow[$GroupItem['Column']]; 265 261 //print_r($Line); 266 262 } … … 279 275 $this->LoadFilters(); 280 276 281 $TempDir = $this->Config['Web']['TempFolder'].$_SESSION['User'].'/lua/';282 if(!file_exists($TempDir)) mkdir($TempDir, 0777, true);283 284 277 $DbResult = $this->Database->query('SELECT `group`.* FROM `ExportGroup` JOIN `group` ON `group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id.' AND `group`.`LuaFileName` != ""'); 285 278 while($Group = $DbResult->fetch_assoc()) … … 289 282 $File->OpenFile('../source/'.$this->ClientVersion['Version'].'/lua/'.$Group['LuaFileName'].'.lua'); 290 283 $File2 = new FileStream(); 291 $File2->CreateFile($ TempDir.''.$Group['LuaFileName'].'.lua');284 $File2->CreateFile($this->TempDir.''.$Group['LuaFileName'].'.lua'); 292 285 293 286 while(!$File->EOF())
Note:
See TracChangeset
for help on using the changeset viewer.