Skip to content
This repository has been archived by the owner on Sep 30, 2019. It is now read-only.

Commit

Permalink
better alert timing information
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredwsmith committed Nov 26, 2015
1 parent a285f0e commit 7cdc3b4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,15 @@
$advisory_class = "normal";
}

if($alert['expires_epoch'])
$alert_timing_text = '';

echo "<li class=\"alert vtec-phen-{$alert['phenomena']} vtec-sig-{$alert['significance']}\" id=\"{$alert['phenomena']}-{$alert['significance']}-{$alert['date_epoch']}\"><span class=\"alert-name\">" . $alert['description'] . "</span> <span class=\"alert-timing\">until " . $alert['expires'] . "</span>";
if($alert['date_epoch'] > time()) {
$alert_timing_text = "from {$alert['date']} ";
}

$alert_timing_text .= " until {$alert['expires']}";

echo "<li class=\"alert vtec-phen-{$alert['phenomena']} vtec-sig-{$alert['significance']}\" id=\"{$alert['phenomena']}-{$alert['significance']}-{$alert['date_epoch']}\"><span class=\"alert-name\">" . $alert['description'] . "</span> <span class=\"alert-timing\">$alert_timing_text</span>";
echo "<ul><li>" . str_replace("\n",'<br />',trim($alert['message'])) . "</li></ul></li>";
}
?>
Expand Down

0 comments on commit 7cdc3b4

Please sign in to comment.