if (ini_get('register_globals')) { ini_set('register_globals', 0); } // URL constant $protocol = 'http://'; if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) { $protocol = 'https://'; } $url = $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']; $url = explode('/', $url); array_pop($url); if (defined('IS_RSS')) { array_pop($url); } $url = $protocol . implode('/', $url) . '/'; define('URL', $url); unset($url); // Initialize some needed classes ae_Timer::start('total'); ae_Log::init($logSettings); if (ae_Database::connect($dbSettings) === FALSE) { $path = 'themes/error-msg-db.php'; $path = file_exists($path) ? $path : '../' . $path; include $path; exit; } ae_Security::init($securitySettings); ae_Settings::load(); // Constants used in themes and the RSS feed define('THEME', ae_Settings::get('theme')); define('THEME_PATH', URL . 'themes/' . THEME . '/');