<?php
/*========================================================*\
||########################################################||
||# #||
||# WB News v1.0.0 #||
||# ---------------------------------------------------- #||
||# Copyright (c) 2004-2005 #||
||# Created: 1st August 2005 #||
||# Filename: global.php #||
||# #||
||########################################################||
/*========================================================*/
/**
* @author $Author: pmcilwaine $
* @version $Id: global.php,v 1.2.2.3 2008/06/21 02:30:54 pmcilwaine Exp $
*/
define( "DEBUG", FALSE );
error_reporting( DEBUG ? E_ALL : ini_get("error_reporting") );
/** enable short tags e.g. <?= ?> **/
if ( !ini_get( "short_open_tag" ) )
{
ini_set( "short_open_tag", 1 );
}
/** we using AJAX **/
define( "USE_AJAX", isset($_GET["ajax"]) && $_GET["ajax"] == 1 );
$path = isset($path) ? $path : "../";
require_once( $path . "config.php" );
require_once( $config["installdir"] . "/includes/constants.php" );
require_once( INCDIR . "/common.php" );
require_once( LIBDIR . "/db/" . $config["dbserver"] . "/DB_Sql.php" );
require_once( LIBDIR . "/DBase.php" );
require_once( LIBDIR . "/TemplateEngine.php" );
require_once( LIBDIR . "/PageTemplateEngine.php" );
$DB =& new DBase( $config["dbhost"], $config["dbuser"], $config["dbpass"], $config["dbname"], $config["dbport"] );
$tmpl =& new TemplateEngine();
$tmpl->SetOutput( FALSE );
if ( headers_sent( $file, $line ) )
{
?>
<div style="width: 70%;margin-left: 15%;border: 2px solid #DA0000;padding: 10px;background: #FDFD31;">
<h1 style="padding: 0px;margin: 0px;">Error Occurred</h1>
<p style="margin-bottom: 5px;">
A server error has occurred on line <?= $line ?> in <?= $file ?>. An email has
been dispatched to the webmaster.
</p>
</div>
<?php
exit;
}
session_start();
$n_configs = $DB->ListBy( TBL_NEWSCONFIG, NULL, array( "var", "value" ) );
foreach ( $n_configs as $n_config )
{
$config[ $n_config["var"] ] = $n_config["value"];
}
$DB->query( "SELECT \"themepath\" FROM " . TBL_THEMES . " WHERE \"themeid\"='" . $config["themeid"] . "'" );
if ( !$DB->next_Record() )
{
exit;
}
$config["themepath"] = $DB->field( "themepath" );
/** get the userinfo + group **/
require_once( LIBDIR . "/Auth/Auth.php" );
require_once( INCDIR . "/function.php" );
require_once( INCDIR . "/admin-functions.php" );
$userinfo = array();
if ( isset($_COOKIE[WBNEWS_SESSION_NAME]) )
{
$userinfo = userinfo( $_COOKIE[WBNEWS_SESSION_NAME] );
}
/** setup auth variable **/
$auth = new Auth( $userinfo );
/** load basic theme variables **/
require_once( BuildPath( "admin/theme_info.php" ) );
/** Load Locale settings **/
require_once( INCDIR . "/locale/" . $config["locale"] . "/main.php" );
?>