rendered paste body<?php
/* The Blog Module for The Maranga Publishing System is based on the Guava Framework */
function blogmod($ret=null,$blockreq=false)
{
//Options
if($ret=='head'){return 'theme';}
if($ret=='foot'){return 'theme';}
if($ret=='data'){return true;}
if($ret=='theme'){return 'blogmod.php';}
//Engine
if($ret=='body'){
include(get('url','data') . 'blog.xml'); //Get the Data
$xml = new SimpleXMLElement($xmlfeed);
echo '<h1>Blog</h1>';
$method = get('method');
$parameter = get('parameter');
if(!$method){ //Home Page
foreach($xml->post as $post){
$block='excerpt';
$title = $post->title;
$date = $post->date;
$category = $post->category;
$content_excerpt = substr($post->content,0,165);
$content_excerpt = $content_excerpt . '...';
include(get('url','site') . 'blogmod.php');
}
}
elseif($method=='post'){ //Single Page
foreach($xml->post as $post){
if($post->title==$parameter){
$block = 'single';
$title = $post->title;
$date = $post->date;
$category = $post->category;
$content = $post->content;
include(get('url','site') . 'blogmod.php');
}
}
}
elseif($method=='category'){ //Category Links
if(!$parameter){
$i=0;
foreach($xml->post as $post){
$block = 'category';
if(isset($categoryar)){
if(!in_array($post->category, $categoryar)){
$categoryar[$i] = $post->category;
}
}
else{
$categoryar[$i] = $post->category;
}
if(isset($categoryar[$i])){
$category = $categoryar[$i];
include(get('url','site') . 'blogmod.php');
}
$i++;
}
}
else{
foreach($xml->post as $post){
if($post->category==$parameter){
$block = 'excerpt';
$title = $post->title;
$date = $post->date;
$category = $post->category;
$content_excerpt = substr($post->content,0,165);
$content_excerpt = $content_excerpt . '...';
include(get('url','site') . 'blogmod.php');
}
}
}
}
else{
echo 'no query found of that nature';
}
include(get('url','site') . 'blogmod.php');
}
}
function blogadmin(){
}
//blog_module.php tags
?>