Changeset 525 for trunk/includes/global.php
- Timestamp:
- Feb 20, 2013, 11:30:49 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/global.php
r524 r525 328 328 } 329 329 330 function WriteLanguagesWithoutSel($Selected)331 {332 global $LanguageList;333 334 $Output = '';335 foreach($LanguageList as $Language)336 {337 if($Selected == $Language['Id']) $Output .= $Language['Name'];338 }339 return($Output);340 }341 342 330 function GetLanguageList() 343 331 { … … 398 386 function FollowingTran($TextID, $Table, $GroupId, $Prev = false) 399 387 { 400 global $System ;388 global $System, $Config; 401 389 402 390 if($Prev) 403 { 404 $sql = 'SELECT ID FROM '.$Table.' as item WHERE Language = 0 AND NOT EXISTS(SELECT entry FROM '.$Table.' AS sub WHERE sub.Language <> 0 AND sub.entry = item.entry) AND ID < '.$TextID.' ORDER BY ID DESC LIMIT 1'; 405 } else 406 { 407 $sql = 'SELECT ID FROM '.$Table.' as item WHERE Language = 0 AND NOT EXISTS(SELECT entry FROM '.$Table.' AS sub WHERE sub.Language <> 0 AND sub.entry = item.entry) AND ID > '.$TextID.' ORDER BY ID LIMIT 1'; 408 } 391 $sql = 'SELECT `ID` FROM `'.$Table.'` AS `item` WHERE '. 392 '(`Language` = '.$Config['OriginalLanguage'].') AND NOT EXISTS(SELECT `entry` '. 393 'FROM `'.$Table.'` AS `sub` WHERE (`sub`.`Language` <> '.$Config['OriginalLanguage'].') '. 394 'AND (`sub`.`entry` = `item`.`entry`)) AND (`ID` < '.$TextID.') ORDER BY `ID` DESC LIMIT 1'; 395 else $sql = 'SELECT `ID` FROM `'.$Table.'` AS `item` WHERE '. 396 '(`Language` = '.$Config['OriginalLanguage'].') AND NOT EXISTS(SELECT `entry` '. 397 'FROM `'.$Table.'` AS `sub` WHERE (`sub`.`Language` <> '.$Config['OriginalLanguage'].') '. 398 'AND (`sub`.`entry` = `item`.`entry`)) AND `ID` > '.$TextID.' ORDER BY `ID` LIMIT 1'; 409 399 410 400 $DbResult = $System->Database->query($sql); … … 570 560 function GetTranslatNames($Text,$mode,$TablesColumn) 571 561 { 572 global $System ;562 global $System, $Config; 573 563 574 564 /* $TablesID = array('gameobject' => 5, … … 582 572 foreach($TablesColumn as $Table => $Column) 583 573 { 584 $sql = 'SELECT `ID`,`'.$Column.'`, (SELECT `'.$Column.'` FROM `'.$Table.'` AS `T` WHERE `O`.`Entry` = `T`.`Entry` AND `Language` <> 0 LIMIT 1) AS `Tran` FROM `'.$Table.'` AS `O` WHERE '; 574 $sql = 'SELECT `ID`,`'.$Column.'`, (SELECT `'.$Column.'` FROM `'.$Table.'` AS `T` WHERE '. 575 '(`O`.`Entry` = `T`.`Entry`) AND (`Language` <> '.$Config['OriginalLanguage'].') LIMIT 1) AS `Tran` FROM `'.$Table.'` AS `O` WHERE '; 585 576 $groupby = ' GROUP BY `'.$Column.'`'; 586 577 587 578 $ArrStr = explode(' ', $Text); 588 $where = ' `Language` = 0';589 if ($mode == 1) $where .= ' AND EXISTS(SELECT 1 FROM `'.$Table.'` AS `Sub` WHERE (`Sub`.`Language` <> 0) AND (`Sub`.`Entry` = `O`.`Entry`))';590 if ($mode == 2) $where .= ' AND NOT EXISTS(SELECT 1 FROM `'.$Table.'` AS `Sub` WHERE (`Sub`.`Language` <> 0) AND (`Sub`.`Entry` = `O`.`Entry`))';579 $where = '(`Language` = '.$Config['OriginalLanguage'].') '; 580 if ($mode == 1) $where .= ' AND EXISTS(SELECT 1 FROM `'.$Table.'` AS `Sub` WHERE (`Sub`.`Language` <> '.$Config['OriginalLanguage'].') AND (`Sub`.`Entry` = `O`.`Entry`))'; 581 if ($mode == 2) $where .= ' AND NOT EXISTS(SELECT 1 FROM `'.$Table.'` AS `Sub` WHERE (`Sub`.`Language` <> '.$Config['OriginalLanguage'].') AND (`Sub`.`Entry` = `O`.`Entry`))'; 591 582 $where .= ' AND ('; 592 583
Note:
See TracChangeset
for help on using the changeset viewer.