simple_hosts_list.php

Go to the documentation of this file.
00001 <?php
00002 include('../lfswinterface.php');
00003 include('../caches/lfsworldfilecache.php');
00004 include('../utilities/stringproc.php');
00005 
00006 //Init LFSWorld Interface
00007 $lfsw = new LFSWInterface();
00008 //Get hosts list
00009 $hosts = $lfsw->getHostList();
00010 //Get instance of String proc (for colour and codepage parsing)
00011 $sProc =& LFSStringProc::singleton();
00012 
00013 ?>
00014 <html>
00015   <head>
00016     <title>LFSW-PPF Host list sample</title>
00017   </head>
00018   <body>
00019 <?php if($hosts['success']): ?>
00020     <table>
00021       <thead>
00022         <tr>
00023           <th>Hostname</th>
00024           <th>Track</th>
00025           <th>Version</th>
00026           <th>Players / Max</th>
00027         </tr>
00028       </thead>
00029       <tbody>
00030 <?php foreach($hosts['data'] as $host): ?>
00031         <tr>
00032           <td><?=$sProc->process($host['host_name']) ?></td>
00033           <td><?=$host['track'] ?></td>
00034           <td><?=$host['major_version'].$host['minor_version'] ?></td>
00035           <td><?=$host['players'] ?> / <?=$host['max_players'] ?></td>
00036         </tr>
00037 <?php endforeach; ?>
00038       </tbody>
00039       <tfoot>
00040         <tr>
00041           <td>Hostname</td>
00042           <td>Track</td>
00043           <td>Version</td>
00044           <td>Players / Max</td>
00045         </tr>
00046       </tfoot>
00047     </table>
00048 <?php else: ?>
00049     <p>Error!</p>
00050 <?php foreach($hosts['errors'] as $entry): ?>
00051     <p><?=$entry ?></p>
00052 <?php endforeach; ?>
00053 <?php endif; ?>
00054   </body>
00055 </html>

Generated on Wed Oct 25 03:13:32 2006 for LFSWorldParsingProviderFramework by  doxygen 1.4.6