Changeset 291 for trunk/export/export.php
- Timestamp:
- Dec 27, 2009, 7:12:44 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/export/export.php
r290 r291 13 13 var $User; 14 14 var $ClientVersion; 15 var $OrderByUserList; 16 17 function Init() 18 { 19 $this->TempDir = $this->Config['Web']['TempFolder'].'Export/'.$this->Id.'/'; 20 if(!file_exists($this->TempDir)) mkdir($this->TempDir, 0777, true); 21 } 15 22 16 23 function LoadFilters() … … 33 40 $this->SelectedUsers .= ','.$User['User']; 34 41 $this->SelectedUsers = substr($this->SelectedUsers, 1); 35 42 36 43 if($this->SelectedUsers == '') $Where = 0; 37 44 else $Where = 'ID IN ('.$this->SelectedUsers.')'; … … 43 50 $this->UserNames = substr($this->UserNames, 1); 44 51 45 if($this->SelectedUsers == '') $WhereUsers = 1; 46 else $this->WhereUsers = '(User IN ('.$this->SelectedUsers.'))'; 47 52 if($this->SelectedUsers == '') 53 { 54 $this->WhereUsers = 1; 55 $this->OrderByUserList = ''; 56 } else 57 { 58 $this->WhereUsers = '(User IN ('.$this->SelectedUsers.'))'; 59 $this->OrderByUserList = ' ORDER BY FIELD(User, '.$this->SelectedUsers.')'; 60 } 61 48 62 if($_SESSION['UserID'] != '') 49 63 { … … 52 66 } else $this->User = array('user' => 'Neznámý'); 53 67 54 $DbResult = $this->Database->query('SELECT `BuildNumber` FROM `wow_client_version` WHERE `Id`='.$this->Export['ClientVersion']); 55 $DbRow = $DbResult->fetch_assoc(); 56 $this->ClientVersion = $DbRow['BuildNumber']; 68 $DbResult = $this->Database->query('SELECT * FROM `wow_client_version` WHERE `Id`='.$this->Export['ClientVersion']); 69 $this->ClientVersion = $DbResult->fetch_assoc(); 57 70 } 58 71 … … 87 100 if($Group['MangosTable'] != '') 88 101 { 89 $Query = 'SELECT * FROM (SELECT * FROM '.$Group['TablePrefix'].' WHERE (Complete = 1) AND VersionStart <= '.$this->ClientVersion .' AND VersionEnd >= '.$this->ClientVersion.' AND '.$this->WhereLang.' AND '.$this->WhereUsers.' ORDER BY FIELD(User, '.$this->SelectedUsers.')) AS T GROUP BY T.entry';102 $Query = 'SELECT * FROM (SELECT * FROM '.$Group['TablePrefix'].' WHERE (Complete = 1) AND VersionStart <= '.$this->ClientVersion['BuildNumber'].' AND VersionEnd >= '.$this->ClientVersion['BuildNumber'].' AND '.$this->WhereLang.' AND '.$this->WhereUsers.' ORDER BY FIELD(User, '.$this->SelectedUsers.')) AS T GROUP BY T.entry'; 90 103 //echo($Query); 91 104 $Buffer .= "\n\n-- ".$Group['Name']."\n\n"; … … 191 204 $Group['MangosTableIndex'] = 'entry'; 192 205 } 193 $Query = 'SELECT *,(SELECT user FROM user WHERE user.ID=T.User) as UserName FROM (SELECT * FROM '.$Group['TablePrefix'].' WHERE (Complete = 1) AND VersionStart <= '.$this->ClientVersion .' AND VersionEnd >= '.$this->ClientVersion.' AND '.$this->WhereLang.' AND '.$this->WhereUsers.' ORDER BY FIELD(User, '.$this->SelectedUsers.')) AS T GROUP BY T.entry';206 $Query = 'SELECT *,(SELECT user FROM user WHERE user.ID=T.User) as UserName FROM (SELECT * FROM '.$Group['TablePrefix'].' WHERE (Complete = 1) AND VersionStart <= '.$this->ClientVersion['BuildNumber'].' AND VersionEnd >= '.$this->ClientVersion['BuildNumber'].' AND '.$this->WhereLang.' AND '.$this->WhereUsers.' ORDER BY FIELD(User, '.$this->SelectedUsers.')) AS T GROUP BY T.entry'; 194 207 //echo($Query); 195 208 $Buffer .= ' <group id="'.$Group['Id'].'" name="'.$Group['TablePrefix'].'">'."\n"; … … 248 261 249 262 foreach($Group['Items'] as $GroupItem) 250 if(GetDBCColumnIndex($Setting['Version'], $Group['DBCFileName'],$GroupItem['Column']) != '')251 $Line[GetDBCColumnIndex($this->Export['ClientVersion'], $Group['DBCFileName'],$GroupItem['Column'])] = $DbRow[$GroupItem['Column']];263 if(GetDBCColumnIndex($Setting['Version'], $Group['DBCFileName'], $GroupItem['Column']) != '') 264 $Line[GetDBCColumnIndex($this->Export['ClientVersion'], $Group['DBCFileName'],$GroupItem['Column'])] = $DbRow[$GroupItem['Column']]; 252 265 //print_r($Line); 253 266 } … … 274 287 echo($Group['Name'].'... '); 275 288 $File = new FileStream(); 276 $File->OpenFile('../source/'.$this->ClientVersion .'/lua/'.$Group['LuaFileName'].'.lua');289 $File->OpenFile('../source/'.$this->ClientVersion['Version'].'/lua/'.$Group['LuaFileName'].'.lua'); 277 290 $File2 = new FileStream(); 278 291 $File2->CreateFile($TempDir.''.$Group['LuaFileName'].'.lua'); … … 289 302 $Value['Comment'] = addslashes(substr(trim($LineParts[1]), 3)); 290 303 291 $Query = 'SELECT * FROM (SELECT * FROM '.$Group['TablePrefix'].' WHERE (Complete = 1) AND '.$this->WhereLang.' AND '.$this->WhereUsers.' AND (ShortCut="'.$Value['ShortCut'].'") AND VersionStart <= '.$this->ClientVersion .' AND VersionEnd >= '.$this->ClientVersion.' ORDER BY FIELD(User, '.$this->SelectedUsers.')) AS T GROUP BY T.entry';304 $Query = 'SELECT * FROM (SELECT * FROM '.$Group['TablePrefix'].' WHERE (Complete = 1) AND '.$this->WhereLang.' AND '.$this->WhereUsers.' AND (ShortCut="'.$Value['ShortCut'].'") AND VersionStart <= '.$this->ClientVersion['BuildNumber'].' AND VersionEnd >= '.$this->ClientVersion['BuildNumber'].' ORDER BY FIELD(User, '.$this->SelectedUsers.')) AS T GROUP BY T.entry'; 292 305 //echo($Query); 293 306 $DbResult2 = $this->Database->query($Query);
Note:
See TracChangeset
for help on using the changeset viewer.