Changeset 639 for trunk/Modules/Server/Server.php
- Timestamp:
- Dec 11, 2013, 10:21:12 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Server/Server.php
r637 r639 27 27 } 28 28 29 30 class PageServerList extends Page 29 class PageServerList extends PageEdit 31 30 { 32 function Show() 31 function __construct($System) 32 { 33 parent::__construct($System); 34 $this->Table = 'Server'; 35 $this->TableSQL = 'SELECT `Name`, `URL`, `Parts`, `XPRate`, `GameplayStyle`, '. 36 '`ClientVersion`.`Version` AS `Version` FROM `Server` '. 37 'LEFT JOIN `ClientVersion` ON `ClientVersion`.`Id` = `Server`.`ClientVersion`'; 38 $this->Definition = array( 39 'Name' => array('Type' => 'String', 'Title' => T('Name')), 40 'URL' => array('Type' => 'URL', 'Title' => T('URL')), 41 'Parts' => array('Type' => 'String', 'Title' => T('Translated')), 42 'XPRate' => array('Type' => 'String', 'Title' => T('XP rate')), 43 'GameplayStyle' => array('Type' => 'String', 'Title' => T('Style')), 44 'ClientVersion' => array('Type' => 'String', 'Title' => T('Client version')), 45 ); 46 } 47 48 function ViewList() 33 49 { 34 50 $this->Title = T('Servers'); … … 37 53 'Term "Czech server" doesn\'t mean that server is operated by Czech people but that it is possible to play in Czech.').'.</p>'; 38 54 $Output .= '<h3>'.T('Translated server list').'</h3>'; 39 40 $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM `ServerList`'); 41 $DbRow = $DbResult->fetch_row(); 42 $PageList = GetPageList($DbRow[0]); 43 44 $Output .= $PageList['Output']; 45 $Output .= '<table class="BaseTable">'; 46 47 $TableColumns = array( 48 array('Name' => 'Name', 'Title' => T('Name')), 49 array('Name' => 'Parts', 'Title' => T('Translated')), 50 ); 51 $Order = GetOrderTableHeader($TableColumns, 'Name', 1); 52 $Output .= $Order['Output']; 53 54 $Query = 'SELECT `URL`, `Name` FROM `ServerList` '.$Order['SQL'].$PageList['SQLLimit']; 55 56 $DbResult = $this->System->Database->query($Query); 57 while($Line = $DbResult->fetch_assoc()) 58 { 59 $Output .= '<tr><td><a href="'.$Line['URL'].'">'.$Line['Name'].'</a></td>'. 60 '<td>'.$Line['Parts'].'</td></tr>'; 61 } 62 $Output .= '</table>'. 63 $PageList['Output']; 55 $Output .= parent::ViewList(); 64 56 return($Output); 65 57 }
Note:
See TracChangeset
for help on using the changeset viewer.