Changeset 525 for trunk/dictionary.php
- Timestamp:
- Feb 20, 2013, 11:30:49 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dictionary.php
r524 r525 58 58 } 59 59 } 60 if(array_key_exists('language', $_GET)) $_SESSION['language'] = LoadLanguageIdParameter(); 60 61 if(array_key_exists('language', $_GET) or ($_SESSION['language'] == 'all')) 62 $_SESSION['language'] = LoadLanguageIdParameter(); 61 63 62 64 $Output = '<h3>Slovníček</h3>'; … … 180 182 //<div style="overflow: auto; width: 100%; height: 100%;">'); 181 183 184 if($_SESSION['language'] == 'all') $LanguageFilter = ''; 185 else $LanguageFilter = ' AND (`T2`.`Language` = '.$_SESSION['language'].')'; 182 186 if($Search <> '') 183 187 { 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']; 186 204 187 205 $DbResult = $System->Database->query('SELECT COUNT(*) FROM ('.$sql.') AS `T1`');
Note:
See TracChangeset
for help on using the changeset viewer.