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/create_addon.php

    r267 r291  
    11<?php
    22
    3 /*
    4 if(Licence(LICENCE_ADMIN))
    5 
    6         // echo 'Přístup povolen';
    7 } else die('Přístup zamítnut!');
    8 */
    9 
    10 // Replace special codes by lua functions
    11 function ReplaceVarInText($string)
     3include_once('export.php');
     4
     5class ExportAddon extends Export
    126{
    13   $string = str_replace('$N', '"..strlower(UnitName("player")).."', $string);
    14   $string = str_replace('$n', '"..strlower(UnitName("player")).."', $string);
    15   $string = str_replace('$C', '"..strlower(UnitClass("player")).."', $string);
    16   $string = str_replace('$c', '"..strlower(UnitClass("player")).."', $string);
    17   $string = str_replace('$R', '"..strlower(UnitRace("player")).."', $string);
    18   $string = str_replace('$r', '"..strlower(UnitRace("player")).."', $string);
    19   $Gender = '$G';
    20   while(strpos($string, $Gender) !== false)
    21   {
    22         $Before = substr($string, 0, strpos($string, $Gender));
    23         $Man = substr($string, strpos($string, $Gender) + 2);
    24         $Woman = substr($Man, strpos($Man, ':') + 1);
    25         $After = substr($Woman, strpos($Woman, ';') + 1);
    26         $Man = substr($Man, 0, strpos($Man, ':'));
    27         $Woman = substr($Woman, 0, strpos($Woman, ';'));
    28         $string = $Before.'"..gsub(gsub(UnitSex("player"), "^2$", "'.
    29           $Man.'"), "^3$", "'.$Woman.'").."'.$After;
    30   }
    31   $Gender = '$g';
    32   while(strpos($string, $Gender) !== false)
    33   {
    34         $Before = substr($string, 0, strpos($string, $Gender));
    35         $Man = substr($string, strpos($string, $Gender) + 2);
    36         $Woman = substr($Man, strpos($Man, ':') + 1);
    37         $After = substr($Woman, strpos($Woman, ';') + 1);
    38         $Man = substr($Man, 0, strpos($Man, ':'));
    39         $Woman = substr($Woman, 0, strpos($Woman, ';'));
    40         $string = $Before.'"..gsub(gsub(UnitSex("player"), "^2$", "'.$Man.'"), "^3$", "'.$Woman.'").."'.$After;
    41   }
    42 
    43   $string = str_replace('$', '', $string);
    44   $string = str_replace("\r", '', $string);
    45   $string = str_replace("\n", '\r\n', $string);
    46   return($string);     
    47 }
    48 
    49 function ReplaceEnText($string)
    50 {
    51   //    $string = mysql_escape_string($string);
    52   $string = strtolower($string);
    53  
    54   $string = str_replace('"', '\"', $string);
    55   $string = str_replace('$b$b', ' ', $string); 
    56   $string = str_replace('$b $b', ' ', $string);         
    57   $string = str_replace('$b', ' ', $string);   
    58   while(strpos($string, '  '))
    59     $string = str_replace('  ', ' ', $string);
    60   $string = ReplaceVarInText($string); 
    61   return($string);
    62 }
    63 
    64 function ReplaceCzText($string)
    65 {
    66   $string = mysql_escape_string($string);
    67   $string = str_replace('$B', '\r\n', $string);
    68   $string = str_replace('$b', '\r\n', $string);
    69   $string = ReplaceVarInText($string);
    70   return($string);
    71 }
    72 
    73 function NotCancel($string)
    74 {
    75         //echo (strpos($string,'<html>'));
    76   if (strpos($string,'<html>') > -1) {
    77         return(false);
    78   } else {
    79     return(true);
    80   }
    81 }
    82 
    83 function MakeLanguageFiles($Setting)
    84 {
    85   global $Database, $TempDir, $TranslationTree, $CreatedFileList, $LanguageList;
    86  
    87   $CreatedFileList = array();
    88   $CreatedFileListCount = array();
    89  
    90   $WhereLang = '';
    91   foreach($LanguageList as $Language)
    92     if($Language['Enabled'] == 1)
    93       if(isset($Setting['language'.$Language['Id']]))  $WhereLang .= ' OR (Language = '.$Language['Id'].')';
    94   if($WhereLang == '') $WhereLang = 1;
    95     else $WhereLang = '('.substr($WhereLang, 4).')';
    96 
    97   $SelectedUsers = ''; 
    98   foreach($Setting['users-selection'] as $Item)
    99     $SelectedUsers .= ','.$Item;
    100   $SelectedUsers = substr($SelectedUsers, 1);
    101 
    102   if($SelectedUsers == '')
    103   {
    104         $WhereUsers = 1;
    105         $OrderByUserList = '';
    106   } else
    107   {
    108         $WhereUsers = '(User IN ('.$SelectedUsers.'))';
    109         $OrderByUserList = ' ORDER BY FIELD(User, '.$SelectedUsers.')';
    110   }
    111        
    112   foreach($TranslationTree as $Group)
    113   if(($Group['TablePrefix'] != '') and (in_array($Group['Id'], $Setting['groups'])))
    114   {     
    115         foreach($Group['Items'] as $Column)
    116         if($Column['AddonFileName'] != '')     
    117         {
    118       if(!isset($CreatedFileListCount[$Column['AddonFileName']]))
    119             $CreatedFileListCount[$Column['AddonFileName']] = 0;
    120           $CreatedFileListCount[$Column['AddonFileName']]++;
    121           $FileIndex = $CreatedFileListCount[$Column['AddonFileName']];
    122          
    123           $CreatedFileList[] = $Column['AddonFileName'].'_'.$FileIndex;
    124       $FileName = $TempDir.$Column['AddonFileName'].'_'.$FileIndex.'.lua';
    125       echo($Column['AddonFileName'].': ');
    126       $i = 0;
    127 
    128       $Buffer = 'CZWOW_'.$Column['AddonFileName'].
    129             '_count='.$FileIndex.'; CZWOW_'.$Column['AddonFileName'].'_'.$FileIndex.'={';
    130    
    131       $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 <= '.GetBuildNumber($Setting['Version']).' AND VersionEnd >= '.GetBuildNumber($Setting['Version']).' AND '.$WhereLang.' AND '.$WhereUsers.$OrderByUserList.') AS T1 GROUP BY T1.entry) as T2 JOIN '.$Group['TablePrefix'].' AS T3 ON (T2.entry = T3.entry) AND (T3.Language = 0)';
    132       $DbResult = $Database->SQLCommand($Query);
    133       while($Line = mysql_fetch_array($DbResult))
    134           {
    135         $en = trim(ReplaceEnText($Line['Original'])); 
    136         $cz = ReplaceCzText($Line['Translation']);
    137         if(($en <> '') and ($cz <> '') and (NotCancel($en)))
    138             {
    139           $Buffer .= "\n".'["'.$en.'"]="'.$cz.'",';
    140           $i++;
     7 
     8  // Replace special codes by lua functions
     9  function ReplaceVarInText($string)
     10  {
     11    $string = str_replace('$N', '"..strlower(UnitName("player")).."', $string);
     12    $string = str_replace('$n', '"..strlower(UnitName("player")).."', $string);
     13    $string = str_replace('$C', '"..strlower(UnitClass("player")).."', $string);
     14    $string = str_replace('$c', '"..strlower(UnitClass("player")).."', $string);
     15    $string = str_replace('$R', '"..strlower(UnitRace("player")).."', $string);
     16    $string = str_replace('$r', '"..strlower(UnitRace("player")).."', $string);
     17    $Gender = '$G';
     18    while(strpos($string, $Gender) !== false)
     19    {
     20      $Before = substr($string, 0, strpos($string, $Gender));
     21      $Man = substr($string, strpos($string, $Gender) + 2);
     22      $Woman = substr($Man, strpos($Man, ':') + 1);
     23      $After = substr($Woman, strpos($Woman, ';') + 1);
     24      $Man = substr($Man, 0, strpos($Man, ':'));
     25      $Woman = substr($Woman, 0, strpos($Woman, ';'));
     26      $string = $Before.'"..gsub(gsub(UnitSex("player"), "^2$", "'.
     27      $Man.'"), "^3$", "'.$Woman.'").."'.$After;
     28    }
     29    $Gender = '$g';
     30    while(strpos($string, $Gender) !== false)
     31    {
     32      $Before = substr($string, 0, strpos($string, $Gender));
     33      $Man = substr($string, strpos($string, $Gender) + 2);
     34      $Woman = substr($Man, strpos($Man, ':') + 1);
     35      $After = substr($Woman, strpos($Woman, ';') + 1);
     36      $Man = substr($Man, 0, strpos($Man, ':'));
     37      $Woman = substr($Woman, 0, strpos($Woman, ';'));
     38      $string = $Before.'"..gsub(gsub(UnitSex("player"), "^2$", "'.$Man.'"), "^3$", "'.$Woman.'").."'.$After;
     39    }
     40
     41    $string = str_replace('$', '', $string);
     42    $string = str_replace("\r", '', $string);
     43    $string = str_replace("\n", '\r\n', $string);
     44    return($string);   
     45  }
     46
     47  function ReplaceEnText($string)
     48  {
     49    //  $string = mysql_escape_string($string);
     50    $string = strtolower($string);
     51 
     52    $string = str_replace('"', '\"', $string);
     53    $string = str_replace('$b$b', ' ', $string); 
     54    $string = str_replace('$b $b', ' ', $string);   
     55    $string = str_replace('$b', ' ', $string); 
     56    while(strpos($string, '  '))
     57      $string = str_replace('  ', ' ', $string);
     58    $string = $this->ReplaceVarInText($string); 
     59    return($string);
     60  }
     61
     62  function ReplaceCzText($string)
     63  {
     64    $string = mysql_escape_string($string);
     65    $string = str_replace('$B', '\r\n', $string);
     66    $string = str_replace('$b', '\r\n', $string);
     67    $string = $this->ReplaceVarInText($string);
     68    return($string);
     69  }
     70
     71  function NotCancel($string)
     72  {
     73    //echo (strpos($string,'<html>'));
     74    if (strpos($string,'<html>') > -1) return(false);
     75      else return(true);
     76  }
     77
     78  function MakeLanguageFiles()
     79  {
     80    global $TranslationTree, $CreatedFileList, $LanguageList;
     81   
     82    $this->LoadFilters();
     83   
     84    $CreatedFileList = array();
     85    $CreatedFileListCount = array();
     86 
     87    $DbResult = $this->Database->query('SELECT `group`.* FROM `ExportGroup` JOIN `group` ON `group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id.' AND `group`.`TablePrefix` != ""');
     88    while($Group = $DbResult->fetch_assoc())
     89    {
     90      foreach($TranslationTree[$Group['Id']]['Items'] as $Column)
     91      if($Column['AddonFileName'] != '') 
     92      {
     93        if(!isset($CreatedFileListCount[$Column['AddonFileName']]))
     94        $CreatedFileListCount[$Column['AddonFileName']] = 0;
     95        $CreatedFileListCount[$Column['AddonFileName']]++;
     96        $FileIndex = $CreatedFileListCount[$Column['AddonFileName']];
     97   
     98        $CreatedFileList[] = $Column['AddonFileName'].'_'.$FileIndex;
     99        $FileName = $this->TempDir.$Column['AddonFileName'].'_'.$FileIndex.'.lua';
     100        echo($Column['AddonFileName'].': ');
     101        $i = 0;
     102
     103        $Buffer = 'CZWOW_'.$Column['AddonFileName'].
     104        '_count='.$FileIndex.'; CZWOW_'.$Column['AddonFileName'].'_'.$FileIndex.'={';
     105   
     106        $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)';
     107        $DbResult2 = $this->Database->query($Query);
     108        while($Line = $DbResult2->fetch_assoc())
     109        {
     110          $en = trim($this->ReplaceEnText($Line['Original'])); 
     111          $cz = $this->ReplaceCzText($Line['Translation']);
     112          if(($en <> '') and ($cz <> '') and ($this->NotCancel($en)))
     113          {
     114            $Buffer .= "\n".'["'.$en.'"]="'.$cz.'",';
     115            $i++;
     116          }
    141117        }
     118   
     119        $Buffer = $Buffer."\n};if not CZWOW_".$Column['AddonFileName']." then CZWOW_".$Column['AddonFileName']."=0; end; CZWOW_".$Column['AddonFileName']."=CZWOW_".$Column['AddonFileName']."+".$i.";\n";
     120
     121        file_put_contents($FileName, $Buffer);
     122        echo('<b>Hotovo</b><br />');
    142123      }
    143    
    144       $Buffer = $Buffer."\n};if not CZWOW_".$Column['AddonFileName']." then CZWOW_".$Column['AddonFileName']."=0; end; CZWOW_".$Column['AddonFileName']."=CZWOW_".$Column['AddonFileName']."+".$i.";\n";
    145 
    146           file_put_contents($FileName, $Buffer);
    147       echo('<b>Hotovo</b><br />');
    148         }
    149   }
    150  
    151   // Generate file Translates.xml
    152   $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"><script file="BookPage_1.lua"/>'."\n";
    153   foreach($CreatedFileList as $CreatedFile)
    154     $Buffer .= '<script file="'.$CreatedFile.'.lua"/>'."\n";
    155   $Buffer .= '</Ui>';
    156   file_put_contents($TempDir.'Translates.xml', $Buffer);
    157 }
    158 
    159 function MakeClientStrings($Setting)
    160 {
    161   global $Database, $TempDir, $TranslationTree, $LanguageList;
    162  
    163   $WhereLang = '';
    164   foreach($LanguageList as $Language)
    165     if($Language['Enabled'] == 1)
    166       if(isset($Setting['language'.$Language['Id']]))  $WhereLang .= ' OR (Language = '.$Language['Id'].')';
    167   if($WhereLang == '') $WhereLang = 1;
    168     else $WhereLang = '('.substr($WhereLang, 4).')';
    169 
    170   $SelectedUsers = ''; 
    171   foreach($Setting['users-selection'] as $Item)
    172     $SelectedUsers .= ','.$Item;
    173   $SelectedUsers = substr($SelectedUsers, 1);
    174 
    175   if($SelectedUsers == '')
    176   {
    177         $WhereUsers = 1;
    178         $OrderByUserList = '';
    179   } else
    180   {
    181         $WhereUsers = '(User IN ('.$SelectedUsers.'))';
    182         $OrderByUserList = ' ORDER BY FIELD(User, '.$SelectedUsers.')';
    183   }
    184        
    185   $Buffer = "local f=function(name, en, cz) CzWoW_interface[name]=cz; CzWoW_interface_entoname[en]=name; end; CzWoW_interface={ };CzWoW_interface_entoname={ };\n";
    186   $Group = $TranslationTree[14]; // client table
    187   $Column['Column'] = 'Text';
    188   $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 <= '.GetBuildNumber($Setting['Version']).' AND VersionEnd >= '.GetBuildNumber($Setting['Version']).' AND '.$WhereLang.' AND '.$WhereUsers.$OrderByUserList.') AS T1 GROUP BY T1.entry) as T2 JOIN '.$Group['TablePrefix'].' AS T3 ON (T2.entry = T3.entry) AND (T3.Language = 0)';
    189   $DbResult = $Database->SQLCommand($Query);
    190   while($Line = mysql_fetch_array($DbResult))
    191   {
    192                 $Original = str_replace("\r", '', str_replace("\n", '\r\\'."\n", addslashes($Line['Original'])));
    193                 $Translated = str_replace("\r", '', str_replace("\n", '\r\\'."\n", addslashes($Line['Translation'])));
    194         if ($Setting['Version'] == '2.4.3') {
    195                 $Original = str_replace("|Hchannel:%d|h[%s]|h", '[%s]', $Original);
    196                 $Translated = str_replace("|Hchannel:%d|h[%s]|h", '[%s]', $Translated);
    197         }
    198     $Buffer .= 'f("'.addslashes($Line['ShortCut']).'", "'.$Original.'", "'.$Translated.'");'."\n";
    199   }
    200   //nepřeložené texty
    201   $Query = 'SELECT '.$Column['Column'].' as Original, ShortCut FROM '.$Group['TablePrefix'].' WHERE Language = 0  AND VersionStart <= '.GetBuildNumber($Setting['Version']).' AND VersionEnd >= '.GetBuildNumber($Setting['Version']).' AND entry NOT IN (SELECT entry FROM '.$Group['TablePrefix'].' WHERE (Complete = 1)  AND VersionStart <= '.GetBuildNumber($Setting['Version']).' AND VersionEnd >= '.GetBuildNumber($Setting['Version']).' AND '.$WhereLang.' AND '.$WhereUsers.')';
    202   $DbResult = $Database->SQLCommand($Query);
    203   while($Line = mysql_fetch_array($DbResult))
    204   {
    205                 $Original = str_replace("\r", '', str_replace("\n", '\r\\'."\n", addslashes($Line['Original'])));
    206                 $Translated = str_replace("\r", '', str_replace("\n", '\r\\'."\n", $Line['Original']));
    207         if ($Setting['Export'] == 'Addon-2.x.x') {
    208                 $Original = str_replace("|Hchannel:%d|h[%s]|h", '[%s]', $Original);
    209                 $Translated = str_replace("|Hchannel:%d|h[%s]|h", '[%s]', $Translated);
    210         }
    211     $Buffer .= 'f("'.addslashes($Line['ShortCut']).'", "'.$Original.'", "'.$Translated.'");'."\n";
    212   }
    213   file_put_contents($TempDir.'LocalizationStrings.lua', $Buffer);
    214 }
    215 
    216 function MakeAddon($Setting)
    217 {
    218   global $TempDir;
    219  
    220   if(!file_exists($TempDir)) mkdir($TempDir, 0777, true);
    221   MakeLanguageFiles($Setting);
    222   MakeClientStrings($Setting);
    223  // MakeMainScript($Setting);
    224 }
    225 
    226 function MakeReadme($Setting)
    227 {
    228   global $TempDir,$Database;
    229        
    230   $ID = $Database->SQLCommand('SELECT * FROM verseclient ORDER BY DATE DESC');
    231   $Line = mysql_fetch_assoc($ID);
    232 
    233   $Buffer = '
     124    }
     125 
     126    // Generate file Translates.xml
     127    $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"><script file="BookPage_1.lua"/>'."\n";
     128    foreach($CreatedFileList as $CreatedFile)
     129      $Buffer .= '<script file="'.$CreatedFile.'.lua"/>'."\n";
     130    $Buffer .= '</Ui>';
     131    file_put_contents($this->TempDir.'Translates.xml', $Buffer);
     132  }
     133
     134  function MakeClientStrings()
     135  {
     136    global $TranslationTree, $LanguageList;
     137 
     138    $this->LoadFilters();
     139 
     140    $Buffer = "local f=function(name, en, cz) CzWoW_interface[name]=cz; CzWoW_interface_entoname[en]=name; end; CzWoW_interface={ };CzWoW_interface_entoname={ };\n";
     141    $Group = $TranslationTree[14]; // client table
     142    $Column['Column'] = 'Text';
     143    $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)';
     144    $DbResult = $this->Database->query($Query);
     145    while($Line = $DbResult->fetch_array())
     146    {
     147      $Original = str_replace("\r", '', str_replace("\n", '\r\\'."\n", addslashes($Line['Original'])));
     148      $Translated = str_replace("\r", '', str_replace("\n", '\r\\'."\n", addslashes($Line['Translation'])));
     149      if ($this->ClientVersion['Version'] == '2.4.3')
     150      {
     151        $Original = str_replace("|Hchannel:%d|h[%s]|h", '[%s]', $Original);
     152        $Translated = str_replace("|Hchannel:%d|h[%s]|h", '[%s]', $Translated);
     153      }
     154      $Buffer .= 'f("'.addslashes($Line['ShortCut']).'", "'.$Original.'", "'.$Translated.'");'."\n";
     155    }
     156    //nepřeložené texty
     157    $Query = 'SELECT '.$Column['Column'].' as Original, ShortCut FROM '.$Group['TablePrefix'].' WHERE Language = 0  AND VersionStart <= '.$this->ClientVersion['BuildNumber'].' AND VersionEnd >= '.$this->ClientVersion['BuildNumber'].' AND entry NOT IN (SELECT entry FROM '.$Group['TablePrefix'].' WHERE (Complete = 1)  AND VersionStart <= '.$this->ClientVersion['BuildNumber'].' AND VersionEnd >= '.$this->ClientVersion['BuildNumber'].' AND '.$this->WhereLang.' AND '.$this->WhereUsers.')';
     158    $DbResult = $this->Database->query($Query);
     159    while($Line = $DbResult->fetch_array())
     160    {
     161      $Original = str_replace("\r", '', str_replace("\n", '\r\\'."\n", addslashes($Line['Original'])));
     162      $Translated = str_replace("\r", '', str_replace("\n", '\r\\'."\n", $Line['Original']));
     163      if(substr($this->ClientVersion['Version'], 0, 2) == '2.')
     164      {
     165        $Original = str_replace("|Hchannel:%d|h[%s]|h", '[%s]', $Original);
     166        $Translated = str_replace("|Hchannel:%d|h[%s]|h", '[%s]', $Translated);
     167      }
     168      $Buffer .= 'f("'.addslashes($Line['ShortCut']).'", "'.$Original.'", "'.$Translated.'");'."\n";
     169    }
     170    file_put_contents($this->TempDir.'LocalizationStrings.lua', $Buffer);
     171  }
     172
     173  function MakeAddon()
     174  {
     175    if(!file_exists($this->TempDir)) mkdir($this->TempDir, 0777, true);
     176    $this->MakeLanguageFiles();
     177    $this->MakeClientStrings();
     178   // MakeMainScript($Setting);
     179  }
     180
     181  function MakeReadme()
     182  {
     183    $DbResult = $this->Database->query('SELECT * FROM verseclient ORDER BY DATE DESC');
     184    $Line = $DbResult->fetch_assoc();
     185
     186    $Buffer = '
    234187 Čeština pro klienty:
    235188  Vytvořeno v projektu http://wowpreklad.zdechov.net/
     
    241194 Verze:
    242195  Verze Addonu: '.$Line['verse'].'
    243   Tato verze je pro verzi hry '.$Setting['Version'].'
     196  Tato verze je pro verzi hry '.$this->ClientVersion['Version'].'
    244197 
    245198 Změny ve verzích:
    246199 
    247   ';
    248   $ID = $Database->SQLCommand('SELECT * FROM verseclient ORDER BY DATE DESC');
    249   while($Line = mysql_fetch_assoc($ID))
    250   {
    251     $Buffer .='
     200    ';
     201    $DbResult = $Database->query('SELECT * FROM verseclient ORDER BY DATE DESC');
     202    while($Line = $DbResult->fetch_assoc())
     203    {
     204      $Buffer .='
    252205  Verze: '.$Line['verse'].'
    253206  =============
     
    255208 
    256209  ';
    257   }
    258   file_put_contents($TempDir.'CZWOW-Readme.txt', $Buffer);
     210    }
     211    file_put_contents($this->TempDir.'CZWOW-Readme.txt', $Buffer);
     212  }
    259213}
    260 
     214 
    261215?>
Note: See TracChangeset for help on using the changeset viewer.