<?php
/*
todo:
+ date-handing (table default, not php set; UTCify)
+ date in µsecods and error on collision
+ rating and further metadata
+ longer uri field
+ link-checking
*/
include("common.php");
setcookie(
"at", // name
gmdate("Y-m-d\TH:i:s\Z", time()), // load time
ceil(time() + 60 * 60 * 24 * 365.25) // expire in a sidereal year or so
);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>↔</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="../nekton" type="text/css" />
<link rel="stylesheet" href="sufficiency" type="text/css" />
<link rel="alternate" href="rss1" type="application/rss+xml" />
<style type='text/css'>
</style>
</head>
<body>
<div style="text-align: center;">
<h1 id="head" style="display: inline;">Iff</h1>
<span class="subtitle">a necessary and sufficient distraction</span>
<p><a href="about">about</a></p>
<?php echo $searchform; ?>
<!-- <p style="padding: 1em; border: 1px dotted red;">This is a draft of a replacement for <a href="http://rheme.net/iff/">Iff</a>. The latest posts may be sub–production-quality tests. Use it (<a href="rss1">and its RSS feed</a>) as you please and <a href="mailto:iff@rheme.net">e-mail</a>, <a href="xmpp:celoyd@gmail.com">jabber</a>, or IRC me with comments.</p> -->
<hr style="border: none; border-bottom: 1px solid white;" />
</div>
<?php
$search = tryfirst(@$_GET["find"], "");
/* Default to 60 entries unless there's a search,
in which case only catch an explicit limit: */
if ($search != "") {
$limit = tryfirst(@$_GET["n"], "ALL");
} else {
$limit = tryfirst(@$_GET["n"], 40);
if ($limit < 1) { $limit = "ALL"; }
}
if (isset($_GET["fresh"])) {
$since = tryfirst($_COOKIE["at"], 0);
} else {
$since = tryfirst(@$_GET["since"], "'-infinity'"); }
$posts = getposts($limit, $search, $since);
if ($posts == null) { // Loose comparison!
echo "<p>(There’s nothing here. If there should be, please <a href='mailto:iff@rheme.net'>e-mail me and complain</a>.)</p>";
} else {
postsdlsplort($posts);
}
?>
<hr style="border: none; border-bottom: 1px solid white;" />
<p><a href='http://rheme.net/iff/?n=all'>The whole archive.</a></p>
</body>
</html>