Changeset 498 for trunk


Ignore:
Timestamp:
Jan 30, 2013, 10:33:07 PM (12 years ago)
Author:
chronos
Message:
  • Upraveno: Optimalizace výpisu překladových položek v seznamu.
  • Přidáno: Nastavení časové zóny z PHP.
  • Upraveno: Tabulky převedeny z myisam na innodb. Doplněny indexy a cizí klíče. Provedeny některé optimalizace načítání.
Location:
trunk
Files:
1 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/TranslationList.php

    r466 r498  
    191191  $Table = $TranslationTree[$Filter['Group']]['TablePrefix'];
    192192 
    193   $Query = 'SELECT `T`.*, (SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `T`.`User`) AS `UserName` FROM `'.$Table.'` AS `T` WHERE 1 '.$Filter['SQL'];
     193  $Query = 'SELECT `T`.`ID`, `T`.`Entry`, `T`.`VersionStart`, `T`.`VersionEnd`, '.
     194    '`T`.`Name`, (SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `T`.`User`)'.
     195    'AS `UserName` FROM `'.$Table.'` AS `T` WHERE 1 '.$Filter['SQL'];
    194196  //echo($Query);
    195197 
  • trunk/export/create_addon.php

    r455 r498  
    6565  function ReplaceCzText($string)
    6666  {
    67     $string = mysql_escape_string($string);
     67    $string = $this->Database->real_escape_string($string);
    6868    $string = str_replace('$B', '\r\n', $string);
    6969    $string = str_replace('$b', '\r\n', $string);
  • trunk/includes/config.sample.php

    r497 r498  
    3131    'VisiblePagingItems' => 20,
    3232    'WebCounter' => '',
     33    'Timezone' => 'Europe/Prague',
    3334  ),
    3435  'ExportTaskProcessPeriod' => 10,
  • trunk/includes/global.php

    r497 r498  
    1717if(file_exists(dirname(__FILE__).'/config.php')) include_once(dirname(__FILE__).'/config.php');
    1818  else die('Nenalezen konfigurační soubor config.php ve složce includes. Vytvořte jej zkopírováním vzoru config.sample.php.');
     19date_default_timezone_set($Config['Web']['Timezone']);
    1920include_once(dirname(__FILE__).'/Database.php');
    2021include_once(dirname(__FILE__).'/rss.php');
     
    6263  if($User->Licence(LICENCE_USER))
    6364  {
    64     $DbResult = $System->Database->query('SELECT `Id`, `Name` FROM `Team` WHERE `Id`='.$User->Team);
    65     $Team = $DbResult->fetch_assoc();
    66 
     65    //$DbResult = $System->Database->query('SELECT `Id`, `Name` FROM `Team` WHERE `Id`='.$User->Team);
     66    //$Team = $DbResult->fetch_assoc();
    6767    //echo('<span class="MenuItem">Moje překlady: <a href="">Dokončené</a> <a href="">Rozpracované</a> <a href="">Exporty</a> Tým: <a href="">'.$Team['name'].'</a></span>');
    6868    echo('<span class="MenuItem2">'.$User->Name.' <a href="'.$System->Link('/?action=logout').'">Odhlášení</a> <a href="'.$System->Link('/Options.php').'">Nastavení</a>');
     
    250250      if($User->Role != LICENCE_ANONYMOUS)
    251251      {
     252        WriteLog('Odhlášení', LOG_TYPE_USER);
    252253        $User->Logout();
    253254        $Message = 'Byl jsi odhlášen.'; 
    254255        $MessageType = MESSAGE_INFORMATION;
    255         WriteLog('Odhlášení', LOG_TYPE_USER);
    256256      }
    257257    }
  • trunk/registrace.php

    r495 r498  
    1414    else $Email = '';
    1515  if(array_key_exists('Team', $_POST)) $Team = $_POST['Team'];
    16     else $Team = 0;
     16    else $Team = '';
    1717  if(array_key_exists('Language', $_POST)) $Language = $_POST['Language'];
    1818    else $Language = 1;
     
    5050    <tr>
    5151      <td>Patřím do týmu: </td>');
    52       if($Team == 0) $Selected = ' selected="selected"';
     52      if($Team == '') $Selected = ' selected="selected"';
    5353        else $Selected = '';
    5454      echo('<td><select name="Team"><option value="0"'.$Selected.'>Žádného</option>
  • trunk/statistic.php

    r463 r498  
    1919  {
    2020    $Query .= 'SELECT (SELECT COUNT(DISTINCT(`Entry`)) FROM ('.
    21     ' SELECT `T`.* FROM `'.$DbRow['TablePrefix'].'` AS `T`'.
     21    ' SELECT `T`.`Id`, `T`.`Entry` FROM `'.$DbRow['TablePrefix'].'` AS `T`'.
    2222    ' WHERE (`Complete` = 1) AND (`Language`='.$LanguageId.') AND (`VersionStart` <= '.$BuildNumber.') AND (`VersionEnd` >= '.$BuildNumber.')'.
    2323    ') AS `C1`) AS `Translated`, '.
    2424    '(SELECT COUNT(DISTINCT(`Entry`)) FROM ('.
    25     ' SELECT `T`.* FROM `'.$DbRow['TablePrefix'].'` AS `T`'.
     25    ' SELECT `T`.`Id`, `T`.`Entry` FROM `'.$DbRow['TablePrefix'].'` AS `T`'.
    2626    ' WHERE (`Language` = 0) AND (`VersionStart` <= '.$BuildNumber.') AND (`VersionEnd` >= '.$BuildNumber.')'.
    2727    ') AS `C2`) AS `Total`, "'.$DbRow['Name'].'" AS `Name` UNION ';
  • trunk/team.php

    r466 r498  
    263263  if($User->Licence(LICENCE_USER))
    264264  {   
    265     $System->Database->query('UPDATE `User` SET `Team` = 0 WHERE `ID` = '.$User->Id);
     265    $System->Database->query('UPDATE `User` SET `Team` = NULL WHERE `ID` = '.$User->Id);
    266266    ShowMessage('Nyní nejste členem žádného týmu.');   
    267267    WriteLog('Uživatel vystoupil z týmu', LOG_TYPE_USER);
Note: See TracChangeset for help on using the changeset viewer.