<?php
/**********************************************************************************
* index.php *
***********************************************************************************
* SMF: Simple Machines Forum *
* Open-Source Project Inspired by Zef Hemel (zef@zefhemel.com) *
* =============================================================================== *
* Software Version: SMF 1.1.11 *
* Software by: Simple Machines (
http://www.simplemachines.org) *
* Copyright 2006-2009 by: Simple Machines LLC (
http://www.simplemachines.org) *
* 2001-2006 by: Lewis Media (
http://www.lewismedia.com) *
* Support, News, Updates at:
http://www.simplemachines.org *
***********************************************************************************
* This program is free software; you may redistribute it and/or modify it under *
* the terms of the provided license as published by Simple Machines LLC. *
* *
* This program is distributed in the hope that it is and will be useful, but *
* WITHOUT ANY WARRANTIES; without even any implied warranty of MERCHANTABILITY *
* or FITNESS FOR A PARTICULAR PURPOSE. *
* *
* See the "license.txt" file for details of the Simple Machines license. *
* The latest version can always be found at
http://www.simplemachines.org. *
**********************************************************************************/
/* This, as you have probably guessed, is the crux on which SMF functions.
Everything should start here, so all the setup and security is done
properly. The most interesting part of this file is the action array in
the smf_main() function. It is formatted as so:
'action-in-url' => array('Source-File.php', 'FunctionToCall'),
Then, you can access the FunctionToCall() function from Source-File.php
with the URL index.php?action=action-in-url. Relatively simple, no?
*/
$forum_version = 'SMF 1.1.11';
// Get everything started up...
define('SMF', 1);
@set_magic_quotes_runtime(0);
error_reporting(E_ALL);
$time_start = microtime();
// Make sure some things simply do not exist.
foreach (array('db_character_set') as $variable)
if (isset($GLOBALS[$variable]))
unset($GLOBALS[$variable]);
// Load the settings...
require_once(dirname(__FILE__) . '/Settings.php');
// And important includes.
require_once($sourcedir . './QueryString.php');
require_once($sourcedir . '/Subs.php');
require_once($sourcedir . '/Errors.php');
require_once($sourcedir . '/Load.php');
require_once($sourcedir . '/Security.php');
// Using an old version of PHP?
if (@version_compare(PHP_VERSION, '4.2.3') != 1)
require_once($sourcedir . '/Subs-Compat.php');
// If $maintenance is set specifically to 2, then we're upgrading or something.
if (!empty($maintenance) && $maintenance == 2)
db_fatal_error();