<?php
/***************************************************************************
common.php - common includes. initiates object etc
-------------------
begin : May 24, 2002
copyright : (C) 2002 by Harm Kolk & Onno de Jong
email : hide@address.com
: hide@address.com
$Id: common.php,v 1.21 2002/06/12 14:17:56 lyon Exp $
This file is part of the myCts project, specifically it belongs to
the website.
***************************************************************************/
/***************************************************************************
* *
* 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. *
* *
***************************************************************************/
$dir = dirname(__FILE__) . '/';
define('INCLUDE_DIR', $dir);
define('INC_COMMON', TRUE);
$mtime = microtime();
$mtime = explode(' ',$mtime);
$mtime = $mtime[1] + $mtime[0];
$starttime = $mtime;
/* ripped from phpBB2, we be evol :) */
function slash_input_data(&$data)
{
if ( is_array($data) )
{
while( list($k, $v) = each($data) )
{
$data[$k] = ( is_array($v) ) ? slash_input_data($v) : addslashes($v);
}
@reset($data);
}
return $data;
}
if ( !get_magic_quotes_gpc() )
{
$HTTP_GET_VARS = slash_input_data($HTTP_GET_VARS);
$HTTP_POST_VARS = slash_input_data($HTTP_POST_VARS);
$HTTP_COOKIE_VARS = slash_input_data($HTTP_COOKIE_VARS);
}
require_once (INCLUDE_DIR . 'config.php');
require_once (INCLUDE_DIR . 'defines.php');
session_start();
/* buffer output */
ob_start();
/* get the template class and initiate it. */
/* tell the damn machine we run in debug mode ( prints nice errors and all ) */
if(!defined('DEBUG_ENV'))
{
define ('DEBUG_ENV', false);
}
require_once (INCLUDE_DIR . 'functions.php');
require_once (INCLUDE_DIR . 'database.php');
require_once (INCLUDE_DIR . 'auth.php');
require_once (INCLUDE_DIR . 'template.php');
$template = new Template(INCLUDE_DIR . '../templates/');
/* this be temporary for correct template development */
include (INCLUDE_DIR . 'language.php');
require_once (INCLUDE_DIR . '../languages/english.lng.php');
$language = get_languagepack();
if(!$language)
{
$language = 'english';
}
else
{
require_once (INCLUDE_DIR . '../languages/' .$language . '.lng.php');
}
$query = "select * from config";
$result = $db->query($query);
$config_array = array();
while($row = $result->fetchRow())
{
$config_array[$row['key']] = $row['value'];
}
require_once (INCLUDE_DIR . 'header.php');
?>