Location: PHPKode > projects > vuBB Community Forums > includes/vubb.php
<?php
/**
 * vuBB
 * Copyright 2005-2006 the vuBB Group
 *
 * http://www.vubb.com/
 * http://community.vubb.com/
 */

if (!defined('ROOT'))
{
	define('ROOT', './');
}

// Version ID.
$vubb['version'] = '[Bugfix A]';
$vubb['copy_year'] = '2005-2006';

// Start the session!
session_start();

// Get the config
include(ROOT.'config.php');

// Get the functions
include(ROOT.'includes/functions.php'); // Include right here, so we can forward if need be.

// Get the settings
include(ROOT.'includes/settings.php');

// Are we wanting the portal when it is off?
if (isset($_GET['act']) && $_GET['act'] == 'portal' && !$portal_config['on'])
{
	header('Location: '.makeurl('index'));
	exit;
}

// Strip all no alphanumeric characters (less - and _) from the module string.
$act = isset($_GET['act']) ? ereg_replace("[^a-z,0-9,_,A-Z,-]", '', $_GET['act']) : 'forum';

// Module.
if (isset($_GET['act']) && file_exists('./modules/'.$act.'.php'))
{
	// Do nothing! We are set!
}
else if (!isset($_GET['act'])) 
{
	// What is the default module?
	if ($portal_config['as_default'] && file_exists('./modules/portal.php'))
	{
		$act = 'portal';
	}
	else
	{
		$act = 'forum';
	}
}
else
{
	header('Location: '.makeurl('index'));
	exit;
}
$vubb_module = ROOT.'modules/' . $act . '.php';
?>
Return current item: vuBB Community Forums