Location: PHPKode > projects > Particle Blogger > particle-blogger/includes/global.php
<?php
// global.php global include file
error_reporting(E_ERROR | E_WARNING | E_PARSE);

// include the basic files
include("constants.php");
include("functions.php");
include("database.php");
require("config.php");
include("usersys.php");
include("blog.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");
	}
}

// set up global variables
$_GLOBALS["dbprefix"] = $dbprefix;

// 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->loop());
}

// add extra config values
$config["dbprefix"] = $dbprefix;
$config["lastvisit"] = (time() - (60 * 60));
$errormsg = "";

// work out what skin to use
$_GLOBALS["skin"] = $config["defaultskin"];

// initialise user system
$usr = new UserSys;
StartSession();
?>
Return current item: Particle Blogger