<?php
/**
* @author Tim Redmond <hide@address.com>
* @package kwalbum
* @version 2.2
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*
*/
$DEBUG_INFO = '';
@date_default_timezone_set(date_default_timezone_get());
require_once 'include/DBConnection.php';
$DB = new DBConnection();
if (isset($G['f']))
require_once 'include/file.php';
require_once 'include/URLParser.php';
$URLP = new URLParser();
$pageName = $URLP->GetPageName();
$pageClassName = $pageName . 'Page';
if (@ file_exists('custompages/' . $pageClassName . '.php'))
include 'custompages/' . $pageClassName . '.php';
else if (@ file_exists('pages/' . $pageClassName . '.php'))
include 'pages/' . $pageClassName . '.php';
else
{
if (TEST_MODE)
$DEBUG_INFO .= "<p class='error'>' <big>$pageClassName</big>.php ' was not found!</p>";
$pageName = $URLP->pageName = 'Index';
$pageClassName = 'IndexPage';
require 'pages/IndexPage.php';
}
// set up the page
$page = new $pageClassName ();
require_once 'include/verifyLogin.php';
$HEAD = $page->GetHead($TITLE);
// show the page
if (@ file_exists('custompages/headerPart.php'))
require_once 'custompages/headerPart.php';
else
require_once 'pages/headerPart.php';
if (@ file_exists('custompages/headerMenu.php'))
require_once 'custompages/headerMenu.php';
else
require_once 'pages/headerMenu.php';
$page->ShowBody();
unset ($page);
if (@ file_exists('custompages/footerPart.php'))
require_once 'custompages/footerPart.php';
else
require_once 'pages/footerPart.php';
echo $DEBUG_INFO;