<?php
#################################################
#Content Management System - PHOTO ENGINE for
#The Honolulu Advertiser - v 1.0 beta 2
#Author - Chris Kanemura
#Copyright 2001 - The Honolulu Advertiser
#################################################

$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
$feature=$dir[3] ; // Gallery Name
$id=$dir[4] ; // ID

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

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

$article_file = "/www/photos/pdisplay.php";
$index = "/www/photos/pindex.php";
$filedir = "/www/engine";
$include_path = "/www/cms/site_includes";

//Turn off Print and Email function
$show = "no";

switch ($domain) 
	{
 	case "the.honoluluadvertiser.com":
 		$header = "$include_path/header.php";
		$footer = "$include_path/footer.php";
		$displayidx = "on";
		$homepage = "http://www.honoluluadvertiser.com";
		$copyright = "";
 		break;
 	case "news.hawaii.com":
 		$header = "/www/cb/hdcheader.php";
		$footer = "/www/cb/hdcfooter.php";
		$displayidx = "off";
		$homepage = "http://www.hawaii.com";
		$copyright = " and hawaii.com";
 		break;
 	case "www.news.hawaii.com":
 		$header = "/www/cb/hdcheader.php";
		$footer = "/www/cb/hdcfooter.php";
		$displayidx = "off";
		$homepage = "http://www.hawaii.com";
		$copyright = " and hawaii.com";
 		break;
 	default:
 		$header = "/www/advinc/header.php";
		$footer = "/www/advinc/footer.php";
		$displayidx = "on";
		$homepage = "http://www.honoluluadvertiser.com";
		$copyright = "";
	}

//Check for hacking stuff for email this page but let em print I guess
if(!$section)
	{
		require($header);
		include($index);
		require($footer);
	}
//Display Article
elseif($section && $feature)
	{
		require($header);
		include($article_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 story 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);
	}

?> 

