gebeurt al via init.php in dbconnect.php // $db = Database::getInstance(); $mysqli = $db->getConnection(); if(!$db_ok) die("DB connect failed"); // activeer ssl/https (voordat een sessie wordt aangeroepen!) Also set .htaccess if (isset($_SERVER["HTTP_X_FORWARDED_PROTO"] ) && "https" == $_SERVER["HTTP_X_FORWARDED_PROTO"] ) { $_SERVER["HTTPS"] = "on"; } // set taal voor datumnotatie setlocale(LC_ALL, 'nl_NL'); if($_GET['debug']) $_SESSION['debug'] = true; if(!$_SESSION['debug'] AND isset($GLOBALS['system_settings']['offline'])) { die("
".$GLOBALS['system_settings']['offline']." bekijk de preview
"); } // fetch page if (isset($_GET['id']) && is_numeric($_GET['id'])) { $page = mysqli_fetch_assoc($mysqli->query(" SELECT * FROM vena_page WHERE pageID = ".$_GET['id']." AND status = \"ACTIVE\" ")); // echo " pagina met ID ".$page['pageID']." is opgehaald"; } else { $page = get_homepage(); } // fetch text if($page['pageID']) $pagetext = mysqli_fetch_assoc($mysqli->query(" SELECT * FROM vena_pagetext WHERE pageID = ".$page['pageID']." AND lang = \"$_SESSION[lang]\" ")); if(!$pagetext['menutitle']) { if($page['parentID'] > 0) { header("Location: index.php?id=".$page['parentID']); exit; } else { $home = get_homepage(); if($home['pageID'] != $page['pageID']) { header("Location: index.php?id=".$home['pageID']); exit; } } } // fetch template or url if(!$GLOBALS['system_settings']['allow_multitemplate']) $page['template'] = ""; $templatefile = getfilename($page['template'], "template"); if(!$templatefile) die("missing default template"); $template = file_get_contents($templatefile); if($page['url']) { header("Location: ".$page['url']); exit; } // GET SPECIAL CONTENT if($page['special_content']) { $fn = getfilename($page['special_content'], "fixedcontent"); $p = strrpos($fn,"."); $ext = substr($fn,$p+1); switch($ext) { CASE "htm": CASE "html": $sc = file_get_contents($fn); break; CASE "php": ob_start(); // $fn = $fn."?pageID=".$page[pageID]; $fn = $fn; include($fn); $sc = ob_get_clean(); break; } if($sc) $pagetext['content'].= $sc; } /* // AGENDA $agenda = ("
\"Programma\" "); $res = $mysqli->query(" SELECT vena_agenda.*, vena_agenda_text.* FROM vena_agenda LEFT JOIN vena_agenda_text ON vena_agenda.ID = vena_agenda_text.agenda_ID AND lang = \"$_SESSION[lang]\" WHERE (vena_agenda.startdate >= CURDATE() OR vena_agenda.enddate >= CURDATE()) AND vena_agenda.status = \"ACTIVE\" ORDER BY vena_agenda.startdate ASC "); if(mysqli_num_rows($res) != 0) { while($row = mysql_fetch_assoc($res)) { $zelfdedatum = (date("j F",date2time($row[startdate])) == date("j F",date2time($row[enddate])))? "1" : "0"; $zelfdemaand = (date("F",date2time($row[startdate])) == date("F",date2time($row[enddate])))? "1" : "0"; $startdate = nldate("l j F H:i",date2time($row[startdate])); $date1 = $startdate." uur"; if($row[enddate] != "0000-00-00 00:00:00") { $enddate = nldate("l j F H:i",date2time($row[enddate])); $date2 = ($zelfdedatum == 0)? " t/m ".$enddate." uur" : " t/m ".date("H:i",date2time($row[enddate]))." uur"; } else { $date2 = ""; } // $shortstartdate = nldate("j",date2time($row[startdate])); $shortenddate = nldate("j F",date2time($row[enddate])); $shortdate1 = ($zelfdemaand == 0)? nldate("j F",date2time($row[startdate])) : nldate("j",date2time($row[startdate])); $shortdate2 = ($zelfdedatum == 0)? " t/m ".$shortenddate : " ".nldate("F",date2time($row[enddate])); // en lijst items tonen $agenda .= ("

$date1$date2

".$row[title]."

$row[text]
"); } // end while } else { $agenda .= ("

Momenteel niets op het programma.

"); } $agenda .= ("
"); // ARTIKELEN FRONTPAGE // Bepaal ID van de nieuwspagina list($artikelpage) = mysqli_fetch_row($mysqli->query("SELECT pageID FROM vena_page WHERE special_content = \"nieuws\"")); $sql1 = $mysqli->query(" SELECT * FROM vena_news LEFT JOIN vena_news_text ON vena_news.artikelID = vena_news_text.artikelID AND lang = \"$_SESSION[lang]\" WHERE status = \"ACTIVE\" ORDER BY datum DESC LIMIT 3 "); $first = true; $link = "index.php?id=".$artikelpage."&artikel="; while($row = mysqli_fetch_assoc($sql1)) { // get default image artikel $sql = "SELECT imageID FROM vena_images WHERE artikel_ID = $row[artikelID]"; $imageID = mysql_result($mysqli->query($sql), 0, 0); // display thumb if available if ($imageID > 0) { $defimage =""; } else { $defimage = ""; } if($first) $first = false; else $items.= ""; $txt = html_find_breakpos(strip_tags($row[text]),140)." ..."; if($_SESSION[lang] == "NL") { $dt = nldate("l j F 'y",date2time($row[datum])); $meer = "meer"; } else { $dt = date("l j F 'y",date2time($row[datum])); $meer = "more"; } $nieuws.= "

$row[titel]

$txt$meer »


"; } // end while */ /* // SELECTLIST YEARS ARCHIEF // Bepaal ID van de nieuwspagina list($newspage) = mysqli_fetch_row($mysqli->query("SELECT pageID FROM vena_page WHERE special_content = \"nieuws\"")); // jaar bepalen voor nieuwsarchief if (is_numeric($_GET['jaar'])) { if (strlen($_GET['jaar'])==4 && $_GET['jaar']>1970) { $year = $_GET['jaar']; } } else { $year = date('Y'); } // maak begin url voor links $link = "index.php?id=".$artikelpage."&jaar="; if($_SESSION['lang'] == "NL") {$l_jaar = "Jaar: ";} if($_SESSION['lang'] == "EN") {$l_jaar = "Year: ";} // toon div met selectbox archiefjaren alleen als deze pagina = newspage if ($page['pageID'] == $newspage) { $archief = "
ARCHIEF JAAR:
"; } else { $archief = ""; } */ // BACKGROUNDS FOR CAROUSEL $backgrounds = ("
JavaScript Scroller
"); /* // BREADCRUMBS if($page[parentID] > 0) { $crumbs = build_breadcrumbs($page[pageID]); $breadcrumbs = "$crumbs"; } else { $breadcrumbs = ""; } */ // HIGHLIGHT WORDS IN CONTENT IF PAGE IS LOADED WITH ZOEKTERM if(isset($_GET['zoekterm'])) { $zoekterm = $_GET[zoekterm]; // get zoekterm $words = explode(" ", $zoekterm); $pagetext[content] = highlightWords($pagetext[content], $words); } // PAGE URL $pageURL = $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://'; $pageURL .= $_SERVER['SERVER_PORT'] != '80' ? $_SERVER['SERVER_NAME'].":".$_SERVER['SERVER_PORT'].$_SERVER['REQUEST_URI'] : $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; $search = array("%backgrounds%","%pageURL%","%googletitle%","%menutitle%","%title%","%content%", "%content2%", "%menu%","%keywords%","%description%","%languageswitch%","%nieuws%","%agenda%","%archief%","%breadcrumbs%"); $replace = array( $backgrounds, // %backgrounds% $pageURL, // %pageURL% $pagetext['googletitle'], // %googletitle% $pagetext['menutitle'], // %menutitle% $pagetext['title'], // %title% $pagetext['content'], // %content% $pagetext['content2'], // %content2% build_menu($page['pageID']), // %menu% $pagetext['meta_keywords'], // %keywords% $pagetext['meta_description'], // %description% build_languageswitch($page['pageID']), // %languageswitch% $nieuws, // %nieuws% $agenda, // %agenda% $archief, // %archief% $breadcrumbs, // %breadcrumbs% $page['background'] // %background% = set default in MySQL table vena_page ); echo(str_replace($search,$replace,$template)); ?>