Ignore:
Timestamp:
Jul 29, 2013, 10:06:28 PM (11 years ago)
Author:
chronos
Message:
  • Modified: Game client version table transformed to application module ClientVersion.
Location:
trunk/Modules/ClientVersion
Files:
1 added
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Modules/ClientVersion/ClientVersion.php

    r553 r556  
    11<?php
    22
    3 include('includes/global.php');
     3class ModuleClientVersion extends AppModule
     4{
     5  function __construct($System)
     6  {
     7    parent::__construct($System);
     8    $this->Name = 'ClientVersion';
     9    $this->Version = '1.0';
     10    $this->Creator = 'Chronos';
     11    $this->License = 'GNU/GPL';
     12    $this->Description = 'Manage and show list of known versions of WoW client.';
     13    $this->Dependencies = array('');
     14  }
     15 
     16  function Start()
     17  {
     18        $this->System->RegisterPage('version.php', 'PageClientVersion');
     19        $this->System->RegisterMenuItem(array(
     20        'Title' => 'Verze hry',
     21        'Hint' => 'Seznam verzí herního klienta',
     22        'Link' => $this->System->Link('/version.php'),
     23        'Permission' => LICENCE_ANONYMOUS,
     24        'Icon' => '',
     25    ), 10);
     26  }
     27}
    428
    5 $DbResult = $System->Database->query('SELECT COUNT(*) FROM `ClientVersion`');
    6 $DbRow = $DbResult->fetch_row();
    7 $PageList = GetPageList($DbRow[0]);   
     29class PageClientVersion extends Page
     30{
     31        function Show()
     32        {               
     33    $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM `ClientVersion`');
     34    $DbRow = $DbResult->fetch_row();
     35    $PageList = GetPageList($DbRow[0]);   
    836
    9 $Output = '<h3>Verze hry</h3>'.
    10   $PageList['Output'];
     37    $Output = '<h3>Verze hry</h3>'.
     38      $PageList['Output'];
    1139
    12 $TableColumns = array(
    13   array('Name' => 'Version', 'Title' => 'Verze'),
    14   array('Name' => 'BuildNumber', 'Title' => 'Sestavení'),
    15   array('Name' => 'ReleaseDate', 'Title' => 'Datum uvolnění'),
    16   array('Name' => 'Title', 'Title' => 'Titutek'),
    17 );
    18 $Order = GetOrderTableHeader($TableColumns, 'BuildNumber', 1);
    19 $Output .= '<table class="BaseTable">'.
    20   $Order['Output'];
     40    $TableColumns = array(
     41      array('Name' => 'Version', 'Title' => 'Verze'),
     42      array('Name' => 'BuildNumber', 'Title' => 'Sestavení'),
     43      array('Name' => 'ReleaseDate', 'Title' => 'Datum uvolnění'),
     44      array('Name' => 'Title', 'Title' => 'Titutek'),
     45    );
     46    $Order = GetOrderTableHeader($TableColumns, 'BuildNumber', 1);
     47    $Output .= '<table class="BaseTable">'.
     48      $Order['Output'];
    2149
    22 $DbResult = $System->Database->query('SELECT * FROM ClientVersion '.$Order['SQL'].$PageList['SQLLimit']);
    23 while($Version = $DbResult->fetch_assoc())
    24 {
    25   $Output .= '<tr><td><a href="http://www.wowwiki.com/Patch_'.$Version['Version'].'">'.
    26     $Version['Version'].'</a></td><td>'.$Version['BuildNumber'].'</td><td>'.
    27     HumanDate($Version['ReleaseDate']).'</td><td>'.$Version['Title'].'</td></tr>';
     50    $DbResult = $this->System->Database->query('SELECT * FROM ClientVersion '.$Order['SQL'].$PageList['SQLLimit']);
     51    while($Version = $DbResult->fetch_assoc())
     52    {
     53      $Output .= '<tr><td><a href="http://www.wowwiki.com/Patch_'.$Version['Version'].'">'.
     54        $Version['Version'].'</a></td><td>'.$Version['BuildNumber'].'</td><td>'.
     55        HumanDate($Version['ReleaseDate']).'</td><td>'.$Version['Title'].'</td></tr>';
     56    }
     57    $Output .= '</table>'.
     58      $PageList['Output'];
     59    return($Output);       
     60  }
    2861}
    29 $Output .= '</table>'.
    30   $PageList['Output'];
    31      
    32 ShowPage($Output);
     62
Note: See TracChangeset for help on using the changeset viewer.