PUN_ADMIN && !defined('PUN_TURN_OFF_MAINT')) maintenance_message(); // Setup the URL rewriting scheme if (file_exists(PUN_ROOT.'include/url/'.$pun_config['o_sef'].'.php')) require PUN_ROOT.'include/url/'.$pun_config['o_sef'].'.php'; else require PUN_ROOT.'include/url/Default.php'; // Load cached updates info if ($pun_user['g_id'] == PUN_ADMIN) { if (file_exists(PUN_CACHE_DIR.'cache_updates.php')) include PUN_CACHE_DIR.'cache_updates.php'; // Regenerate cache only if automatic updates are enabled and if the cache is more than 12 hours old if ($pun_config['o_check_for_updates'] == '1' && (!defined('PUN_UPDATES_LOADED') || $pun_updates['cached'] < (time() - 43200))) { require_once PUN_ROOT.'include/cache.php'; generate_updates_cache(); require PUN_CACHE_DIR.'cache_updates.php'; } } // Load cached bans if (file_exists(PUN_CACHE_DIR.'cache_bans.php')) include PUN_CACHE_DIR.'cache_bans.php'; if (!defined('PUN_BANS_LOADED')) { require_once PUN_ROOT.'include/cache.php'; generate_bans_cache(); require PUN_CACHE_DIR.'cache_bans.php'; } // Check if current user is banned check_bans(); // Update online list update_users_online(); // Check to see if we logged in without a cookie being set if ($pun_user['is_guest'] && isset($_GET['login'])) message($lang_common['No cookie']); // If we're an administrator or moderator, make sure the CSRF token in $_POST is valid (token in post.php is dealt with in post.php) if (!empty($_POST) && $pun_user['is_admmod'] && (isset($_POST['confirm_cancel']) || (!isset($_POST['csrf_token']) || $_POST['csrf_token'] !== generate_form_token(get_current_url()))) && basename($_SERVER['PHP_SELF']) != 'post.php') csrf_confirm_form(); // A good place to add common functions for your extension ($hook = get_hook('co_common')) ? eval($hook) : null; if (!defined('PUN_MAX_POSTSIZE')) define('PUN_MAX_POSTSIZE', 65535);