Net_GameServerQuery
[ class tree: Net_GameServerQuery ] [ index: Net_GameServerQuery ] [ all elements ]

Source for file example4.tpl.php

Documentation is available at example4.tpl.php

  1. <?php
  2. /*
  3.  * This is part of Example 5.
  4.  *
  5.  * This file handles the display of information gathered in example5.php
  6.  */
  7. ?>
  8. <table border="1">
  9.     <tr>
  10.         <th>Game</th>
  11.         <th>Server Name</th>
  12.         <th>Map</th>
  13.         <th>Players</th>
  14.     </tr>
  15.     <?php
  16.     $results $template['results'];
  17.     foreach ($results as $result):
  18.         $status $result['status'];
  19.         if ($status === false):
  20.             ?>
  21.             <tr>
  22.                 <td colspan="4">Server did not reply to request</td>
  23.             </tr>
  24.             <?php
  25.         else:
  26.             ?>
  27.             <tr>
  28.                 <td><?php echo $result['meta']['gametitle'];?></td>
  29.                 <td><?php echo $status['hostname'];?></td>
  30.                 <td><?php echo $status['map'];?></td>
  31.                 <td><?php echo (int) $status['numplayers'];?> / <?php echo (int) $status['maxplayers'];?></td>
  32.             </tr>
  33.             <?php
  34.         endif;
  35.     endforeach;
  36.     ?>
  37. </table>
  38. </body>
  39. </html>

Documentation generated on Mon, 11 Mar 2019 15:39:46 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.