<?php
#################################################
#Content Management System - CurrentArticles for
#The Honolulu Advertiser - v 1.0 beta 2
#Author - Chris Kanemura
#Copyright 2001 - The Honolulu Advertiser
#################################################
//Get execution time
//function exec_time()
//	{
//	$mtime = explode( " ", microtime());
//	$msec = (double)$mtime[0];
//	$sec = (double)$mtime[1];
//	return $sec + $msec;
//	}

//Start timing here
//$starttime = exec_time();

// Get the requested URI(address of file)

$url = $REQUEST_URI ;
$domain = $SERVER_NAME;

// Rip requested URI apart via a slash as diliminator

$dir = explode ("/", $url);

// Convert to an array

$dir_zero=$dir[0] ;
$engine=$dir[1] ; // This file
$section=$dir[2] ; // Section
$none=$dir[3] ; // Feature

//Date info
$copyyear = date("Y");

//Create variables for file access to clean up code a bit

$index = "/www/fronts/$section.html";
$filedir = "/www/engine";
$include_path = "/www/cms/site_includes";
$header = "$include_path/section-header.php";
$footer = "$include_path/section-footer.php";
$section_file = "/www/fronts/$section.html";
$homepage = "http://www.honoluluadvertiser.com";
$copyright = "";

//Check for hacking stuff for email this page but let em print I guess
if(!$section)
	{
		$err = "404";
		require($header);
		print("404 - The page you are looking for is unavailable!.");
		require($footer);
		exit();
	}
//Select which template to build
//Display Article
elseif($section && file_exists($section_file))
	{
		require($header);
		include($section_file);
		require($footer);
	}
//None of the above, too bad 404 a'ohe page, strip email and print version options - why in the world would you want to print this page anyway
else
	{
			$err = "404";
			require($header);
			print("Sorry, the section you are looking for is not here or is no longer available. <br><br>Click <a href=\"http://www.honoluluadvertiser.com/\">here</a> to return to our homepage.");
			require($footer);
	}

//Exit out
//$endtime = exec_time();
//$finaltime = $endtime - $starttime;
//print("<p>It has taken $finaltime seconds to parse this page");

?> 

