source: trunk/Modules/ClientVersion/ClientVersion.php@ 569

Last change on this file since 569 was 569, checked in by chronos, 12 years ago
  • Modified: Changed some pages names to without .php names.
File size: 2.0 KB
Line 
1<?php
2
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('client-version', 'PageClientVersion');
19 $this->System->RegisterMenuItem(array(
20 'Title' => 'Verze hry',
21 'Hint' => 'Seznam verzí herního klienta',
22 'Link' => $this->System->Link('/client-version/'),
23 'Permission' => LICENCE_ANONYMOUS,
24 'Icon' => '',
25 ), 10);
26 }
27}
28
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]);
36
37 $Output = '<h3>Verze hry</h3>'.
38 $PageList['Output'];
39
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'];
49
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 }
61}
62
Note: See TracBrowser for help on using the repository browser.