Commit dffa4dd5 authored by Simon Welsh's avatar Simon Welsh

Remove search_form() and only start doing things when we know we have logs

git-svn-id: svn+ssh://lsgn/var/logbot-www@51 5f99df0c-6b0a-442a-b40a-040688e84a9d
parent 5404363a
......@@ -9,15 +9,3 @@ class :log:search extends :x:element {
</form>;
}
}
function search_form($val = false) {
if($val) {
$val = htmlentities($val);
} else {
$val = '';
}
$form = sprintf('<form id="searchform" method="get" action="search.php"><input type="text" class="text" name="q" value="%s" /><input type="submit" class="action" value="L" /></form>', $val);
return $form;
}
......@@ -6,24 +6,24 @@ require_once 'funcs.php';
$dates = build_dates();
$body = <x:frag />;
if(isset($_GET['date']) && preg_match('#^20[0-9]{2}-[01][0-9]-[0-3][0-9]$#', $_GET['date'])) {
$time = strtotime($_GET['date']);
$year = date('Y', $time);
$month = date('F', $time);
$day = date('j', $time);
$body = <x:frag />;
$body->appendChild(<log:info>
<h2>IRC log for {date('j F Y', $time)}</h2>
<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>);
if(isset($dates[$year][$month][$day])) {
$head = <log:head robots="index,nofollow" />;
$body->appendChild(<log:info>
<h2>IRC log for {date('j F Y', $time)}</h2>
<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:logs stamp={$time} />);
} else {
......@@ -33,7 +33,6 @@ if(isset($_GET['date']) && preg_match('#^20[0-9]{2}-[01][0-9]-[0-3][0-9]$#', $_G
NoLog:
$head = <log:head />;
$body = <x:frag />;
if(count($dates) > 1) {
$body->appendChild(<log:info>
......
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