Ignore:
Timestamp:
Feb 22, 2010, 3:15:16 PM (15 years ago)
Author:
maron
Message:

Odstranění nevhodného odřátkování zanechané editorem

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/export/create_addon.php

    r333 r334  
    2626      $Man = str_replace(' ', '', $Man);
    2727      $Woman = str_replace(' ', '', $Woman);
    28       $string = $Before.'"..gsub(gsub(UnitSex("player"), "^2$", "'.
    29       $Man.'"), "^3$", "'.$Woman.'").."'.$After;
     28      $string = $Before.'"..gsub(gsub(UnitSex("player"), "^2$", "'.$Man.'"), "^3$", "'.$Woman.'").."'.$After;
    3029    }
    3130    $Gender = '$g';
     
    4039      $Man = str_replace(' ', '', $Man);
    4140      $Woman = str_replace(' ', '', $Woman);
    42       $string = $Before.'"..gsub(gsub(UnitSex("player"), "^2$", "'.$Man.'"),
    43 "^3$", "'.$Woman.'").."'.$After;
     41      $string = $Before.'"..gsub(gsub(UnitSex("player"), "^2$", "'.$Man.'"),"^3$", "'.$Woman.'").."'.$After;
    4442    }
    4543
     
    106104    $CreatedFileListCount = array();
    107105 
    108     $DbResult = $this->Database->query('SELECT `group`.* FROM `ExportGroup` JOIN
    109 `group` ON `group`.`Id` = `ExportGroup`.`Group` WHERE
    110 `ExportGroup`.`Export`='.$this->Id.' AND `group`.`TablePrefix` != ""');
     106    $DbResult = $this->Database->query('SELECT `group`.* FROM `ExportGroup` JOIN `group` ON `group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id.' AND `group`.`TablePrefix` != ""');
    111107    while($Group = $DbResult->fetch_assoc())
    112108    {
     
    120116   
    121117        $CreatedFileList[] = $Column['AddonFileName'].'_'.$FileIndex;
    122         $FileName =
    123 $this->TempDir.'CzWoW/'.$Column['AddonFileName'].'_'.$FileIndex.'.lua';
    124         if(!file_exists($this->TempDir.'CzWoW/')) mkdir($this->TempDir.'CzWoW/',
    125 0777, true);
     118        $FileName = $this->TempDir.'CzWoW/'.$Column['AddonFileName'].'_'.$FileIndex.'.lua';
     119        if(!file_exists($this->TempDir.'CzWoW/')) mkdir($this->TempDir.'CzWoW/', 0777, true);
    126120        echo($Column['AddonFileName'].': ');
    127121        $i = 0;
    128122
    129         $Buffer = 'CZWOW_'.$Column['AddonFileName'].
    130         '_count='.$FileIndex.';
    131 CZWOW_'.$Column['AddonFileName'].'_'.$FileIndex.'={';
    132    
    133         $Query = 'SELECT T2.'.$Column['Column'].' AS Translation,
    134 T3.'.$Column['Column'].' as Original FROM (SELECT T1.entry,
    135 T1.'.$Column['Column'].' FROM (SELECT entry,'.$Column['Column'].' FROM
    136 '.$Group['TablePrefix'].' WHERE (Complete = 1) AND VersionStart <=
    137 '.$this->ClientVersion['BuildNumber'].' AND VersionEnd >=
    138 '.$this->ClientVersion['BuildNumber'].' AND '.$this->WhereLang.' AND
    139 '.$this->WhereUsers.$this->OrderByUserList.') AS T1 GROUP BY T1.entry) as T2
    140 JOIN '.$Group['TablePrefix'].' AS T3 ON (T2.entry = T3.entry) AND (T3.Language =
    141 0)';
     123        $Buffer = 'CZWOW_'.$Column['AddonFileName'].'_count='.$FileIndex.';CZWOW_'.$Column['AddonFileName'].'_'.$FileIndex.'={';
     124   
     125        $Query = 'SELECT T2.'.$Column['Column'].' AS Translation, T3.'.$Column['Column'].' as Original FROM (SELECT T1.entry, T1.'.$Column['Column'].' FROM (SELECT entry,'.$Column['Column'].' 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 T1 GROUP BY T1.entry) as T2 JOIN '.$Group['TablePrefix'].' AS T3 ON (T2.entry = T3.entry) AND (T3.Language = 0)';
    142126        $DbResult2 = $this->Database->query($Query);
    143127       
    144128       
    145129        if ($this->Database->affected_rows == 0) {
    146                         $ID = $this->Database->query('SELECT MAX(`VersionEnd`)
    147 FROM `'.$Group['TablePrefix'].'`');
     130                        $ID = $this->Database->query('SELECT MAX(`VersionEnd`) FROM `'.$Group['TablePrefix'].'`');
    148131                        $BuildNumber_max = $ID->fetch_assoc();
    149                         $BuildNumber_max =
    150 $BuildNumber_max['MAX(`VersionEnd`)'];
     132                        $BuildNumber_max = $BuildNumber_max['MAX(`VersionEnd`)'];
    151133                       
    152                         $Query = 'SELECT T2.'.$Column['Column'].' AS
    153 Translation, T3.'.$Column['Column'].' as Original FROM (SELECT T1.entry,
    154 T1.'.$Column['Column'].' FROM (SELECT entry,'.$Column['Column'].' FROM
    155 '.$Group['TablePrefix'].' WHERE (Complete = 1) AND VersionStart <=
    156 '.$BuildNumber_max.' AND VersionEnd >= '.$BuildNumber_max.' AND
    157 '.$this->WhereLang.' AND '.$this->WhereUsers.$this->OrderByUserList.') AS T1
    158 GROUP BY T1.entry) as T2 JOIN '.$Group['TablePrefix'].' AS T3 ON (T2.entry =
    159 T3.entry) AND (T3.Language = 0)';
     134                        $Query = 'SELECT T2.'.$Column['Column'].' AS Translation, T3.'.$Column['Column'].' as Original FROM (SELECT T1.entry, T1.'.$Column['Column'].' FROM (SELECT entry,'.$Column['Column'].' FROM '.$Group['TablePrefix'].' WHERE (Complete = 1) AND VersionStart <= '.$BuildNumber_max.' AND VersionEnd >= '.$BuildNumber_max.' AND '.$this->WhereLang.' AND '.$this->WhereUsers.$this->OrderByUserList.') AS T1 GROUP BY T1.entry) as T2 JOIN '.$Group['TablePrefix'].' AS T3 ON (T2.entry = T3.entry) AND (T3.Language = 0)';
    160135            $DbResult2 = $this->Database->query($Query);
    161136                       
     
    173148        }
    174149   
    175         $Buffer = $Buffer."\n};if not CZWOW_".$Column['AddonFileName']." then
    176 CZWOW_".$Column['AddonFileName']."=0; end;
    177 CZWOW_".$Column['AddonFileName']."=CZWOW_".$Column['AddonFileName']."+".$i.";\n"
     150        $Buffer = $Buffer."\n};if not CZWOW_".$Column['AddonFileName']." then CZWOW_".$Column['AddonFileName']."=0; end; CZWOW_".$Column['AddonFileName']."=CZWOW_".$Column['AddonFileName']."+".$i.";\n"
    178151;
    179152
     
    184157 
    185158    // Generate file Translates.xml
    186     $Buffer = '<Ui xmlns="http://www.blizzard.com/wow/ui/"
    187 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    188 xsi:schemaLocation="http://www.blizzard.com/wow/ui/.\FrameXML\UI.xsd"><script
    189 file="BookPage_1.lua"/>'."\n";
     159    $Buffer = '<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/.\FrameXML\UI.xsd"><scriptfile="BookPage_1.lua"/>'."\n";
    190160    foreach($CreatedFileList as $CreatedFile)
    191161      $Buffer .= '<script file="'.$CreatedFile.'.lua"/>'."\n";
     
    201171    $this->LoadFilters();
    202172 
    203     $Buffer = "local f=function(name, en, cz) CzWoW_interface[name]=cz;
    204 CzWoW_interface_entoname[en]=name; end; CzWoW_interface={
    205 };CzWoW_interface_entoname={ };\n";
     173    $Buffer = "local f=function(name, en, cz) CzWoW_interface[name]=cz;CzWoW_interface_entoname[en]=name; end; CzWoW_interface={};CzWoW_interface_entoname={ };\n";
    206174    $Group = $TranslationTree[14]; // client table
    207175    $Column['Column'] = 'Text';
    208     $Query = 'SELECT T2.'.$Column['Column'].' AS Translation,
    209 T3.'.$Column['Column'].' as Original, T3.ShortCut FROM (SELECT T1.entry,
    210 T1.'.$Column['Column'].' FROM (SELECT entry,'.$Column['Column'].' FROM
    211 '.$Group['TablePrefix'].' WHERE (Complete = 1) AND VersionStart <=
    212 '.$this->ClientVersion['BuildNumber'].' AND VersionEnd >=
    213 '.$this->ClientVersion['BuildNumber'].' AND '.$this->WhereLang.' AND
    214 '.$this->WhereUsers.$this->OrderByUserList.') AS T1 GROUP BY T1.entry) as T2
    215 JOIN '.$Group['TablePrefix'].' AS T3 ON (T2.entry = T3.entry) AND (T3.Language =
    216 0)';
     176    $Query = 'SELECT T2.'.$Column['Column'].' AS Translation, T3.'.$Column['Column'].' as Original, T3.ShortCut FROM (SELECT T1.entry, T1.'.$Column['Column'].' FROM (SELECT entry,'.$Column['Column'].' 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 T1 GROUP BY T1.entry) as T2 JOIN '.$Group['TablePrefix'].' AS T3 ON (T2.entry = T3.entry) AND (T3.Language = 0)';
    217177    $DbResult = $this->Database->query($Query);
    218178    while($Line = $DbResult->fetch_array())
     
    225185        $Translated = str_replace("|Hchannel:%d|h[%s]|h", '[%s]', $Translated);
    226186      }
    227       $Buffer .= 'f("'.addslashes($Line['ShortCut']).'", "'.$Original.'",
    228 "'.$Translated.'");'."\n";
     187      $Buffer .= 'f("'.addslashes($Line['ShortCut']).'", "'.$Original.'","'.$Translated.'");'."\n";
    229188    }
    230189
    231     if(!file_exists($this->TempDir.'CzWoW/')) mkdir($this->TempDir.'CzWoW/',
    232 0777, true);
     190    if(!file_exists($this->TempDir.'CzWoW/')) mkdir($this->TempDir.'CzWoW/',0777, true);
    233191    file_put_contents($this->TempDir.'CzWoW/LocalizationStrings.lua', $Buffer);
    234192  }
     
    244202  function MakeReadme()
    245203  {
    246     $DbResult = $this->Database->query('SELECT * FROM verseclient ORDER BY DATE
    247 DESC');
     204    $DbResult = $this->Database->query('SELECT * FROM verseclient ORDER BY DATE DESC');
    248205    $Line = $DbResult->fetch_assoc();
    249206
Note: See TracChangeset for help on using the changeset viewer.