Changeset 449 for trunk


Ignore:
Timestamp:
Apr 12, 2010, 8:00:41 PM (15 years ago)
Author:
george
Message:
  • Upraveno: Informaci o dostupných verzích vyčítat přímo z tabulky ClientVersion sloupce Imported namísto složitých detekcí.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/statistic.php

    r448 r449  
    33include('includes/global.php');
    44
    5   if (array_key_exists('Version',$_GET))
    6     $_SESSION['StatVersion'] = $_GET['Version'];
    7   else
    8     if (!array_key_exists('StatVersion',$_SESSION))
    9       $_SESSION['StatVersion'] = $Config['Web']['GameVersion'];
     5if(array_key_exists('Version', $_GET)) $_SESSION['StatVersion'] = $_GET['Version'];
     6if(!array_key_exists('StatVersion', $_SESSION)) $_SESSION['StatVersion'] = $Config['Web']['GameVersion'];
    107
    118function ShowStatTable()
     
    5754    $Total += $Group['Total'];
    5855  }
    59   if ($Total <> '')
    60     echo('<tr><td><strong>Celkem</strong></td><td><strong>'.$Translated.'</strong></td><td><strong>'.$Total.'</strong></td><td><strong>'.ProgressBar(150, round($Translated / $Total * 100, 2)).'</strong></td></tr>');
    61   else
    62     echo('<tr><td><strong>Celkem</strong></td><td><strong>'.$Translated.'</strong></td><td><strong>'.$Total.'</strong></td><td><strong>'.ProgressBar(150, 0).'</strong></td></tr>');
     56  if($Total <> 0) $TotalCount = round($Translated / $Total * 100, 2);
     57    else $Total = 0;
     58  echo('<tr><td><strong>Celkem</strong></td><td><strong>'.$Translated.'</strong></td><td><strong>'.$Total.'</strong></td><td><strong>'.ProgressBar(150, $Total).'</strong></td></tr>');
    6359  echo('</table>');
    6460}
     
    6662ShowPage();
    6763 
    68   $ConfigVersion = $Config['Web']['GameVersion'];
    69   echo ('Zobrazit statistiku pro verzi: <br />');
    70   echo ('<a href="?Version=2.4.3">2.4.3</a> ');
    71   $DbResult = $Database->SQLCommand('SELECT Version, Title FROM `ClientVersion` WHERE BuildNumber > 8209 AND Title <> "" ORDER BY Version');
    72   while($DbRow = mysql_fetch_assoc($DbResult))
    73   {   
    74           if ($DbRow['Version'] == $Config['Web']['GameVersion']) $ConfigVersion = false;
    75           echo ('<a href="?Version='.$DbRow['Version'].'" Title="'.$DbRow['Title'].'">'.$DbRow['Version'].'</a> ');
    76   }
    77   $DbResult = $Database->SQLCommand('SELECT MAX(Version) as max FROM `ClientVersion`');
    78   $DbRow = mysql_fetch_assoc($DbResult);
    79   if (($ConfigVersion <> false) and ($ConfigVersion <> $DbRow['max'])) echo ('<a href="?Version='.$ConfigVersion.'">'.$ConfigVersion.'</a> ');
    80   echo ('<a href="?Version='.$DbRow['max'].'">'.$DbRow['max'].'</a> ');
     64// Show client version selection
     65echo('Zobrazit statistiku pro verzi: ');
     66$DbResult = $System->Database->query('SELECT `Version`, `Title` FROM `ClientVersion` WHERE `Imported`=1 ORDER BY `Version`');
     67while($DbRow = $DbResult->fetch_assoc())
     68{   
     69  echo('<a href="?Version='.$DbRow['Version'].'" title="'.$DbRow['Title'].'">'.$DbRow['Version'].'</a> ');
     70}
    8171
    82 echo('<h3>Statistika dokončení překladů pro verzi '.$_SESSION['StatVersion'].'</h3><br/>Jazyk: <a href="statistic.php">Dohromady</a>');
     72// Show language selection
     73echo('<br /><br /><h3>Statistika dokončení překladů pro verzi '.$_SESSION['StatVersion'].'</h3><br/>');
     74echo('Jazyk: <a href="statistic.php">Dohromady</a>');
    8375foreach($LanguageList as $Language)
    8476  if($Language['Enabled'] == 1) echo(' <a href="?language='.$Language['Id'].'">'.$Language['Name'].'</a>');
Note: See TracChangeset for help on using the changeset viewer.