Commit 5d485bbd authored by Simon Welsh's avatar Simon Welsh

Pull timezone splur into its own tag and do a redirect back to the index when...

Pull timezone splur into its own tag and do a redirect back to the index when accessing a log page with no logs

git-svn-id: svn+ssh://lsgn/var/logbot-www@55 5f99df0c-6b0a-442a-b40a-040688e84a9d
parent 66a4b40b
......@@ -9,6 +9,7 @@ require 'tags/info.php';
require 'tags/log.php';
require 'tags/logs.php';
require 'tags/month.php';
require 'tags/timezone.php';
require 'tags/year.php';
require 'tags/years.php';
......
......@@ -21,17 +21,17 @@ if(isset($_GET['date']) && preg_match('#^20[0-9]{2}-[01][0-9]-[0-3][0-9]$#', $_G
<a href="index.php">Index</a>
</log:info>);
$body->appendChild(<p>
Timestamps are in NZT (<a href="http://timeanddate.com/worldclock/city.html?n=264" title="Click here to see what time it is right now in Wellington, New Zealand">New Zealand Time</a>).
</p>);
$body->appendChild(<logs:timezone />);
$body->appendChild(<logs:logs stamp={$time} />);
} else {
goto NoLog;
header('Location: index.php');
exit;
}
} elseif(isset($_GET['date'])) {
header('Location: index.php');
exit;
} else {
NoLog:
$head = <log:head />;
if(count($dates) > 1) {
......
......@@ -33,9 +33,7 @@ $body->appendChild(<log:info>
{$header}
<a href="index.php">Index</a>
</log:info>);
$body->appendChild(<p>
Timestamps are in NZT (<a href="http://timeanddate.com/worldclock/city.html?n=264" title="Click here to see what time it is right now in Wellington, New Zealand">New Zealand Time</a>).
</p>);
$body->appendChild(<logs:timezone />);
if(empty($results)) {
$body->appendChild(<p><strong>No results found</strong></p>);
......
<?php
class :logs:timezone extends :x:element {
protected function render() {
return <p>
All timestamps are in NZT (<a href="http://timeanddate.com/worldclock/city.html?n=264" title="Click here to see what time it is right now in Wellington, New Zealand">New Zealand Time</a>).
</p>;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment