Christians aggregator index.php




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
        <title>Christian Biggins | Web 2.0 Junky | PHP Developer Extraordinaire</title>

        <link rel="stylesheet" href="blueprint/screen.css" type="text/css" media="screen, projection" />
        <link rel="stylesheet" href="blueprint/print.css" type="text/css" media="print" />
        <!--[if IE]><link rel="stylesheet" href="blueprint/ie.css" type="text/css" media="screen, projection" /><![endif]-->
        <link rel="stylesheet" href="blueprint/plugins/fancy-type/screen.css" type="text/css" media="screen, projection" />
    </head>
    <body>
        <div class="container">
            <div id="header" class="span-24 first last">
                <h1 class="loud">cb.net.au</h1>
                <h3 class="quiet">The home of Christian Biggins</h3>
            </div>
            <div class="span-10 colborder" id="content">
                <h2 class="loud">Blog Posts</h2>
<?php
    $db = mysql_connect('localhost', 'cb', 'cb');
    mysql_select_db('cb', $db);

    $sql = 'SELECT f.Title, fc.FeedData, f.SiteURL '
          .'  FROM feeds f'
          .'       JOIN feedcontents fc ON fc.FeedID = f.id';

    $q = mysql_query($sql, $db);

    while ($row = mysql_fetch_assoc($q)) {
        print "<h3 class='loud top bottom'><a href='".$row['SiteURL']."'>".$row['Title']."</a></h3>";

        $posts = unserialize(urldecode($row['FeedData']));

        foreach ($posts as $key => $post) {
            if (array_key_exists('title', $post) && strlen($post['title']) > 0) print "<h4 class='loud bottom'>".$post['title']."</h4>";
            if (array_key_exists('description', $post) && strlen($post['description']) > 0) print "<span class='top'>".substr(strip_tags($post['description']), 0, 1000)."</span>";
            if (array_key_exists('link', $post) && strlen($post['link']) > 0) print " - <a href='".$post['link']."'>[Read More]</a>";
        }

        print "<hr />";
    }
?>

</div>
<div class="span-6 colborder" id="sidebar">
<div id="twitter_div">
<h3 class="loud">Twitter Updates</h3>
<ul id="twitter_update_list"></ul>
<a href="http://twitter.com/cbiggins" id="twitter-link" style="display:block;text-align:right;">follow me on Twitter</a>
</div>
</div>
<div class="span-6 last" id="sidebar2">
<h3 class="loud">Find me at</h3>
<a href="/sau/">Skylines Australia</a><br />
<a href="/github/">GitHub</a><br />
<a href="/delicious/">Delicious</a><br />
<a href="/flickr/">Flickr</a><br />
<a href="/lastfm/">Last.fm</a><br />
<a href="/shelfari/">Shelfari</a><br />
<a href="/qik/">Qik</a><br />
<a href="/twitter/">Twitter</a><br />
<a href="/facebook/">Facebook</a><br />
<a href="/technorati/">Technorati</a><br />
<a href="/friendfeed/">FriendFeed</a><br />
<a href="/dzone/">Dzone</a><br />
<a href="/digg/">Digg</a><br />
<a href="/reddit/">Reddit</a><br />
</div>
</div>
<script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script>
<script type="text/javascript" src="http://twitter.com/statuses/user_timeline/cbiggins.json?callback=twitterCallback2&amp;count=10"></script>
</body>
</html>