<?php
// global.php global include file
error_reporting(E_ERROR | E_WARNING | E_PARSE);
//error_reporting(E_ALL);
// include the basic files
include("functions.php");
include("database.php");
require("config.php");
include("usersys.php");
// database setup
if ($dbname == ""){
redirect("install/install.php");
} else {
$db = New Database($dbhost, $dbuser, $dbpass, $dbname);
if ($db->execute("SELECT * FROM " . $dbprefix . "config", false, false) === false){
redirect("install/install.php");
}
}
// extract configuration from db
$site_config = Array();
$sql = "SELECT * FROM " . $dbprefix . "config";
$result = $db->execute($sql);
if ( !($result = $db->execute($sql)) )
{ Die("Could not query config table");
} else {
do{
// put config into array
$config[$result->fields["config_name"]] = $result->fields["config_value"];
} while($result->fields = mysql_fetch_array($result->res));
}
// add extra information
$_GLOBALS["skin"] = $config["defaultskin"];
$errormsg = "";
// initialise classes
$usr = new UserSys;
// start the session
StartSession();
?>