\n
\nplease do contact your webmaster and report this error\n"; // Snelheid bijhouden $stimer = explode(' ', microtime()); $stimer = $stimer[1] + $stimer[0]; // Instellingen en functies laden (anders stoppen) $config_files = array('config.php', 'dbconnect.php', 'functions.php', 'loginf.php', 'forumf.php', 'forms.php', 'errors.php', 'xml.php'); foreach ($config_files as $filename) { // Controleer of het bestand aanwezig is (en anders stoppen met uitvoeren) if (!file_exists($filename)) die(fatal_error("file $filename was not found in the root of your site")); require_once(require_c($filename)); } // Emailadres webmaster invullen mits bekend if (isset($email_webmaster)) $basic_file_error = str_replace('webmaster', "webmaster", $basic_file_error); // Pagina verwerken if (!isset($execute_filename) && !isset($layout_filename) && !isset($settings_filename)) { // Indexpagina laden if (isset($default_frontpage)) { // Instellingen uit de config.php $execute_filename = $default_frontpage['execute_filename']; $layout_filename = $default_frontpage['layout_filename']; } else { // Defaults (niet aanpassen s.v.p.) $execute_filename = 'default.php'; $layout_filename = 'index.php'; } } else { // Ontbreken van variabelen afvangen if (!isset($execute_filename)) { die(fatal_error('variable $execute_filename was not found in this page')); } elseif (!isset($layout_filename)) { die(fatal_error('variable $layout_filename was not found in this page')); } } // Pagina en layout testen $data_and_layout = array('data_file' => $execute_folder . $execute_filename, 'layout_setup' => $layout_folder . $layout_setup_filename, 'layout_popup' => $layout_folder . $layout_popup_filename, 'layout_page' => $layout_folder . $layout_filename); foreach ($data_and_layout as $filename) { if (!is_file($filename)) die(fatal_error("file $filename is not present or invalid")); } // Spatiefilter actief, pagina en layout toevoegen ob_start('callback'); $this_page = array(); require_once(require_c($data_and_layout['data_file'])); if (!isset($this_page['use_popup_layout'])) $this_page['use_popup_layout'] = false; if ($this_page['use_popup_layout'] == false) { require_once(require_c($data_and_layout['layout_setup'])); } else { require_once(require_c($data_and_layout['layout_popup'])); } // Buffer vrijgeven en verbinding met database sluiten ob_end_flush(); mysql_close(); // Sessie opslaan of verwijderen if (isset($user['login']['username'])) $_SESSION['username'] = $user['login']['username']; if (!isset($user['login']['username'])) unset($_SESSION['username']); function callback($buffer) { // Tijd bijhouden global $query_count; global $require_count; global $stimer; // Onnodige spaties verwijderen $buffer = str_replace(array("\t", '
'), array(' ', '
'), $buffer); $buffer = implode("\n", array_map('trim', explode("\n", $buffer))); // Tijd van verwerken uitrekenen $etimer = explode(' ', microtime()); $etimer = $etimer[1] + $etimer[0]; $buffer = fill_with_key(array('processingtime' => round($etimer - $stimer, 3), 'requiredfiles' => $require_count, 'queries' => $query_count), $buffer, '%', '%'); // Vrijgeven return $buffer; } function fill_with_key($array, $string, $before = '%', $after = '%') { // Voorbereiden ($final mag veranderen) $final = $string; reset($array); // Alle elementen if (!is_array($array)) echo $array; while (list($key, $value) = each($array)) { // Zoeken $find = $before . $key . $after; $final = str_replace($find, $value, $final); } // Resultaat return $final; } function require_c($filename) { // Tellen $GLOBALS['require_count'] ++; return $filename; } function fatal_error($msg) { // Standaardfoutmelding opvragen while (@ob_end_clean()); global $basic_file_error; // Bij ban geen webmaster-adres geven if (isset($GLOBALS['user'])) { global $user; if ($user['ban'] == 2) $basic_file_error = ''; } if (isset($GLOBALS['fatal_error_file'])) { // Foutmeldingspagina tonen global $fatal_error_file; if (is_file($fatal_error_file)) { // Bestand openen en foutmelding weergeven $fp = fopen($fatal_error_file, 'r'); $error_html = fread($fp, filesize($fatal_error_file)); fclose($fp); // Stop teruggeven return callback(fill_with_key(array('err' => $msg), $error_html, '%', '%')); } else { // Foutmeldingen bestand is niet geldig return callback("
\n$msg
\n
\n (next to that the "fatal error file" $fatal_error_file is unavailable, yet is was configured to be present in this path, please do check your config.php on errors)
\n
\n
\n $basic_file_error"); } } else { // Simpele stop weergeven return callback("
\n$msg
\n
\n $basic_file_error"); } } ?>