Changeset 881 for trunk/Modules


Ignore:
Timestamp:
Apr 7, 2020, 11:58:08 PM (5 years ago)
Author:
chronos
Message:
  • Added: HTML viewport for mobile devices.
  • Fixed: Updated homepage URL.
Location:
trunk/Modules
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Export/Export.php

    r880 r881  
    2424  }
    2525
    26   function SaveAllUsers() {
     26  function SaveAllUsers()
     27  {
    2728    $DbResult = $this->System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$this->Id);
    2829    $Export = $DbResult->fetch_assoc();
    29     if ($Export['AllUsers']) {
     30    if ($Export['AllUsers'])
     31    {
    3032      $DbResult2 = $this->System->Database->query('SELECT ID FROM `User` WHERE `ID` NOT IN(SELECT `User` FROM `ExportUser` WHERE `Export`='.$this->Id.')');
    3133      while ($UserLine = $DbResult2->fetch_assoc())
    3234      {
    33             $Condition = ' WHERE `Export`='.$this->Id.' AND `User`='.$UserLine['ID'];
    34             $DbResult = $this->System->Database->query('SELECT * FROM `ExportUser` '.$Condition); //,MAX(`Sequence`) as MaxSequence
    35             if ($DbResult->num_rows > 0)
    36             {
    37             //  $this->System->Database->query('UPDATE `ExportUser` SET `Sequence`='.$Value.$Condition);
    38             } else
    39             {
    40               $this->System->Database->query('INSERT INTO `ExportUser` (`Export`, `User`, `Sequence`) VALUES ('.$this->Id.', '.$UserLine['ID'].', 0)');
    41             }
     35        $Condition = ' WHERE `Export`='.$this->Id.' AND `User`='.$UserLine['ID'];
     36        $DbResult = $this->System->Database->query('SELECT * FROM `ExportUser` '.$Condition); //,MAX(`Sequence`) as MaxSequence
     37        if ($DbResult->num_rows > 0)
     38        {
     39           //  $this->System->Database->query('UPDATE `ExportUser` SET `Sequence`='.$Value.$Condition);
     40        } else
     41        {
     42          $this->System->Database->query('INSERT INTO `ExportUser` (`Export`, `User`, `Sequence`) VALUES ('.$this->Id.', '.$UserLine['ID'].', 0)');
     43        }
    4244      }
    4345
     
    8890    // Build selected columns
    8991    $Columns = '';
    90     foreach ($TranslationTree[$Group['Id']]['Items'] as $Column) {
     92    foreach ($TranslationTree[$Group['Id']]['Items'] as $Column)
     93    {
    9194      if (!isset($GroupItems[$Column['Id']])) $Columns .= ' `T`.`'.$Column['Column'].'` AS `'.$Column['Column'].'`, ';
    9295    }
    9396  //  $Columns = substr($Columns, 0, -2);
    94 
    9597
    9698    $Query = 'SELECT * FROM (SELECT ANY_VALUE(`TT`.`ID`) AS `TTID` FROM (SELECT '.$Columns.' T.`ID`,T.`Language`,T.`User`,T.`Entry`,T.`VersionEnd`,T.`VersionStart`, `User`.`Name` AS `UserName` FROM `'.$Group['TablePrefix'].'` AS `T`'.
     
    104106    // Build columns for english texts
    105107    $OriginalColumns = '';
    106     foreach ($TranslationTree[$Group['Id']]['Items'] as $Column) {
     108    foreach ($TranslationTree[$Group['Id']]['Items'] as $Column)
     109    {
    107110      $OriginalColumns .= ' `T3`.`'.$Column['Column'].'` AS `En'.$Column['Column'].'`, ';
    108111      if (isset($GroupItems[$Column['Id']]))
     
    130133      $date = date('Y-m-d H:i',(filemtime($file)));
    131134    else return true;
    132   // echo $file;
    133135
    134136    $DbResult = $this->Database->query('SELECT `Group`.* FROM `ExportGroup` '.
     
    144146      ' ';
    145147
    146         $DbResult2 = $this->Database->query($Query);
    147         if ($DbResult2->num_rows > 0) {
    148           $result = true;
    149         }
     148      $DbResult2 = $this->Database->query($Query);
     149      if ($DbResult2->num_rows > 0)
     150      {
     151        $result = true;
     152      }
    150153    }
    151154    return $result;
     
    283286  function HaveVarible($String1, $String2, $StartChar = '$')
    284287  {
    285     if (strpos($String1,$StartChar) !== false) {
    286 
    287       while ( strpos($String1,$StartChar) !== false) {
    288           $pos = strpos($String1,$StartChar);
    289           $String1 = substr($String1,$pos+1);
    290           $varible = $String1;
    291           if (strpos($varible,' ')) $varible = substr($varible,0,strpos($varible,' '));
    292           if (strpos($varible,'.')) $varible = substr($varible,0,strpos($varible,'.'));
    293           if (strpos($varible,',')) $varible = substr($varible,0,strpos($varible,','));
    294           if (strpos($varible,'%')) $varible = substr($varible,0,strpos($varible,'%'));
    295           if (strpos($varible,chr(10))) $varible = substr($varible,0,strpos($varible,chr(10)));
    296        //   echo $pos.'-'.$varible.'-'.$String1.'-' .$String2.'
    297         //  ';
    298 
    299           if (false === strpos($String2,$varible)) {
    300               //  echo $varible;
    301             return false;
    302           }
     288    if (strpos($String1, $StartChar) !== false)
     289    {
     290      while (strpos($String1, $StartChar) !== false)
     291      {
     292        $pos = strpos($String1, $StartChar);
     293        $String1 = substr($String1, $pos + 1);
     294        $varible = $String1;
     295        if (strpos($varible, ' ')) $varible = substr($varible, 0, strpos($varible, ' '));
     296        if (strpos($varible, '.')) $varible = substr($varible, 0, strpos($varible, '.'));
     297        if (strpos($varible, ',')) $varible = substr($varible, 0, strpos($varible, ','));
     298        if (strpos($varible, '%')) $varible = substr($varible, 0, strpos($varible, '%'));
     299        if (strpos($varible, chr(10))) $varible = substr($varible, 0, strpos($varible, chr(10)));
     300
     301        if (false === strpos($String2, $varible))
     302        {
     303          return false;
     304        }
    303305      }
    304306    }
     
    306308  }
    307309
    308   function AddProgress($add = 1) {
    309 
     310  function AddProgress($add = 1)
     311  {
    310312    $DbResult = $this->System->Database->query('SELECT Progress FROM `ExportTask` WHERE `Export`='.$this->Id);
    311313    $Task = $DbResult->fetch_assoc();
     
    344346        $LookupTable = array();
    345347        $DbResult2 = $this->Database->query($this->BuildQuery($Group));
    346         while ($DbRow = $DbResult2->fetch_assoc()) {
     348        while ($DbRow = $DbResult2->fetch_assoc())
     349        {
    347350          //Export only if translate have same varible %
    348351          $CanExport = true;
    349           foreach ($TranslationTree[$Group['Id']]['Items'] as $Column)  {
     352          foreach ($TranslationTree[$Group['Id']]['Items'] as $Column)
     353          {
    350354            $DbRow[$Column['Column']] = str_replace ( '$ ','$',$DbRow[$Column['Column']]);
    351             if (!$this->HaveVarible($DbRow['En'.$Column['Column']],$DbRow[$Column['Column']])) {
     355            if (!$this->HaveVarible($DbRow['En'.$Column['Column']],$DbRow[$Column['Column']]))
     356            {
    352357              $CanExport = false;
    353358              $Output .= ', NE='.$DbRow['ID'];
    354359            }
    355             if (!$this->HaveVarible($DbRow[$Column['Column']],$DbRow['En'.$Column['Column']])) {
     360            if (!$this->HaveVarible($DbRow[$Column['Column']],$DbRow['En'.$Column['Column']]))
     361            {
    356362              $CanExport = false;
    357363              $Output .= ', NE='.$DbRow['ID'];
     
    361367          if ($CanExport)
    362368            $LookupTable[$DbRow[$Group['PrimaryKeyItem']]] = $DbRow;
    363 
    364369        }
    365370
     
    369374
    370375        // Create new DBC file
    371         if (!file_exists($this->TempDir.'dbc/')) mkdir ($this->TempDir.'dbc/', 0777, true);
     376        if (!file_exists($this->TempDir.'dbc/')) mkdir($this->TempDir.'dbc/', 0777, true);
    372377        $NewDBCFile = new DBCFile();
    373378        $NewDBCFile->CreateFile($this->TempDir.'dbc/'.$Group['DBCFileName'].'.dbc', $ColumnFormat);
     
    448453      $LookupTable = array();
    449454      $DbResult2 = $this->Database->query($this->BuildQuery($Group));
    450       while ($DbRow = $DbResult2->fetch_assoc()) {
     455      while ($DbRow = $DbResult2->fetch_assoc())
     456      {
    451457          $CanExport = true;
    452           foreach ($TranslationTree[$Group['Id']]['Items'] as $Column)  {
     458          foreach ($TranslationTree[$Group['Id']]['Items'] as $Column)
     459          {
    453460          //  if (strpos($DbRow[$Column['Column']],'\\'))
    454461           //   $CanExport = false;
     
    456463         //   $DbRow[$Column['Column']] = $DbRow['En'.$Column['Column']];
    457464
    458             if (!$this->HaveVarible($DbRow['En'.$Column['Column']],$DbRow[$Column['Column']])) {
    459               if ($CanExport) $Output .= ', NE='.$DbRow['ID'];
    460               $CanExport = false;
    461             }
    462             if (!$this->HaveVarible($DbRow[$Column['Column']],$DbRow['En'.$Column['Column']])) {
    463               if ($CanExport) $Output .= ', NE='.$DbRow['ID'];
    464               $CanExport = false;
    465             }
    466             if (!$this->HaveVarible($DbRow['En'.$Column['Column']],$DbRow[$Column['Column']],'%')) {
    467               if ($CanExport) $Output .= ', NE='.$DbRow['ID'];
    468               $CanExport = false;
    469             }
    470             if (!$this->HaveVarible($DbRow[$Column['Column']],$DbRow['En'.$Column['Column']],'%')) {
    471               if ($CanExport) $Output .= ', NE='.$DbRow['ID'];
    472               $CanExport = false;
    473             }
    474             if (!$this->HaveVarible($DbRow[$Column['Column']],$DbRow['En'.$Column['Column']],'\\')) {
    475               if ($CanExport) $Output .= ', NE='.$DbRow['ID'];
    476               $CanExport = false;
    477             }
    478             if (!$this->HaveVarible($DbRow['En'.$Column['Column']],$DbRow[$Column['Column']],'\\')) {
    479               if ($CanExport) $Output .= ', NE='.$DbRow['ID'];
    480               $CanExport = false;
    481             }
    482             if (!$this->HaveVarible($DbRow[$Column['Column']],$DbRow['En'.$Column['Column']],'|')) {
    483               if ($CanExport) $Output .= ', NE='.$DbRow['ID'];
    484               $CanExport = false;
    485             }
    486             if (!$this->HaveVarible($DbRow['En'.$Column['Column']],$DbRow[$Column['Column']],'|')) {
    487               if ($CanExport) $Output .= ', NE='.$DbRow['ID'];
    488               $CanExport = false;
    489             }
    490             if (!$this->HaveVarible($DbRow[$Column['Column']],$DbRow['En'.$Column['Column']],chr(10))) {
    491               if ($CanExport) $Output .= ', NE='.$DbRow['ID'];
    492               $CanExport = false;
    493             }
    494             if (!$this->HaveVarible($DbRow['En'.$Column['Column']],$DbRow[$Column['Column']],chr(10))) {
     465            if (!$this->HaveVarible($DbRow['En'.$Column['Column']],$DbRow[$Column['Column']]))
     466            {
     467              if ($CanExport) $Output .= ', NE='.$DbRow['ID'];
     468              $CanExport = false;
     469            }
     470            if (!$this->HaveVarible($DbRow[$Column['Column']],$DbRow['En'.$Column['Column']]))
     471            {
     472              if ($CanExport) $Output .= ', NE='.$DbRow['ID'];
     473              $CanExport = false;
     474            }
     475            if (!$this->HaveVarible($DbRow['En'.$Column['Column']],$DbRow[$Column['Column']],'%'))
     476            {
     477              if ($CanExport) $Output .= ', NE='.$DbRow['ID'];
     478              $CanExport = false;
     479            }
     480            if (!$this->HaveVarible($DbRow[$Column['Column']],$DbRow['En'.$Column['Column']],'%'))
     481            {
     482              if ($CanExport) $Output .= ', NE='.$DbRow['ID'];
     483              $CanExport = false;
     484            }
     485            if (!$this->HaveVarible($DbRow[$Column['Column']],$DbRow['En'.$Column['Column']],'\\'))
     486            {
     487              if ($CanExport) $Output .= ', NE='.$DbRow['ID'];
     488              $CanExport = false;
     489            }
     490            if (!$this->HaveVarible($DbRow['En'.$Column['Column']],$DbRow[$Column['Column']],'\\'))
     491            {
     492              if ($CanExport) $Output .= ', NE='.$DbRow['ID'];
     493              $CanExport = false;
     494            }
     495            if (!$this->HaveVarible($DbRow[$Column['Column']],$DbRow['En'.$Column['Column']],'|'))
     496            {
     497              if ($CanExport) $Output .= ', NE='.$DbRow['ID'];
     498              $CanExport = false;
     499            }
     500            if (!$this->HaveVarible($DbRow['En'.$Column['Column']],$DbRow[$Column['Column']],'|'))
     501            {
     502              if ($CanExport) $Output .= ', NE='.$DbRow['ID'];
     503              $CanExport = false;
     504            }
     505            if (!$this->HaveVarible($DbRow[$Column['Column']],$DbRow['En'.$Column['Column']],chr(10)))
     506            {
     507              if ($CanExport) $Output .= ', NE='.$DbRow['ID'];
     508              $CanExport = false;
     509            }
     510            if (!$this->HaveVarible($DbRow['En'.$Column['Column']],$DbRow[$Column['Column']],chr(10)))
     511            {
    495512              if ($CanExport) $Output .= ', NE='.$DbRow['ID'];
    496513              $CanExport = false;
     
    499516
    500517        if ($CanExport)
    501             $LookupTable[$DbRow['ShortCut']] = $DbRow;
     518          $LookupTable[$DbRow['ShortCut']] = $DbRow;
    502519      }
    503520
     
    516533            $Line = substr($Line, 1); // Skip start qoute
    517534            $TempLine = str_replace('\"', '  ', $Line); // Temporary remove slashed quotes
    518             if (strpos($TempLine, '"')) {
     535            if (strpos($TempLine, '"'))
     536            {
    519537               $Value['Text'] = substr($Line, 0, strpos($TempLine, '"'));
    520538            } else {
     
    558576  }
    559577
    560   function GetReadme() {
     578  function GetReadme()
     579  {
    561580    $_GET['ExportId'] = $this->Id;
    562581    $PageExport = new PageExport($this->System);
     
    631650Ne úplně, protože se vystavujete riziku zablokování vašeho účtu z důvodu použití upravené hry. Na oficiálním serveru lze využít pouze Addon s češtinou CzWoW. Instalační soubor určený pro oficiální servery je už takto přizpůsoben.</p>'.
    632651
    633 '</td><td>';
    634 
    635   $Output .= $PageExport->ExportViewStat(' WHERE `DBCFileName` !=\'\' OR `LuaFileName` !=\'\' OR `Group`.`Id` = 1 OR `Group`.`Id` = 2 OR `Group`.`Id` = 3 OR `Group`.`Id` = 16');
    636 
    637   $Output .= '</td></tr></table>'.
    638 
    639 
    640   '</body></html>';
    641   return $Output;
    642 }
     652    '</td><td>';
     653
     654    $Output .= $PageExport->ExportViewStat(' WHERE `DBCFileName` !=\'\' OR `LuaFileName` !=\'\' OR `Group`.`Id` = 1 OR `Group`.`Id` = 2 OR `Group`.`Id` = 3 OR `Group`.`Id` = 16');
     655
     656    $Output .= '</td></tr></table>'.
     657      '</body></html>';
     658    return $Output;
     659  }
    643660
    644661  function ExportToXML()
  • trunk/Modules/Log/Log.php

    r880 r881  
    125125    $this->Title = T('System log');
    126126    $Output = '';
    127     if (array_key_exists('type', $_GET)) $_SESSION['type'] = $_GET['type'] * 1;
     127    if (array_key_exists('type', $_GET) and (is_numeric($_GET['type']))) $_SESSION['type'] = $_GET['type'] * 1;
    128128    else if (!array_key_exists('type', $_SESSION)) $_SESSION['type'] = '';
    129129
Note: See TracChangeset for help on using the changeset viewer.