diff -r e3d7322305bf -r 5e1f1e916419 punbb/include/common.php --- a/punbb/include/common.php Sun Sep 02 11:00:57 2007 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,163 +0,0 @@ -install.php to install PunBB first.'); - -// Record the start time (will be used to calculate the generation time for the page) - -function get_microtime() -{ - list($usec, $sec) = explode(' ', microtime()); - return ((float)$usec + (float)$sec); -} - -$pun_start = get_microtime(); - -// Make sure PHP reports all errors except E_NOTICE. PunBB supports E_ALL, but a lot of scripts it may interact with, do not. -error_reporting(E_ALL); - -// Turn off magic_quotes_runtime -set_magic_quotes_runtime(0); - -/* -Disabled for Enano - this is already done by Enano's API -// Strip slashes from GET/POST/COOKIE (if magic_quotes_gpc is enabled) -if (get_magic_quotes_gpc()) -{ - function stripslashes_array($array) - { - return is_array($array) ? array_map('stripslashes_array', $array) : stripslashes($array); - } - - $_GET = stripslashes_array($_GET); - $_POST = stripslashes_array($_POST); - $_COOKIE = stripslashes_array($_COOKIE); -} -*/ - -// Seed the random number generator -mt_srand((double)microtime()*1000000); - -// If a cookie name is not specified in config.php, we use the default (punbb_cookie) -if (empty($cookie_name)) - $cookie_name = 'punbb_cookie'; - -// Define a few commonly used constants -define('PUN_UNVERIFIED', 32000); -define('PUN_ADMIN', USER_LEVEL_ADMIN); -define('PUN_MOD', USER_LEVEL_MOD); -define('PUN_GUEST', USER_LEVEL_GUEST); -define('PUN_MEMBER', USER_LEVEL_MEMBER); - -/* -Skip this - Enano's API will handle it -// Load DB abstraction layer and connect -require PUN_ROOT.'include/dblayer/common_db.php'; - -// Start a transaction -$pun_db->start_transaction(); -*/ - -$GLOBALS['pun_db'] = new PunBB_DBAL_Enano(); -$GLOBALS['pun_config'] = array(); - -$pun_config =& $GLOBALS['pun_config']; - -// Load cached config -@include PUN_ROOT.'cache/cache_config.php'; -if (!defined('PUN_CONFIG_LOADED')) -{ - require PUN_ROOT.'include/cache.php'; - generate_config_cache(); - require PUN_ROOT.'cache/cache_config.php'; -} - -// Enable output buffering -if (!defined('PUN_DISABLE_BUFFERING')) -{ - // For some very odd reason, "Norton Internet Security" unsets this - $_SERVER['HTTP_ACCEPT_ENCODING'] = isset($_SERVER['HTTP_ACCEPT_ENCODING']) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : ''; - - // Should we use gzip output compression? - if ($pun_config['o_gzip'] && extension_loaded('zlib') && (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false || strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate') !== false)) - ob_start('ob_gzhandler'); - else - ob_start(); -} - -// Check/update/set cookie and fetch user info -$GLOBALS['pun_user'] = array(); -$pun_user =& $GLOBALS['pun_user']; -check_cookie($pun_user); - -// Attempt to load the common language file -@include PUN_ROOT.'lang/'.$pun_user['language'].'/common.php'; -if (!isset($lang_common)) - exit('There is no valid language pack \''.pun_htmlspecialchars($pun_user['language']).'\' installed. Please reinstall a language of that name.'); - -// Check if we are to display a maintenance message -if ($pun_config['o_maintenance'] && $pun_user['g_id'] < PUN_ADMIN && !defined('PUN_TURN_OFF_MAINT')) - maintenance_message(); - - -// Load cached bans -/* -// // DISABLED IN ENANO // // -// Enano has its own ban list // -@include PUN_ROOT.'cache/cache_bans.php'; -if (!defined('PUN_BANS_LOADED')) -{ - require_once PUN_ROOT.'include/cache.php'; - generate_bans_cache(); - require PUN_ROOT.'cache/cache_bans.php'; -} - -// Check if current user is banned -check_bans(); -*/ - -// Update online list -update_users_online(); -