Ignore:
Timestamp:
Dec 27, 2009, 7:12:44 PM (15 years ago)
Author:
george
Message:
  • Přidáno: Metoda Init u třídy Export, která inicializuje základní nastavení jako je cesta k dočasné složce.
  • Opraveno: Načtení informací o verzi klienta pro generování exportu.
  • Přidáno: Možnost předvolby směru řazení tabulek.
  • Opraveno: Ukládání obecných nastavení exportů.
  • Upraveno: Knihovna pro generování addonu přepsána z procedurálního na objektový zápis. Třída rozšiřuje třídu Export o další metody.
  • Upraveno: Přepsáno zařazování úloh pro generování DBC exportů.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/export/export.php

    r290 r291  
    1313  var $User;
    1414  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  }
    1522 
    1623  function LoadFilters()
     
    3340      $this->SelectedUsers .= ','.$User['User'];
    3441    $this->SelectedUsers = substr($this->SelectedUsers, 1);
    35 
     42   
    3643    if($this->SelectedUsers == '') $Where = 0;
    3744      else $Where = 'ID IN ('.$this->SelectedUsers.')';
     
    4350    $this->UserNames = substr($this->UserNames, 1);   
    4451   
    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   
    4862    if($_SESSION['UserID'] != '')
    4963    {
     
    5266    } else $this->User = array('user' => 'Neznámý');
    5367
    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();   
    5770  }
    5871
     
    87100      if($Group['MangosTable'] != '')
    88101      {
    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'; 
    90103        //echo($Query);
    91104        $Buffer .= "\n\n-- ".$Group['Name']."\n\n";
     
    191204        $Group['MangosTableIndex'] = 'entry';
    192205      }
    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';
    194207      //echo($Query);
    195208      $Buffer .= '    <group id="'.$Group['Id'].'" name="'.$Group['TablePrefix'].'">'."\n";
     
    248261
    249262          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']];
    252265          //print_r($Line);
    253266        }
     
    274287      echo($Group['Name'].'... ');
    275288      $File = new FileStream();
    276       $File->OpenFile('../source/'.$this->ClientVersion.'/lua/'.$Group['LuaFileName'].'.lua');
     289      $File->OpenFile('../source/'.$this->ClientVersion['Version'].'/lua/'.$Group['LuaFileName'].'.lua');
    277290      $File2 = new FileStream();
    278291      $File2->CreateFile($TempDir.''.$Group['LuaFileName'].'.lua');
     
    289302          $Value['Comment'] = addslashes(substr(trim($LineParts[1]), 3));
    290303
    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';
    292305          //echo($Query);
    293306          $DbResult2 = $this->Database->query($Query);
Note: See TracChangeset for help on using the changeset viewer.