" . $lang['db_connect']. ""); $success = mysql_select_db ($database); if (!$success) { die ("" . $lang['db_choose']. ""); } } // filter_input only for php >= 5.2 if (function_exists('filter_input')) { $get = filter_input(INPUT_GET,"cnt", FILTER_SANITIZE_URL); } else { $get = htmlspecialchars($_GET['cnt']); } $get = strtr($get,"~!@#$%^&*()","xxxxxxxxxxx"); $get = htmlentities(strip_tags($get)); $get = trim($get, " /\\"); if ($get == '') {$get = '';} // get page info if ($use_db) { $page = mysql_fetch_array(mysql_query("select * from `pages` where `url` = '$get' and `stat` = 1 limit 1")); if (!$page) exit; // get template list($template) = mysql_fetch_array(mysql_query("select `template` from `templates` where `id` = '".$page['template_id']."' limit 1")); $template = str_replace("[[__title__]]", $page['title'], $template); $template = str_replace("[[__metads__]]", $page['meta_description'], $template); $template = str_replace("[[__metakw__]]", $page['meta_keywords'], $template); $template = str_replace("[[__menu__]]", $page['menu'], $template); $template = str_replace("[[__content__]]", $page['content'], $template); } else { // get pages file if (!file_exists("pages.csv")) exit; $pages = array(); $fp = fopen('pages.csv', "r"); while (($data = fgetcsv($fp, 1000, ";")) !== FALSE) { $pages[$data[1]] = array(); $pages[$data[1]]['template_id'] = $data[2]; $pages[$data[1]]['title'] = $data[3]; $pages[$data[1]]['meta_keywords'] = $data[4]; $pages[$data[1]]['meta_description'] = $data[5]; $pages[$data[1]]['meta_robots'] = $data[6]; $pages[$data[1]]['meta_organisation'] = $data[7]; $pages[$data[1]]['meta_author'] = $data[8]; $pages[$data[1]]['meta_publisher'] = $data[9]; $pages[$data[1]]['meta_copyright'] = $data[10]; $pages[$data[1]]['meta_language'] = $data[11]; $pages[$data[1]]['stat'] = $data[12]; } fclose($fp); if (!$pages[$get]['stat']) exit; $template_id = $pages[$get]['template_id']; if (!$template_id) exit; $template = @file_get_contents("templates/$template_id.htm"); if (!$template) exit; $template = str_replace("[[__title__]]", $pages[$get]['title'], $template); $template = str_replace("[[__metads__]]", $pages[$get]['meta_description'], $template); $template = str_replace("[[__metakw__]]", $pages[$get]['meta_keywords'], $template); $template = str_replace("[[__metarb__]]", $pages[$get]['meta_robots'], $template); $template = str_replace("[[__metaor__]]", $pages[$get]['meta_organisation'], $template); $template = str_replace("[[__metaau__]]", $pages[$get]['meta_author'], $template); $template = str_replace("[[__metapb__]]", $pages[$get]['meta_publisher'], $template); $template = str_replace("[[__metacp__]]", $pages[$get]['meta_copyright'], $template); $template = str_replace("[[__metalg__]]", $pages[$get]['meta_language'], $template); $template = str_replace("[[__content__]]", file_get_contents("cnt/".$get.".txt"), $template); // welcome text if ($get == '') { $welcome = "

Welkom bij Via Stoa

Via dit portaal kunt u nagenoeg alle deskundigen bereiken op het vlak van Arbeid en Gezondheid: verzuim, arbo-beleid, arbeidsomstandigheden en arbeidsgeneeskundige expertise.

"; } else { $welcome = ''; } $template = str_replace("[[__welcome__]]", $welcome, $template); // bottom button if ($get == 'no_ron_god') { $bot_but_text = '

GA NAAR SITE

'; $bot_but_image = '

...

'; } else { $bot_but_image = ''; $bot_but_text = ''; } $template = str_replace("[[__bot_but_image__]]", $bot_but_image, $template); $template = str_replace("[[__bot_but_text__]]", $bot_but_text, $template); } echo($template); ?>