New Boog Design Home Page Features
I've just been updating the boogdesign home page so that it displays recent updates from the rest of the site. I used Magpie RSS rather than hacking around with databases, as I figured it would be easier to extend later and less code in the short term. Here's the code:
<?php
$rss1 = fetch_rss("http://www.boogdesign.com/b2evo/xmlsrv/rss2.php?blog=1");
echo "<ul>";
for ($i=0; $i<=3; $i++) {
$href = $rss1->items[$i]['link'];
$title = $rss1->items[$i]['title'];
$date_timestamp = $rss1->items[$i]['date_timestamp'];
echo "<li><a href=\"$href\">$title</a> <span style=\"font-size: small\">(".strftime("%c", $date_timestamp).")</span></li>";
}
echo "</ul>";
?>
It displays the most recent four posts, the post titles linked to the posts, with a timestamp. Since my existing index page was already linked directly from several places I added a redirect directive to index.html:
<meta http-equiv="refresh" content="0;index.php"/>
And I edited my .htaccess page to force index.php to be the default page:
DirectoryIndex index.php
| Print article | This entry was posted by robertc on 19/09/06 at 09:14:39 pm . Follow any responses to this post through RSS 2.0. |
Hello! HTML5 and CSS3 available now
Early access to HTML5 in Action available now