Ignore:
Timestamp:
Mar 9, 2010, 11:29:05 AM (15 years ago)
Author:
george
Message:
  • Upraveno: Jména tabulek v databází upraveny na stejná s prvními velkými písmeny.
  • Upraveno: Doplněny SQL uvozovky do mnoha SQL dotazů.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/export/export.php

    r364 r365  
    3737    $this->SelectedUsers = ''; 
    3838    $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`');
    4040    while($User = $DbResult->fetch_assoc())
    4141    {
    42       $this->SelectedUsers .= ','.$User['User'];
    43       $this->UserNames .= ','.$User['user'];
     42      $this->SelectedUsers .= ','.$User['ID'];
     43      $this->UserNames .= ','.$User['Name'];
    4444    }
    4545    $this->SelectedUsers = substr($this->SelectedUsers, 1);
     
    5959    if(isset($_SESSION) and ($_SESSION['UserID'] != ''))
    6060    {
    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']);
    6262      $this->User = $DbResult->fetch_assoc();
    63     } else $this->User = array('user' => 'Neznámý');
     63    } else $this->User = array('User' => 'Neznámý');
    6464
    6565
     
    8282      "-- Znaková sada: ".$this->Config['Database']['Charset']." / ".$this->Config['Web']['Charset']."\n".
    8383      "-- Diakritika: ".$this->AnoNe[$this->Export['WithDiacritic']]."\n".
    84       "-- Vygeneroval uživatel: ".$this->User['user']."\n".
     84      "-- Vygeneroval uživatel: ".$this->User['Name']."\n".
    8585      "-- Vzato od uživatelů: ".$this->UserNames."\n".
    8686      "-- Generované tabulky: ";
     
    9898      if($Group['MangosTable'] != '')
    9999      {
    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`'; 
    101101        //echo($Query);
    102102        $Buffer .= "\n\n-- ".$Group['Name']."\n\n";
     
    111111          }
    112112          $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";
    114114        }     
    115115      }
     
    146146      {
    147147        $Ori_text = $Line['name'];
    148         $DbResult2 = $Database2->query('SELECT text as en,
     148        $DbResult2 = $Database2->query('SELECT `text` AS en,
    149149        (SELECT `text` FROM `'.$Config['Database']['Database'].'`.`global_strings` AS `tabletran`
    150150         WHERE `tableen`.`entry` = `tabletran`.`entry` AND (`Complete` = 1) AND '.$this->WhereLang.' AND '.$this->WhereUsers.$this->OrderByUserList.' LIMIT 1) AS `tran`
     
    186186    "    <time>".date('r')."</time>\n".
    187187    "    <diacritics mode=".'"'.$this->Export['WithDiacritic'].'"'." />\n".
    188     "    <author>".$this->User['user']."</author>\n".
     188    "    <author>".$this->User['Name']."</author>\n".
    189189    "    <contributors>\n";
    190190    foreach(explode(',', $this->UserNames) as $UserName)
     
    203203        $Group['MangosTableIndex'] = 'entry';
    204204      }
    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`';
    206206      //echo($Query);
    207207      $Buffer .= '    <group id="'.$Group['Id'].'" name="'.$Group['TablePrefix'].'">'."\n";
     
    251251      {
    252252        $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`';       
    254254        $DbResult2 = $this->Database->query($Query);
    255255        if($DbResult2->num_rows > 0)
     
    299299          $Value['Comment'] = substr(trim($LineParts[1]), 3);
    300300
    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`';
    302302          //echo($Query);
    303303          $DbResult2 = $this->Database->query($Query);
Note: See TracChangeset for help on using the changeset viewer.