Changeset 830 for trunk/Modules/Translation
- Timestamp:
- Aug 24, 2015, 6:55:04 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Translation/UserLevel.php
r827 r830 21 21 function GetXPFromTranslation($UserId) 22 22 { 23 global $System, $TranslationTree, $xp_from_word, $from_diakrit ;23 global $System, $TranslationTree, $xp_from_word, $from_diakrit, $Config; 24 24 25 25 $xp = 0; … … 29 29 { 30 30 $GroupBy = 'GROUP BY '; 31 $TakeColumns = ''; 31 32 foreach($TranslationTree[$Group['Id']]['Items'] as $Index => $TextItem) 32 33 { 33 $GroupBy .= '`'.$TextItem['Column'].'`, '; 34 $GroupBy .= '`T`.`'.$TextItem['Column'].'`, '; 35 $TakeColumns .= ', `T2`.`'.$TextItem['Column'].'` AS `'.$TextItem['Column'].'_Take`'; 34 36 } 35 37 $GroupBy = substr($GroupBy, 0, -2); 36 38 37 $IDtran = $System->Database->query('SELECT * FROM `'.$Group['TablePrefix'].'` WHERE '. 38 '(`User` = '.$UserId.') AND (`Complete` = 1) AND (`Take` IS NOT NULL) '.$GroupBy); 39 $IDtran = $System->Database->query('SELECT *, `T2`.`Language` AS `Language_Take`'.$TakeColumns.' FROM `'.$Group['TablePrefix'].'` AS `T` '. 40 'LEFT JOIN `'.$Group['TablePrefix'].'` AS `T2` ON `T2`.`ID` = `T`.`Take` '. 41 'WHERE (`T`.`User` = '.$UserId.') AND (`T`.`Complete` = 1) AND (`T`.`Take` IS NOT NULL) '.$GroupBy); 39 42 while($Line = $IDtran->fetch_array()) 40 43 { 41 $DbResult = $System->Database->query('SELECT * FROM `'.$Group['TablePrefix'].'` WHERE `ID` = '.$Line['Take']);42 $LineComparison = $DbResult->fetch_assoc();43 44 $xp_translation = 0; 44 45 $translated = true; 45 46 foreach($TranslationTree[$Group['Id']]['Items'] as $Index => $TextItem) 46 47 { 47 if(($Line[$TextItem['Column']] <> $Line Comparison[$TextItem['Column']]) and48 (strlen($Line[$TextItem['Column']]) > (strlen($Line Comparison[$TextItem['Column']]) * 0.5)))48 if(($Line[$TextItem['Column']] <> $Line[$TextItem['Column'].'_Take']) and 49 (strlen($Line[$TextItem['Column']]) > (strlen($Line[$TextItem['Column'].'_Take']) * 0.5))) 49 50 { 50 51 $TextArr = explode(' ', $Line[$TextItem['Column']]); … … 57 58 } else 58 59 { 59 if (($Line[$TextItem['Column']] == $Line Comparison[$TextItem['Column']]) and60 ( '0' == $LineComparison['Language']) and ($LineComparison[$TextItem['Column']] <> '') and60 if (($Line[$TextItem['Column']] == $Line[$TextItem['Column'].'_Take']) and 61 ($Config['OriginalLanguage'] == $Line['Language_Take']) and ($Line[$TextItem['Column'].'_Take'] <> '') and 61 62 ($TextItem['Column'] <> 'ShortCut')) $translated = false; 62 63 }
Note:
See TracChangeset
for help on using the changeset viewer.