$_SERVER['HTTP_ACCEPT_ENCODING'] = isset($_SERVER['HTTP_ACCEPT_ENCODING']) ? $_SERVER['HTTP_ACCEPT_ENCODING'] : ''; // Should we use gzip output compression? if ($forum_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(); } } // Define standard date/time formats $forum_time_formats = array($forum_config['o_time_format'], 'H:i:s', 'H:i', 'g:i:s a', 'g:i a'); $forum_date_formats = array($forum_config['o_date_format'], 'Y-m-d', 'Y-d-m', 'd-m-Y', 'm-d-Y', 'M j Y', 'jS M Y'); // Create forum_page array $forum_page = array(); // Login and fetch user info $forum_user = array(); cookie_login($forum_user); // Attempt to load the common language file if (file_exists(FORUM_ROOT . 'lang/' . $forum_user['language'] . '/common.php')) { include FORUM_ROOT . 'lang/' . $forum_user['language'] . '/common.php'; } else { error('There is no valid language pack \'' . forum_htmlencode($forum_user['language']) . '\' installed.<br />Please reinstall a language of that name.'); } // Setup the URL rewriting scheme if ($forum_config['o_sef'] != 'Default' && file_exists(FORUM_ROOT . 'include/url/' . $forum_config['o_sef'] . '/forum_urls.php')) { require FORUM_ROOT . 'include/url/' . $forum_config['o_sef'] . '/forum_urls.php'; } else { require FORUM_ROOT . 'include/url/Default/forum_urls.php'; } // A good place to modify the URL scheme ($hook = get_hook('co_modify_url_scheme')) ? eval($hook) : null; // Check if we are to display a maintenance message
function parse() { if (isset($_SESSION['db_data']) || $_GET['action'] == 'resetpass' || $_GET['action'] == 'changemail' || $_GET['action'] == 'resetpassmail') { return get_parser(); } if (isset($_POST['usr_email'])) { return user_login(myfilter($_POST['usr_email'], 'user'), myfilter($_POST['password'], 'password'), myfilter($_POST['remember_me'], 'bool')); } if (isset($_COOKIE['cookie']['user']) && isset($_COOKIE['cookie']['pass'])) { return cookie_login(myfilter($_COOKIE['cookie']['user'], '_id'), myfilter($_COOKIE['cookie']['pass'], 'password')); } if (isset($_GET['action'])) { $_SESSION['get'] = $_GET; } return echo_front_page(); }