Changeset 881


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

Legend:

Unmodified
Added
Removed
  • trunk/Application/Version.php

    r879 r881  
    77
    88$Version = '1.0';
    9 $Revision = 873; // Subversion revision
     9$Revision = 881; // Subversion revision
    1010$DatabaseRevision = 873; // Database structure revision
    1111$ReleaseDate = strtotime('2020-04-07');
  • trunk/Application/View.php

    r880 r881  
    7777    '<meta name="description" content="'.$this->System->Config['Web']['Description'].'" />'.
    7878    '<meta name="robots" content="all" />'.
     79    '<meta name="viewport" content="width=device-width, initial-scale=1">'.
    7980    '<link rel="stylesheet" href="'.$this->System->Link('/style/style.css').'" type="text/css" media="all" />'.
    8081    '<script type="text/javascript" src="'.$this->System->Link('/style/global.js').'"></script>'.
     
    119120    foreach ($this->System->Bars['Right'] as $BarItem)
    120121      $Bar .= call_user_func($BarItem);
    121       if (trim($Bar) != '') $Output .= $Bar;
     122    if (trim($Bar) != '') $Output .= $Bar;
    122123      else $Output .= '&nbsp;';
    123124    $Output .= '</td>';
    124125    $Output .= '</tr><tr>'.
    125126      '<td colspan="4" class="page-bottom">'.T('Version').': '.$Version.' '.T('Revision').': '.$Revision.' ('.$this->System->HumanDate($ReleaseDate).')'.
    126       ' &nbsp; <a href="http://svn.zdechov.net/trac/wowpreklad/browser/trunk">'.T('Source code').'</a> &nbsp; '.
    127       '<a href="http://svn.zdechov.net/trac/wowpreklad/log/trunk?verbose=on">'.T('Changelog').'</a> &nbsp; '.
     127      ' &nbsp; <a href="https://app.zdechov.net/wowpreklad/browser/trunk">'.T('Source code').'</a> &nbsp; '.
     128      '<a href="https://app.zdechov.net/wowpreklad/log/trunk?verbose=on">'.T('Changelog').'</a> &nbsp; '.
    128129      $this->System->Config['Web']['WebCounter'];
    129130
  • trunk/Install/deb/debian/control

    r877 r881  
    1010Depends: ${shlibs:Depends}, ${misc:Depends}, apache2, php, dbconfig-mysql
    1111Description: World of Warcraft web translation platform.
    12 HomePage: http://svn.zdechov.net/trac/wowpreklad
     12HomePage: https://app.zdechov.net/wowpreklad
  • 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
  • trunk/Packages/Common/Common.php

    r880 r881  
    3434    $this->Creator = 'Chronos';
    3535    $this->License = 'GNU/GPL';
    36     $this->Homepage = 'http://svn.zdechov.net/svn/PHPlib/Common/';
     36    $this->Homepage = 'https://svn.zdechov.net/PHPlib/Common/';
    3737  }
    3838}
  • trunk/ReadMe.txt

    r836 r881  
    55
    66
    7 Source code repository: http://svn.zdechov.net/svn/wowpreklad
    8 Change history: http://svn.zdechov.net/trac/wowpreklad/log/
     7Source code repository: https://app.zdechov.net/wowpreklad
     8Change history: https://app.zdechov.net/wowpreklad/log/
    99License: GNU/GPLv3
    1010Authors: Chronos (robie@centrum.cz), Maron (maron2@centrum.cz)
     
    13132) Base configuration
    1414
    15 For initial web setup there is a necessary to copy config.sample.php file to 
    16 config.php inside directory includes and modify contained settings accrording 
     15For initial web setup there is a necessary to copy config.sample.php file to
     16config.php inside directory includes and modify contained settings accrording
    1717own needs.
    1818
    19193) Banners display
    2020
    21 In subdirectory "banners" is used file .htaccess for setting php script execution 
     21In subdirectory "banners" is used file .htaccess for setting php script execution
    2222for image generation and referred address recording.
    23 In apache server configuration in file httpd.conf is necessary to set for the 
     23In apache server configuration in file httpd.conf is necessary to set for the
    2424directory:
    2525
     
    33334) Write permissions
    3434
    35 Write permission for directory "tmp" needs to be set. In this directory 
     35Write permission for directory "tmp" needs to be set. In this directory
    3636temporary files like generated exports are stored.
    3737
     
    39395) Database initialization
    4040
    41 Create database in your MySQL server and set login data to file includes/config.php. 
     41Create database in your MySQL server and set login data to file includes/config.php.
    4242Continue with database installation on page "admin/install.php".
    4343
     
    45456) Text import
    4646
    47 Source files for import are located at directory "source". Here are then placed 
    48 subdirectories named by single individual game versions. In these subdirectories 
     47Source files for import are located at directory "source". Here are then placed
     48subdirectories named by single individual game versions. In these subdirectories
    4949are also subdirectories dbc, sql a lua from import is taken.
    5050
     
    52527) Background script for export
    5353
    54 At system start there is a need to start script Modules/Export/ProcessTask.php 
     54At system start there is a need to start script Modules/Export/ProcessTask.php
    5555for processing long lasting export tasks.
    56 Process have to be executed under same user as web server (apache), 
    57 because of correct permission setting during file creation in directory 
     56Process have to be executed under same user as web server (apache),
     57because of correct permission setting during file creation in directory
    5858tmp and because of security.
    5959
     
    61618) AoWoW download
    6262
    63 Download AoWoW from repository http://wowpreklad.zdechov.net/svn/wowpreklad/aowow 
    64 as subdirectory to directory of wowpreklad. Process according instructions in 
     63Download AoWoW from repository http://wowpreklad.zdechov.net/svn/wowpreklad/aowow
     64as subdirectory to directory of wowpreklad. Process according instructions in
    6565file ReadMe.txt at the same directory.
    6666
     
    68689) AoWoW background script
    6969
    70 Set periodic run of script for translation synchronization to AoWoW system. 
     70Set periodic run of script for translation synchronization to AoWoW system.
    7171Every night let run script Modules/Export/ProcessAoWoWExport.php.
    7272
Note: See TracChangeset for help on using the changeset viewer.