File: /var/www/vhosts/creativefellows.nl/dhwd.creativefellows.nl/index.php
<?php
/*
* Include config files
*/
$security_key = 'akz2TaXRfaZ4dAqEeugt';
require_once "includes/main.inc.php";
/*
* Read post
*/
$section = (isset($_GET["section"])) ? $_GET["section"] : "home";
$category = (isset($_GET["category"])) ? $cassette->dp($_GET["category"]) : null;
$sub_category = (isset($_GET["sub_category"])) ? $cassette->dp( $_GET["sub_category"] ) : null;
$nav_label = (isset($_GET["nav_label"])) ? $_GET["nav_label"] : null ;
$meta_title = (isset($_GET["meta_title"])) ? $cassette->dp( $_GET["meta_title"] ) : 0;
$post_name = (isset($_GET["name"])) ? $_GET["name"] : null;
$lang = (isset($_GET["lang"])) ? $_GET["lang"] : null;
/*
* create csrf token
*/
$_SESSION["csrf_token"] = md5(uniqid(mt_rand(), true));
/*
* Check if request is permalink
*/
if(isset($_GET["permalink"]) && $_GET["permalink"] == 1)
{
$category = $cassette->getEntryCategory($post_eid);
}
/*
* HTML title
*/
if($section == "home") $title = $client["html_title"];
elseif($post_name == null) $title = ucfirst($cassette->dp($meta_title))." - ".$client["html_title"];
else $title = ucfirst($cassette->dp($post_name))." | ".$client["html_title"];
/*
* Get entries
*/
$page = isset($_GET["p"]) ? $_GET["p"] : 1;
$e = $cassette->getEntries($section,null,$post_name,$page);
/*
* current section if used permalink
*/
if(isset($_REQUEST["permalink"]) && $_REQUEST["permalink"] == 1)
{
$section = $cassette->getInfo("secties","sectie_id",$e[0]->sectie_id,"naam");
}
/*
* redirect to other page
*/
if($e[0]->page_redirect){
header("HTTP/1.1 301 Moved Permanently");
header("Location: ".$e[0]->page_redirect);
}
/*
section info
*/
$sectionArr = $cassette->sectieInfo($section);
$cassette->pageStrm = isset($e) && $e[0]->stramien_id != 0 ? $e[0]->stramien_id : $sectionArr["stramien_id"];
$page_name = $cassette->getInfo("stramiens","stramien_id",$cassette->pageStrm,"naam");
/*
check if section exists
*/
if(empty($sectionArr) || count($e) == 0 && !in_array(strtolower($section),array("home")))
{
header('HTTP/1.1 404 Not Found');
$page_name = "404";
$title = $client[0]["html_title"];
}
/*
* Search
*/
if($section == "zoeken" || $section == "search")
{
$sectionArr["stramien_id"] = 0;
}
/*
* build pages
*/
require_once ROOT_DIR ."includes/header.inc.php";
if(file_exists(ROOT_DIR ."pages/page.". $page_name .".php")) include_once ROOT_DIR ."pages/page.". $page_name .".php" ;
else include_once ROOT_DIR . "pages/page.default.php";
include_once ROOT_DIR."includes/footer.inc.php";
?>