Changeset 525 for trunk/action.php
- Timestamp:
- Feb 20, 2013, 11:30:49 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/action.php
r522 r525 5 5 function Search() 6 6 { 7 global $System, $TranslationTree ;7 global $System, $TranslationTree, $Config; 8 8 9 9 if(array_key_exists('search', $_GET)) $Search = $_GET['search']; … … 40 40 $Output .= '<tr><td><a href="aowow/?search='.$Search.'">Vyhledávací databáze AoWoW</a></td></tr>'; 41 41 42 $DbResult = $System->Database->query('SELECT count(*) FROM `Dictionary` WHERE (`Text` LIKE "%'.$Search.'%" OR `Description` LIKE "%'.$Search.'%") AND `Language` = 0');42 $DbResult = $System->Database->query('SELECT count(*) FROM `Dictionary` WHERE (`Text` LIKE "%'.$Search.'%" OR `Description` LIKE "%'.$Search.'%") AND `Language` = '.$Config['OriginalLanguage']); 43 43 $Line = $DbResult->fetch_row(); 44 44 $Output .= '<tr><td><a href="dictionary.php?search='.$Search.'">Slovníček</a></td><td>'.$Line[0].'</td></tr>'; … … 50 50 function DatabaseKit() 51 51 { 52 global $System, $TranslationTree, $User ;52 global $System, $TranslationTree, $User, $Config; 53 53 54 54 if($User->Licence(LICENCE_ADMIN)) … … 86 86 $Output .= $Table.' '; 87 87 88 $sql = 'SELECT * FROM '.$Table.' WHERE (`Language` <> 0) AND (';88 $sql = 'SELECT * FROM '.$Table.' WHERE (`Language` <> '.$Config['OriginalLanguage'].') AND ('; 89 89 foreach($Group['Items'] as $Item) 90 90 { … … 128 128 $Output .= $Table.' '; 129 129 130 $sql = 'SELECT `ID`, `Entry` AS EntryTran, `Take`, 131 (SELECT `ID` FROM `'.$Table.'` WHERE `Language = 0 AND `Entry` = `EntryTran` LIMIT 1) AS `IDOrig` 132 FROM `'.$Table.'` AS `Tran` WHERE (`Language` <> 0) AND ((`Take` = 0) OR (`ID` = `Take`) OR NOT EXISTS(SELECT 1 FROM `'.$Table.'` WHERE `ID` = `Tran`.`Take`))'; 130 $sql = 'SELECT `ID`, `Entry` AS EntryTran, `Take`, '. 131 '(SELECT `ID` FROM `'.$Table.'` WHERE (`Language = '.$Config['OriginalLanguage'].') AND (`Entry` = `EntryTran`) LIMIT 1) AS `IDOrig` '. 132 'FROM `'.$Table.'` AS `Tran` WHERE (`Language` <> '.$Config['OriginalLanguage'].') AND ((`Take` IS NULL) OR '. 133 '(`ID` = `Take`) OR NOT EXISTS(SELECT 1 FROM `'.$Table.'` WHERE `ID` = `Tran`.`Take`))'; 133 134 134 135 $DbResult = $System->Database->query($sql); … … 158 159 { 159 160 $Output .= $Table.' '; 160 $sql = 'SELECT `gs_orig`.`ID`, `gs_tran`.`Entry`, `gs_tran`.`ShortCut` AS `ShortCut_tran`, `gs_orig`.`ShortCut` AS `ShortCut_orig` FROM `'.$Table.'` AS `gs_tran` JOIN `'.$Table.'` AS `gs_orig` ON `gs_orig`.`Entry` = `gs_tran`.`Entry` WHERE `gs_tran`.`Language` <> 0 AND `gs_tran`.`ShortCut` <> `gs_orig`.`ShortCut`'; 161 $sql = 'SELECT `gs_orig`.`ID`, `gs_tran`.`Entry`, `gs_tran`.`ShortCut` AS `ShortCut_tran`, '. 162 '`gs_orig`.`ShortCut` AS `ShortCut_orig` FROM `'.$Table.'` AS `gs_tran` '. 163 'JOIN `'.$Table.'` AS `gs_orig` ON `gs_orig`.`Entry` = `gs_tran`.`Entry` WHERE '. 164 '`gs_tran`.`Language` <> '.$Config['OriginalLanguage'].' AND `gs_tran`.`ShortCut` <> `gs_orig`.`ShortCut`'; 161 165 $DbResult = $System->Database->query($sql); 162 166 while ($Line = $DbResult->fetch_assoc()) … … 181 185 function Delete() 182 186 { 183 global $System, $User ;187 global $System, $User, $Config; 184 188 185 189 if($User->Licence(LICENCE_MODERATOR)) 186 190 { 187 191 $TextID = $_GET['ID']; 188 $System->Database->query('DELETE FROM `'.$Table.'` WHERE `ID` = '.$TextID.' AND `Language` <> 0');192 $System->Database->query('DELETE FROM `'.$Table.'` WHERE `ID` = '.$TextID.' AND `Language` <> '.$Config['OriginalLanguage']); 189 193 $Output = ShowMessage('Překlad byl smazán.'); 190 194 WriteLog('Překlad byl smazán! <a href="form.php?group='.$GroupID.'&ID='.$TextID.'">'.$TextID.'</a>', LOG_TYPE_MODERATOR);
Note:
See TracChangeset
for help on using the changeset viewer.