Changeset 525 for trunk/dictionary.php


Ignore:
Timestamp:
Feb 20, 2013, 11:30:49 PM (12 years ago)
Author:
chronos
Message:
  • Opraveno: Zobrazení porovnání překladů.
  • Opraveno: Zobrazení stavu dokončení pro všechny překlady.
  • Přidáno: V seznamu překladů přidán sloupec Jazyk.
  • Opraveno: Místa, kde s pevným indexem anglického originálu upravena na nastavitelný.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dictionary.php

    r524 r525  
    5858  }     
    5959}
    60 if(array_key_exists('language', $_GET)) $_SESSION['language'] = LoadLanguageIdParameter();
     60
     61if(array_key_exists('language', $_GET) or ($_SESSION['language'] == 'all'))
     62         $_SESSION['language'] = LoadLanguageIdParameter();
    6163
    6264$Output = '<h3>Slovníček</h3>';
     
    180182  //<div style="overflow: auto; width: 100%; height: 100%;">');
    181183
     184  if($_SESSION['language'] == 'all') $LanguageFilter = '';
     185    else $LanguageFilter = ' AND (`T2`.`Language` = '.$_SESSION['language'].')';
    182186  if($Search <> '')
    183187  {
    184     $sql = 'SELECT `User`.`Name` AS `UserName`, `User`. `ID` AS `UserID`, `T3`.`Entry`, `T3`.`Original`, `T3`.`Translated`, `T3`.`Description` FROM (SELECT `T2`.`User`, `T1`.`Language`, `T1`.`Text` AS `Original`, `T2`.`Text` AS `Translated`, `T2`.`Description`, `T1`.`Entry` AS `Entry` FROM `Dictionary` AS `T1` JOIN `Dictionary` AS `T2` ON `T2`.`Entry` = `T1`.`Entry` AND `T2`.`Language` = '.$_SESSION['language'].' WHERE LOWER(`T1`.`Text`) LIKE LOWER("%'.$Search.'%") OR LOWER(`T1`.`Description`) LIKE LOWER("%'.$Search.'%") ) AS `T3` JOIN `User` ON `User`.`ID` = `T3`.`User` WHERE `T3`.`Language` = '.$Config['OriginalLanguage'];
    185   } else $sql = 'SELECT `User`.`Name` AS `UserName`, `ID` AS `UserID`, `T3`.`Entry`, `T3`.`Original`, `T3`.`Translated`, `T3`.`Description` FROM (SELECT `T2`.`User`, `T1`.Language, `T1`.`Text` AS `Original`, `T2`.`Text` AS `Translated`, `T2`.`Description`, `T1`.`Entry` AS `Entry` FROM `Dictionary` AS `T1` JOIN `Dictionary` AS `T2` ON `T2`.`Entry` = `T1`.`Entry` AND `T2`.`Language` = '.$_SESSION['language'].') AS `T3` JOIN `User` ON `User`.`ID` = `T3`.`User` WHERE `T3`.`Language` = '.$Config['OriginalLanguage'];
     188    $sql = 'SELECT `User`.`Name` AS `UserName`, `User`. `ID` AS `UserID`, '.
     189      '`T3`.`Entry`, `T3`.`Original`, `T3`.`Translated`, `T3`.`Description` '.
     190      'FROM (SELECT `T2`.`User`, `T1`.`Language`, `T1`.`Text` AS `Original`, '.
     191      '`T2`.`Text` AS `Translated`, `T2`.`Description`, `T1`.`Entry` AS `Entry` '.
     192      'FROM `Dictionary` AS `T1` JOIN `Dictionary` AS `T2` '.
     193      'ON (`T2`.`Entry` = `T1`.`Entry`) '.$LanguageFilter.
     194      ' WHERE LOWER(`T1`.`Text`) LIKE LOWER("%'.$Search.'%") OR '.
     195      'LOWER(`T1`.`Description`) LIKE LOWER("%'.$Search.'%") ) AS `T3` '.
     196      'JOIN `User` ON `User`.`ID` = `T3`.`User` WHERE `T3`.`Language` = '.$Config['OriginalLanguage'];
     197  } else $sql = 'SELECT `User`.`Name` AS `UserName`, `ID` AS `UserID`, '.
     198    '`T3`.`Entry`, `T3`.`Original`, `T3`.`Translated`, `T3`.`Description` FROM '.
     199    '(SELECT `T2`.`User`, `T1`.Language, `T1`.`Text` AS `Original`, '.
     200    '`T2`.`Text` AS `Translated`, `T2`.`Description`, `T1`.`Entry` AS `Entry` '.
     201    'FROM `Dictionary` AS `T1` JOIN `Dictionary` AS `T2` ON '.
     202    '(`T2`.`Entry` = `T1`.`Entry`) '.$LanguageFilter.') AS `T3` '.
     203    'JOIN `User` ON `User`.`ID` = `T3`.`User` WHERE `T3`.`Language` = '.$Config['OriginalLanguage'];
    186204
    187205  $DbResult = $System->Database->query('SELECT COUNT(*) FROM ('.$sql.') AS `T1`');
Note: See TracChangeset for help on using the changeset viewer.