Home

Anonymous

blogcat

18 Feb 2011: Finally able to connect to the proper SVN. It's been updated.

================================================================================

A simple template based content management system.

See blogcat in action: Bearzooka!

To use blogcat you must first define a template. Bearzooka uses this as the main template:

<html>
<head>
    <title>
        {title}
    </title>
    <LINK rel="stylesheet" href="http://bearzooka.co.cc/css/main.css" type="text/css">
    <link rel="stylesheet" href="http://bearzooka.co.cc/css/prettify.css" type="text/css">
    <script type="text/javascript" src="http://bearzooka.co.cc/js/prettify.js"></script>
</head>
<body onload="prettyPrint()">
    <div id="wrapper">
        <div id="content"><div id="header"></div>
        {page}
        {menu}
        <div id="footer">©2010 <a href="mailto:jbernard@gatech">Jeff Bernard</a><br />Powered by 
<a href="http://sf.net/p/blogcat">blogcat</a></footer>
        </div>
    </div>
</body>
</html>

(blogcat/theme/coolcat.tpl)

Next, you make a php page to fill in the template:

loginDB('bearzooka'); // login to the database
    $page->set("page", $page->servePage($_GET['page'], "DESC")); // fill {page} with another page
    $page->set("title", "Bearzooka! ".$page->guessTitle()); // set the title
    $page->set("menu", '
'.$page->servePage("menu", "ASC").'
'); // fille {menu} with another page $page->logoutDB(); // logout of the database echo $page->output(); // echo out the results ?>

As you can see, there are two ways of filling out the template. The first is to set the values directly, like: $page->set("title", "Bearzooka! ".$page->guessTitle()), the other method is to fill a value with a totally different page by calling Blogcat->servePage().

In order to use Blogcat->servePage(), you must first log into a database. Before you can call Blogcat->loginDB(), you must fill in the appropriate global vars in 'blogcat/blogcat_dbsettings.php'. Blogcat->servePage(), then will read from a database, using those entries to fill out another template and then returning that filled-out template.


MongoDB Logo MongoDB