Source for file example5.tpl.php
Documentation is available at example5.tpl.php
* This is part of Example 5.
* This file handles the display of information gathered in example5.php
$data = $template['data'];
foreach ($data as $game):
<th colspan="4"> <?php echo $game[0 ]['meta']['gametitle']; ?></th>
foreach ($game as $result):
$status = $result['status'];
<td colspan="4">Server did not reply to request</td>
<td> <?php echo $status['hostname']; ?></td>
<td> <?php echo $status['map']; ?></td>
<td> <?php echo (int) $status['numplayers']; ?> / <?php echo (int) $status['maxplayers']; ?></td>
$url = $_SERVER['SCRIPT_NAME'] . '?view=' . $result['meta']['addr'] .
'&port=' . $result['meta']['port'] . '&game=' . $result['meta']['game'];
echo $url; ?>">View</a></td>
if (isset ($template['moreinfo'])):
<table border="1" cellpadding="0" cellspacing="0">
$players = $template['moreinfo']['players'];
foreach ($players as $player) {
$score[] = $player['score'];
foreach ($players as $player):
<tr><td> <?php echo $player['name']; ?></td><td> <?php echo $player['score']; ?></td></tr>
<table border="1" cellpadding="0" cellspacing="0">
$rules = $template['moreinfo']['rules'];
foreach ($rules as $rule => $value):
<tr><td> <?php echo $rule; ?></td><td> <?php echo $value; ?></td></tr>
Documentation generated on Mon, 11 Mar 2019 15:39:46 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|