<?php
$config_file = "last.ini";

// ------------------------

function load_file($date)
{
	
	$entry = $date.'/index.html';
	
	if (file_exists($entry))
	{
		return file_get_contents($entry);
	}
	else
	{
		trigger_error('No entry for that date ('.$date.')', E_USER_ERROR);
	}
		
}

$config = parse_ini_file($config_file);

header("Content-type:text/html; charset=utf-8");

$header = <<<EOF
    <link rel="openid.server" href="http://www.myopenid.com/server" />
    <link rel="openid.delegate" href="http://yoan.blanc.myopenid.com/" />
    <meta name="robots" content="noindex, follow">
EOF;

//echo str_replace('"/blog', '"/~yoan/blog', str_replace('</head>', $header.'</head>', load_file($config['last'])));
echo str_replace('</head>', $header.'</head>', load_file($config['last']));
?>
