Changeset 525
- Timestamp:
- Feb 20, 2013, 11:30:49 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Options.php
r524 r525 71 71 if($PreferredVersion == '') $PreferredVersion = null; 72 72 $Info = $_POST['info']; 73 print_r($_POST);74 73 75 74 // Do user want to change password? -
trunk/TranslationList.php
r524 r525 5 5 function ShowFilter($GroupId = 0) 6 6 { 7 global $System, $TranslationTree ;7 global $System, $TranslationTree, $Config; 8 8 9 9 $Filter = array('SQL' => ''); … … 153 153 { 154 154 if($Filter['State'] == 0) $Filter['SQL'] .= $UserFilter.$VersionFilter.''; 155 else if($Filter['State'] == 1) $Filter['SQL'] .= $VersionFilter.' AND (`Language` = 0) AND NOT EXISTS(SELECT 1 FROM `'.$Table.'` AS `Sub` WHERE (`Sub`.`Language` <> 0)'.$LanguageFilter.$UserFilter.' AND (`Sub`.`Entry` = `T`.`Entry`) AND (`Sub`.`Complete` = 1) AND (`Sub`.`VersionStart` = `T`.`VersionStart`) AND (`Sub`.`VersionEnd` = `T`.`VersionEnd`))'; 155 else if($Filter['State'] == 1) $Filter['SQL'] .= $VersionFilter.' AND (`Language` = '.$Config['OriginalLanguage'].') '. 156 'AND NOT EXISTS(SELECT 1 FROM `'.$Table.'` AS `Sub` WHERE '. 157 '(`Sub`.`Language` <> '.$Config['OriginalLanguage'].')'.$LanguageFilter.$UserFilter. 158 ' AND (`Sub`.`Entry` = `T`.`Entry`) AND (`Sub`.`Complete` = 1) AND '. 159 '(`Sub`.`VersionStart` = `T`.`VersionStart`) AND (`Sub`.`VersionEnd` = `T`.`VersionEnd`))'; 156 160 else if($Filter['State'] == 2) $Filter['SQL'] .= $UserFilter.$LanguageFilter.$VersionFilter.' AND (`Complete` = 1)'; 157 else if($Filter['State'] == 3) $Filter['SQL'] .= $UserFilter.$LanguageFilter.$VersionFilter.' AND (`Language` != 0) AND (`Complete` = 0)';158 else if($Filter['State'] == 4) $Filter['SQL'] .= $VersionFilter.' AND (`Language` = 0)';161 else if($Filter['State'] == 3) $Filter['SQL'] .= $UserFilter.$LanguageFilter.$VersionFilter.' AND (`Language` != '.$Config['OriginalLanguage'].') AND (`Complete` = 0)'; 162 else if($Filter['State'] == 4) $Filter['SQL'] .= $VersionFilter.' AND (`Language` = '.$Config['OriginalLanguage'].')'; 159 163 } 160 164 … … 193 197 $Query = 'SELECT `T`.`ID`, `T`.`Entry`, `T`.`VersionStart`, `T`.`VersionEnd`, '. 194 198 '`T`.`'.$TranslationTree[$Filter['Group']]['Items'][0]['Column'].'`, '. 195 '(SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `T`.`User`) '. 196 'AS `UserName` FROM `'.$Table.'` AS `T` WHERE 1 '.$Filter['SQL']; 199 '(SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `T`.`User`) AS `UserName`, '. 200 '(SELECT `Language`.`Name` FROM `Language` WHERE `Language`.`ID` = `T`.`Language`) AS `LanguageName` '. 201 'FROM `'.$Table.'` AS `T` WHERE 1 '.$Filter['SQL']; 197 202 198 203 // Get total item count … … 207 212 array('Name' => $TranslationTree[$Filter['Group']]['Items'][0]['Column'], 'Title' => 'Název'), 208 213 array('Name' => 'VersionStart', 'Title' => 'Verze'), 209 array('Name' => 'UserName', 'Title' => 'Překladatel'), 214 array('Name' => 'LanguageName', 'Title' => 'Jazyk'), 215 array('Name' => 'UserName', 'Title' => 'Překladatel'), 210 216 ); 211 217 … … 220 226 '<td>'.htmlspecialchars($Line[$TranslationTree[$Filter['Group']]['Items'][0]['Column']]).'</td>'. 221 227 '<td>'.GetVersionWOW($Line['VersionStart']).'-'.GetVersionWOW($Line['VersionEnd']).'</td>'. 228 '<td>'.$Line['LanguageName'].'</td>'. 222 229 '<td>'.$Line['UserName'].'</td>'; 223 230 '</tr>'; -
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); -
trunk/admin/UpdateTrace.php
r524 r525 2466 2466 (103, '5.1.0', 16309, '2012-11-27', 'Landfall', 0), 2467 2467 (104, '5.1.0a', 16357, '2012-12-10', '', 0);"); 2468 $Manager->Execute("INSERT INTO `ExportOutputType` (`Id`, `Name`) VALUES 2469 (1, 'MaNGOS SQL - přímo zobrazit'), 2470 (2, 'MaNGOS SQL - komprimovaný soubor'), 2471 (3, 'AoWoW SQL - přímo zobrazit'), 2472 (4, 'AoWoW SQL - komprimovaný soubor'), 2473 (5, 'XML - přímo zobrazit'), 2474 (6, 'XML - komprimovaný soubor'), 2475 (7, 'Addon - komprimovaný soubor'), 2476 (8, 'Lua skripty - komprimovaný soubor'), 2477 (9, 'DBC soubory');"); 2468 2478 } 2469 2479 -
trunk/comparison.php
r504 r525 37 37 } else $Result .= '<span class="edit">'.$ArrStr1[$i].' </span>'; 38 38 } 39 // echo $ArrStr1[0];40 39 return($Result); 41 40 } … … 51 50 $TextID1 = $_GET['ID1']; 52 51 $TextID2 = $_GET['ID2']; 53 $WhereID = ' AND ( ID = '.$TextID1.' OR ID = '.$TextID2.' OR Language = 0)';52 $WhereID = ' AND ((`ID` = '.$TextID1.') OR (`ID` = '.$TextID2.') OR (`Language` = '.$Config['OriginalLanguage'].'))'; 54 53 } else $WhereID = ''; 55 54 56 $DataID = $System->Database->query('SELECT * FROM '.$Table.' Where entry = '.$Textentry.' '.$WhereID.' ORDER BY Language'); 57 $i = 0; 58 while($Line = $DataID->fetch_assoc()) 59 { 60 $BuffLine[$i] = $Line; 61 $i = $i + 1; 62 } 63 // if(!$Line) die('Překlad nenalezen.'); 64 $Line = $BuffLine; 65 $i = $i - 1; 66 $Output .= 'Počet porovnávaných textů: <strong>'.$i.'</strong><br /> '; 55 $DataID = $System->Database->query('SELECT `'.$Table.'`.*, `User`.`Name` AS `UserName`, '. 56 '`Language`.`Name` AS `LanguageName` '. 57 'FROM '.$Table.' LEFT JOIN `User` ON `User`.`Id` = `'.$Table.'`.`User` '. 58 ' LEFT JOIN `Language` ON `Language`.`Id` = `'.$Table.'`.`Language` '. 59 'WHERE `Entry` = '.$Textentry.' '.$WhereID.' ORDER BY `Language`'); 60 while($Line[] = $DataID->fetch_assoc()); 61 array_pop($Line); 62 63 $Output .= 'Počet porovnávaných textů: <strong>'.count($Line).'</strong><br /> '; 67 64 68 65 $Output .= '<strong>Číslo textu: <a href="http://www.wowhead.com/?quest='.$Textentry.'">'.$Textentry.'</a></strong>'. … … 70 67 '<tr><th>Přeložil</th>'; 71 68 foreach($Line as $Index => $LineItem) 72 { 73 $DbResult = $System->Database->query('SELECT * FROM `User` WHERE `ID` = '.$LineItem['User']); 74 $LineUser = $DbResult->fetch_array(); 75 $Output .= '<th>'.$LineUser['Name'].'</th>'; 76 } 69 $Output .= '<th>'.$LineItem['UserName'].'</th>'; 77 70 $Output .= '</tr>'. 78 71 '<tr>'. 79 72 '<th>ID textu</th>'; 80 73 foreach($Line as $Index => $LineItem) 81 {82 74 $Output .= '<td><a href="form.php?group='.$GroupId.'&ID='.$LineItem['ID'].'">'.$LineItem['ID'].'</a></td>'; 83 }84 75 $Output .= '</tr>'. 85 76 '<tr><th>Převzato</th>'; 86 77 foreach($Line as $Index => $LineItem) 87 {88 78 $Output .= '<td><a href="form.php?group='.$GroupId.'&ID='.$LineItem['Take'].'">'.$LineItem['Take'].'</a></td>'; 89 }90 79 $Output .= '</tr>'. 91 80 '<tr><th>Jazyk</th>'; 92 81 foreach($Line as $Index => $LineItem) 93 { 94 $Output .= '<td>'. 95 WriteLanguagesWithoutSel($LineItem['Language']). 96 '</td>'; 97 } 82 $Output .= '<td>'.$LineItem['LanguageName'].'</td>'; 98 83 $Output .= '</tr>'. 99 84 '<tr><th>Verze</th>'; 100 85 foreach($Line as $Index => $LineItem) 101 { 102 $Output .= '<td>'; 103 $Output .= GetVersionWOW($LineItem['VersionStart']).' - '.GetVersionWOW($LineItem['VersionEnd']); 104 $Output .= '</td>'; 105 } 86 $Output .= '<td>'.GetVersionWOW($LineItem['VersionStart']).' - '.GetVersionWOW($LineItem['VersionEnd']).'</td>'; 106 87 $Output .= '</tr>'; 107 88 foreach($TranslationTree[$GroupId]['Items'] as $Index => $TextItem) -
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`'); -
trunk/export/export.php
r506 r525 63 63 // Expand query for loading english texts 64 64 $Query = 'SELECT `T4`.*, '.$OriginalColumns.' FROM ('.$Query.') AS `T4` '. 65 ' LEFT JOIN `'.$Group['TablePrefix'].'` AS `T3` ON (`T3`.`Entry` = `T4`.`Entry`) AND (`T3`.`Language` = 0) AND (`T3`.`VersionStart` = `T4`.`VersionStart`) AND (`T3`.`VersionEnd` = `T4`.`VersionEnd`)'; 65 ' LEFT JOIN `'.$Group['TablePrefix'].'` AS `T3` ON (`T3`.`Entry` = `T4`.`Entry`) '. 66 'AND (`T3`.`Language` = '.$Config['OriginalLanguage'].') AND '. 67 '(`T3`.`VersionStart` = `T4`.`VersionStart`) AND (`T3`.`VersionEnd` = `T4`.`VersionEnd`)'; 66 68 67 69 return($Query); -
trunk/export/index.php
r504 r525 505 505 $Export = $DbResult->fetch_assoc(); 506 506 507 if($Export['OutputType'] == '') $Output .= ShowMessage('Nevybrán typ exportu', MESSAGE_CRITICAL); 508 else { 507 509 $Query = 'SELECT `ClientVersion`.* FROM `ExportVersion` LEFT JOIN `ClientVersion` ON `ClientVersion`.`Id`=`ExportVersion`.`ClientVersion` WHERE `ExportType`='.$Export['OutputType']; 508 510 … … 544 546 '</form>'. 545 547 $PageList['Output']; 548 } 546 549 return($Output); 547 550 } … … 551 554 global $System; 552 555 556 $Output = ''; 553 557 $DbResult = $System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 554 558 $Export = $DbResult->fetch_assoc(); 555 $DbResult = $System->Database->query('SELECT * FROM `ExportOutputType` WHERE `Id`='.$Export['OutputType']); 559 if($Export['OutputType'] == '') $Output .= ShowMessage('Nevybrán typ exportu', MESSAGE_CRITICAL); 560 else { 561 $DbResult = $System->Database->query('SELECT * FROM `ExportOutputType` WHERE `Id`='.$Export['OutputType']); 556 562 if($DbResult->num_rows > 0) 557 563 { … … 563 569 } else $Output = ShowMessage('Nebyla vybrána požadovaná verze klienta.', MESSAGE_CRITICAL); 564 570 } else $Output = ShowMessage('Nebyl vybrán formát výstupu.', MESSAGE_CRITICAL); 571 } 565 572 return($Output); 566 573 } … … 568 575 function ExportViewStat() 569 576 { 570 global $System ;577 global $System, $Config; 571 578 572 579 $Export = new Export($System); 573 580 $Export->Id = $_GET['ExportId']; 574 581 $Export->Init(); 575 $Export->LoadFilters(); 582 if($Export->ClientVersion == '') $Output = ShowMessage('Nebyla vybrána verze klienta', MESSAGE_CRITICAL); 583 else { 584 $Export->LoadFilters(); 576 585 577 586 if($Export->ClientVersion['BuildNumber'] == '') $Output = ShowMessage('Nebyla vybrána verze klienta', MESSAGE_CRITICAL); 578 {587 else { 579 588 $GroupListQuery = 'SELECT `Group`.* FROM `Group` '. 580 589 ' JOIN `ExportGroup` ON (`ExportGroup`.`Export`='.$Export->Id.') AND (`ExportGroup`.`Group`=`Group`.`Id`)'; … … 592 601 '(SELECT COUNT(DISTINCT(`Entry`)) FROM ('. 593 602 ' SELECT `T`.* FROM `'.$DbRow['TablePrefix'].'` AS `T`'. 594 ' WHERE (`Language` = 0) AND (`VersionStart` <= '.$Export->ClientVersion['BuildNumber'].') AND (`VersionEnd` >= '.$Export->ClientVersion['BuildNumber'].')'.603 ' WHERE (`Language` = '.$Config['OriginalLanguage'].') AND (`VersionStart` <= '.$Export->ClientVersion['BuildNumber'].') AND (`VersionEnd` >= '.$Export->ClientVersion['BuildNumber'].')'. 595 604 ') AS `C2`) AS `Total`, "'.$DbRow['Name'].'" AS `Name`'; 596 605 } … … 631 640 $Output .= '<tr><td><strong>Celkem</strong></td><td><strong>'.$Translated.'</strong></td><td><strong>'.$Total.'</strong></td><td><strong>'.ProgressBar(150, round($Percent, 2)).'</strong></td></tr>'; 632 641 $Output .= '</table>'; 642 } 633 643 } 634 644 return($Output); -
trunk/form.php
r517 r525 37 37 { 38 38 39 $DbResult = $System->Database->query('SELECT * FROM `'.$Table.'` WHERE (`Language` = 0) AND (`Entry` = '.$Line['Entry'].') AND (`VersionEnd` = '.$Line['VersionEnd'].') LIMIT 1');39 $DbResult = $System->Database->query('SELECT * FROM `'.$Table.'` WHERE (`Language` = '.$Config['OriginalLanguage'].') AND (`Entry` = '.$Line['Entry'].') AND (`VersionEnd` = '.$Line['VersionEnd'].') LIMIT 1'); 40 40 $LineAJ = $DbResult->fetch_assoc(); 41 41 if(!$LineAJ) … … 81 81 '<br />'; 82 82 83 $DbResult = $System->Database->query('SELECT COUNT(*) FROM `'.$Table.'` WHERE (`Entry` = '.$Line['Entry'].') AND (`Language` <> 0) AND (`Complete` = 1)');83 $DbResult = $System->Database->query('SELECT COUNT(*) FROM `'.$Table.'` WHERE (`Entry` = '.$Line['Entry'].') AND (`Language` <> '.$Config['OriginalLanguage'].') AND (`Complete` = 1)'); 84 84 $Version = $DbResult->fetch_row(); 85 85 $Version = $Version[0]; -
trunk/img_level.php
r523 r525 103 103 function ImgLevelUpdate() 104 104 { 105 global $System, $TranslationTree ;105 global $System, $TranslationTree, $Config; 106 106 107 107 // Hlavní kod pro uživatele … … 116 116 if($Group['TablePrefix'] != '') 117 117 { 118 $Count = '(SELECT COUNT(*) FROM `'.$Group['TablePrefix'].'` WHERE (`Complete` = 1) AND (`Language` <> 0) AND (`User`='.$LineUser['ID'].'))';118 $Count = '(SELECT COUNT(*) FROM `'.$Group['TablePrefix'].'` WHERE (`Complete` = 1) AND (`Language` <> '.$Config['OriginalLanguage'].') AND (`User`='.$LineUser['ID'].'))'; 119 119 $TranslatedCount .= 'COALESCE('.$Count.', 0) + '; 120 120 } -
trunk/img_statistic.php
r455 r525 24 24 if($BuildNumber_max == '') $BuildNumber_max = 0; // Empty result, no items in this group 25 25 26 $where = '(`VersionEnd` = '.$BuildNumber_max.') AND (`Language` <> 0) AND (`Complete` = 1) '.$team.$language;26 $where = '(`VersionEnd` = '.$BuildNumber_max.') AND (`Language` <> '.$Config['OriginalLanguage'].') AND (`Complete` = 1) '.$team.$language; 27 27 $DbResult = $System->Database->query('SELECT COUNT(DISTINCT(`Entry`)) FROM `'.$Group['TablePrefix'].'` WHERE '.$where); 28 28 $ID = $DbResult->fetch_row(); 29 29 $NumberTranslate = $ID[0]; 30 30 31 $DbResult = $System->Database->query('SELECT COUNT(DISTINCT(`Entry`)) FROM `'.$Group['TablePrefix'].'` WHERE (`VersionEnd` = '.$BuildNumber_max.') AND (`Language` = 0)');31 $DbResult = $System->Database->query('SELECT COUNT(DISTINCT(`Entry`)) FROM `'.$Group['TablePrefix'].'` WHERE (`VersionEnd` = '.$BuildNumber_max.') AND (`Language` = '.$Config['OriginalLanguage'].')'); 32 32 $ID = $DbResult->fetch_row(); 33 33 $NumberAJ = $ID[0]; -
trunk/includes/Database.php
r507 r525 66 66 $this->Error = $this->Error[2]; 67 67 if(($this->Error != '') and ($this->ShowSQLError == true)) 68 { 68 69 echo('<div><strong>SQL Error: </strong>'.$this->Error.'<br />'.$Query.'</div>'); 70 echo(debug_backtrace()); 71 } 69 72 } 70 73 $this->insert_id = $this->PDO->lastInsertId(); -
trunk/includes/Page.php
r524 r525 195 195 $Output .= ShowSearchBox(); 196 196 $Output .= '</td><td id="border-left"></td><td class="content">'; 197 if(isset($Message)) $Output .= ShowMessage($Message, $MessageType);198 197 return($Output); 199 198 } -
trunk/includes/Version.php
r524 r525 1 1 <?php 2 2 3 $Revision = 52 4; // Subversion revision3 $Revision = 525; // Subversion revision 4 4 $DatabaseRevision = 524; 5 5 $ReleaseTime = '2013-02-20'; -
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 -
trunk/index.php
r524 r525 130 130 } 131 131 132 $Output = '<br />'. 132 $Output = ''; 133 if(isset($Message)) $Output .= ShowMessage($Message, $MessageType); 134 $Output .= '<br />'. 133 135 '<table class="Home"><tr><td colspan="3">'.ShowWelcome(). 134 136 '</td></tr>'. -
trunk/save.php
r514 r525 26 26 27 27 // Get data for english original 28 $DbResult = $System->Database->query('SELECT * FROM `'.$Table.'` WHERE (`Entry`='.$SourceText['Entry'].') AND (`Language` = 0) AND (`VersionStart` = '.$SourceText['VersionStart'].') AND (`VersionEnd` = '.$SourceText['VersionEnd'].')');28 $DbResult = $System->Database->query('SELECT * FROM `'.$Table.'` WHERE (`Entry`='.$SourceText['Entry'].') AND (`Language` = '.$Config['OriginalLanguage'].') AND (`VersionStart` = '.$SourceText['VersionStart'].') AND (`VersionEnd` = '.$SourceText['VersionEnd'].')'); 29 29 if($DbResult->num_rows > 0) 30 30 { … … 38 38 $Filter = ' AND ('.substr($Filter, 3).')'; 39 39 40 $DbResult = $System->Database->query('SELECT * FROM `'.$Table.'` WHERE (`Language` = 0)'.$Filter);40 $DbResult = $System->Database->query('SELECT * FROM `'.$Table.'` WHERE (`Language` = '.$Config['OriginalLanguage'].')'.$Filter); 41 41 while($EnglishFound = $DbResult->fetch_assoc()) 42 42 { -
trunk/statistic.php
r524 r525 7 7 if(array_key_exists('Version', $_GET)) $_SESSION['StatVersion'] = $_GET['Version']; 8 8 if(!array_key_exists('StatVersion', $_SESSION)) $_SESSION['StatVersion'] = $Config['Web']['GameVersion']; 9 if(!isset($_SESSION['language'])) 10 { 11 if($User->Licence(LICENCE_USER)) 12 { 13 $_SESSION['language'] = $User->Language; 14 } else $_SESSION['language'] = ''; 15 } 16 if(array_key_exists('language', $_GET)) { 17 if($_GET['language'] == 'all') $_SESSION['language'] = 'all'; 18 else $_SESSION['language'] = LoadLanguageIdParameter(); 19 } 9 20 10 21 function ShowStatTable() 11 22 { 12 global $System, $User ;23 global $System, $User, $Config; 13 24 14 25 $Output = ''; 15 if(!isset($_SESSION['language'])) 16 { 17 if($User->Licence(LICENCE_USER)) 18 { 19 $_SESSION['language'] = $User->Language; 20 } else $_SESSION['language'] = 2; 21 } 22 if(array_key_exists('language', $_GET)) $_SESSION['language'] = LoadLanguageIdParameter(); 23 26 24 27 $BuildNumber = GetBuildNumber($_SESSION['StatVersion']); 28 if(is_numeric($_SESSION['language'])) $LanguageFilter = 'AND (`Language`='.$_SESSION['language'].')'; 29 else $LanguageFilter = ' AND (`Language`!='.$Config['OriginalLanguage'].')'; 25 30 26 31 $GroupListQuery = 'SELECT `Id`, `TablePrefix`, `Name` FROM `Group`'; … … 33 38 $Query .= 'SELECT (SELECT COUNT(DISTINCT(`Entry`)) FROM ('. 34 39 ' SELECT `T`.`Id`, `T`.`Entry` FROM `'.$DbRow['TablePrefix'].'` AS `T`'. 35 ' WHERE (`Complete` = 1) AND (`Language`='.$_SESSION['language'].')AND (`VersionStart` <= '.$BuildNumber.') AND (`VersionEnd` >= '.$BuildNumber.')'.40 ' WHERE (`Complete` = 1) '.$LanguageFilter.' AND (`VersionStart` <= '.$BuildNumber.') AND (`VersionEnd` >= '.$BuildNumber.')'. 36 41 ') AS `C1`) AS `Translated`, '. 37 42 '(SELECT COUNT(DISTINCT(`Entry`)) FROM ('. 38 43 ' SELECT `T`.`Id`, `T`.`Entry` FROM `'.$DbRow['TablePrefix'].'` AS `T`'. 39 ' WHERE (`Language` = 0) AND (`VersionStart` <= '.$BuildNumber.') AND (`VersionEnd` >= '.$BuildNumber.')'.44 ' WHERE (`Language` = '.$Config['OriginalLanguage'].') AND (`VersionStart` <= '.$BuildNumber.') AND (`VersionEnd` >= '.$BuildNumber.')'. 40 45 ') AS `C2`) AS `Total`, "'.$DbRow['Name'].'" AS `Name` UNION '; 41 46 } … … 83 88 84 89 // Show language selection 85 $Output .= 'Jazyk: <a href="statistic.php">Dohromady</a>'; 86 foreach($LanguageList as $Language) 87 if($Language['Enabled'] == 1) $Output .= ' <a href="?language='.$Language['Id'].'">'.$Language['Name'].'</a>'; 90 $Output .= 'Jazyk: '; 91 $Lang = '<a href="statistic.php?language=all">Všechny</a>'; 92 if('all' == $_SESSION['language']) $Output .= '<strong>'.$Lang.'</strong> '; 93 else $Output .= $Lang; 94 foreach($LanguageList as $Language) 95 if($Language['Enabled'] == 1) 96 { 97 $Lang = ' <a href="?language='.$Language['Id'].'">'.$Language['Name'].'</a>'; 98 if($Language['Id'] == $_SESSION['language']) $Output .= '<strong>'.$Lang.'</strong> '; 99 else $Output .= $Lang; 100 } 88 101 89 $Output .= '<br/><br /><h3>Statistika dokončení překladů pro verzi '.$_SESSION['StatVersion'].'</h3><br/>'; 90 102 if(is_numeric($_SESSION['language'])) $LanguageName = $LanguageList[$_SESSION['language']]['Name']; 103 else $LanguageName = 'Všechny'; 104 $Output .= '<br/><br /><h3>Statistika dokončení překladů jazyka '.$LanguageName.' pro verzi '.$_SESSION['StatVersion'].'</h3><br/>'; 91 105 $Output .= ShowStatTable(); 92 106 93 $Output .= '<br/><p><strong>Celková statistika v závislosti na čase: </strong><a href="http://stat.zdechov.net/game/?Measure=18">Počet přeložených textů</a></p> 94 <div>Počet stáhnutí přeložených textů v SQL souboru: <strong>'; 95 107 $Output .= '<div>Počet stáhnutí přeložených textů v SQL souboru: <strong>'; 96 108 $ID = $System->Database->query('SELECT count(distinct(`IP`)) FROM `Log` WHERE `Type` = 2'); 97 109 $Line = $ID->fetch_row(); 98 110 $Output .= $Line[0]; 99 100 $Output .= '</strong></div> 101 <div>Počet stáhnutí: <strong>'; 102 111 $Output .= '</strong></div>'; 112 113 $Output .= '<div>Počet stáhnutí: <strong>'; 103 114 $ID = $System->Database->query('SELECT count(distinct(`IP`)) FROM `Log` WHERE `Type` = 0'); 104 115 $Line = $ID->fetch_row(); 105 116 $Output .= $Line[0]; 106 107 117 $Output .= '</strong></div>'; 108 118 -
trunk/team.php
r524 r525 234 234 '(SELECT COUNT(DISTINCT(`Entry`)) FROM ('. 235 235 ' SELECT `T`.* FROM `'.$DbRow['TablePrefix'].'` AS `T`'. 236 ' WHERE (`Language` = 0) AND (`VersionStart` <= '.$BuildNumber.') AND (`VersionEnd` >= '.$BuildNumber.')'.236 ' WHERE (`Language` = '.$Config['OriginalLanguage'].') AND (`VersionStart` <= '.$BuildNumber.') AND (`VersionEnd` >= '.$BuildNumber.')'. 237 237 ') AS `C2`) AS `Total`, "'.$DbRow['Name'].'" AS `Name` UNION '; 238 238 }
Note:
See TracChangeset
for help on using the changeset viewer.