Changeset 365 for trunk/export/export.php
- Timestamp:
- Mar 9, 2010, 11:29:05 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/export/export.php
r364 r365 37 37 $this->SelectedUsers = ''; 38 38 $this->UserNames = ''; 39 $DbResult = $this->Database->query('SELECT `ExportUser`.*, ` user`.`user` FROM `ExportUser` LEFT JOIN `user` ON `user`.`ID`=`ExportUser`.`User` WHERE `ExportUser`.`Export`='.$this->Id.' ORDER BY `ExportUser`.`Sequence`');39 $DbResult = $this->Database->query('SELECT `ExportUser`.*, `User`.`Name`, `User`.`ID` FROM `ExportUser` LEFT JOIN `User` ON `User`.`ID`=`ExportUser`.`User` WHERE `ExportUser`.`Export`='.$this->Id.' ORDER BY `ExportUser`.`Sequence`'); 40 40 while($User = $DbResult->fetch_assoc()) 41 41 { 42 $this->SelectedUsers .= ','.$User[' User'];43 $this->UserNames .= ','.$User[' user'];42 $this->SelectedUsers .= ','.$User['ID']; 43 $this->UserNames .= ','.$User['Name']; 44 44 } 45 45 $this->SelectedUsers = substr($this->SelectedUsers, 1); … … 59 59 if(isset($_SESSION) and ($_SESSION['UserID'] != '')) 60 60 { 61 $DbResult = $this->Database->query('SELECT ` user` FROM `user` WHERE `ID`='.$_SESSION['UserID']);61 $DbResult = $this->Database->query('SELECT `Name` FROM `User` WHERE `ID`='.$_SESSION['UserID']); 62 62 $this->User = $DbResult->fetch_assoc(); 63 } else $this->User = array(' user' => 'Neznámý');63 } else $this->User = array('User' => 'Neznámý'); 64 64 65 65 … … 82 82 "-- Znaková sada: ".$this->Config['Database']['Charset']." / ".$this->Config['Web']['Charset']."\n". 83 83 "-- Diakritika: ".$this->AnoNe[$this->Export['WithDiacritic']]."\n". 84 "-- Vygeneroval uživatel: ".$this->User[' user']."\n".84 "-- Vygeneroval uživatel: ".$this->User['Name']."\n". 85 85 "-- Vzato od uživatelů: ".$this->UserNames."\n". 86 86 "-- Generované tabulky: "; … … 98 98 if($Group['MangosTable'] != '') 99 99 { 100 $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.$this->OrderByUserList.') AS T GROUP BY T.entry';100 $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.$this->OrderByUserList.') AS `T` GROUP BY `T`.`Entry`'; 101 101 //echo($Query); 102 102 $Buffer .= "\n\n-- ".$Group['Name']."\n\n"; … … 111 111 } 112 112 $Values = substr($Values, 2); 113 $Buffer .= 'UPDATE `'.$Group['MangosTable'].'` SET '.$Values.' WHERE `'.$Group['MangosTableIndex'].'` = '.$Line[' entry'].';'."\n";113 $Buffer .= 'UPDATE `'.$Group['MangosTable'].'` SET '.$Values.' WHERE `'.$Group['MangosTableIndex'].'` = '.$Line['Entry'].';'."\n"; 114 114 } 115 115 } … … 146 146 { 147 147 $Ori_text = $Line['name']; 148 $DbResult2 = $Database2->query('SELECT text asen,148 $DbResult2 = $Database2->query('SELECT `text` AS en, 149 149 (SELECT `text` FROM `'.$Config['Database']['Database'].'`.`global_strings` AS `tabletran` 150 150 WHERE `tableen`.`entry` = `tabletran`.`entry` AND (`Complete` = 1) AND '.$this->WhereLang.' AND '.$this->WhereUsers.$this->OrderByUserList.' LIMIT 1) AS `tran` … … 186 186 " <time>".date('r')."</time>\n". 187 187 " <diacritics mode=".'"'.$this->Export['WithDiacritic'].'"'." />\n". 188 " <author>".$this->User[' user']."</author>\n".188 " <author>".$this->User['Name']."</author>\n". 189 189 " <contributors>\n"; 190 190 foreach(explode(',', $this->UserNames) as $UserName) … … 203 203 $Group['MangosTableIndex'] = 'entry'; 204 204 } 205 $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.$this->OrderByUserList.') AS `T` GROUP BY `T`.`entry`';205 $Query = 'SELECT *,(SELECT `Name` 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.$this->OrderByUserList.') AS `T` GROUP BY `T`.`entry`'; 206 206 //echo($Query); 207 207 $Buffer .= ' <group id="'.$Group['Id'].'" name="'.$Group['TablePrefix'].'">'."\n"; … … 251 251 { 252 252 $Line = $DBCFile->GetLine($I); 253 $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';253 $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`'; 254 254 $DbResult2 = $this->Database->query($Query); 255 255 if($DbResult2->num_rows > 0) … … 299 299 $Value['Comment'] = substr(trim($LineParts[1]), 3); 300 300 301 $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'].')'.$this->OrderByUserList.') AS `T` GROUP BY `T`.` entry`';301 $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'].')'.$this->OrderByUserList.') AS `T` GROUP BY `T`.`Entry`'; 302 302 //echo($Query); 303 303 $DbResult2 = $this->Database->query($Query);
Note:
See TracChangeset
for help on using the changeset viewer.