Update killers.php

Added check for killers var to fix issue #158 - Sorry wasn't sure how to change my original commit :S
This commit is contained in:
Declan Pym 2014-09-12 10:21:10 +10:00
parent 43510a1fa9
commit 2aef1424e6

View File

@ -85,7 +85,6 @@ if ($latests) {
} else echo 'No player kills exist.'; } else echo 'No player kills exist.';
} else if ($config['TFSVersion'] == 'TFS_03') { } else if ($config['TFSVersion'] == 'TFS_03') {
/////////
$cache = new Cache('engine/cache/killers'); $cache = new Cache('engine/cache/killers');
if ($cache->hasExpired()) { if ($cache->hasExpired()) {
$deaths = fetchLatestDeaths_03(30, true); $deaths = fetchLatestDeaths_03(30, true);
@ -94,25 +93,25 @@ if ($latests) {
} else { } else {
$deaths = $cache->load(); $deaths = $cache->load();
} }
?>
<h1>Latest Killers</h1> if ($deaths && !empty($deaths)) {
<table id="deathsTable" class="table table-striped"> ?>
<tr class="yellow"> <h1>Latest Killers</h1>
<th>Killer</th> <table id="deathsTable" class="table table-striped">
<th>Time</th> <tr class="yellow">
<th>Victim</th> <th>Killer</th>
</tr> <th>Time</th>
<?php foreach ($deaths as $death) { <th>Victim</th>
echo '<tr>'; </tr>
echo "<td><a href='characterprofile.php?name=". $death['killed_by'] ."'>". $death['killed_by'] ."</a></td>"; <?php foreach ($deaths as $death) {
echo "<td>". getClock($death['time'], true) ."</td>"; echo '<tr>';
echo "<td>At level ". $death['level'] .": <a href='characterprofile.php?name=". $death['victim'] ."'>". $death['victim'] ."</a></td>"; echo "<td><a href='characterprofile.php?name=". $death['killed_by'] ."'>". $death['killed_by'] ."</a></td>";
echo '</tr>'; echo "<td>". getClock($death['time'], true) ."</td>";
} ?> echo "<td>At level ". $death['level'] .": <a href='characterprofile.php?name=". $death['victim'] ."'>". $death['victim'] ."</a></td>";
</table> echo '</tr>';
} ?>
<?php </table>
///////// <?php
} else echo 'No player deaths exist.';
} }
include 'layout/overall/footer.php'; ?> include 'layout/overall/footer.php'; ?>