Changeset 525 for trunk/statistic.php
- Timestamp:
- Feb 20, 2013, 11:30:49 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.