<?php
// Oddry, a PostgresSQL-based link feed by Chris Black, 2007-2008.
// Copying and adaptation permitted with attribution.
// A tip o' the hat and a hearty endorsement for concept,
// code and content from Charlie Loyd's If And Only If.
//
//TODO:
// Make search uris less ugly
// Fix discontinuous highlight and other CSS bugs.
// Remove catgut->markdown highlighting and "conversion-okay" tags when all existing posts are fixed.
// images?
include("oddry-helpers.php");
setcookie(
"seenat", // name
gmdate("Y-m-d\TH:i:s\Z", time()), // load time
//"2006-01-12T01:37:10-08", // used for testing.
ceil(time() + 60 * 60 * 24 * 365.25) // expire in a sidereal year or so
);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Oddry</title>
<link rel="alternate" href="atom" type="application/atom+xml" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="oddry.css" type="text/css" />
<style type="text/css">
</style>
</head>
<body>
<div id="container">
<?php
// Populate variables $search, $limit, $hlsince, and $since.
extract(processget(@$_GET, $_COOKIE));
//debug statements.
//print "<string>" . $search . "</string><br />";
//print "<n>" . $limit . "</n><br />";
//print "<since>" . $since . "</since>";
//print "<hlsince>" . $hlsince . "</hlsince>";
?>
<div id="headline">
<h1>Oddry</h1>
<h2>Come on, see more!</h2>
</div>
<div id="sidebar">
<?php include('sidebar.php'); ?>
</div>
<div id="posts">
<dl id="entries">
<?php
$posts = getposts($search,$limit,$since);
if ($posts == null) { // Loose comparison!
echo "<p class='errormsg'><span>∄</span>(Looks like you found an empty set. <a href='mailto:oddry@bodger.org'>E-mail me</a> if it needs filling.)</p>";
} else {
postsplort($posts,$hlsince);
}
?>
</dl>
</div>
<!-- <div class="brickbatforfloats" ></div>-->
</div>
</body>
</html>