session_start();
include 'config.inc';
$_SESSION["cms_path"] = "/admin/"; //admin is dan de map waar je cms staat gezien vanaf de plaats waar de index staat.
//Function to get the right image path
function replaces($txt, $cms_path)
{
$find = "";
$page_content.= "Content Management Systeem: ©Erikjan Jeuring
";
$page_content.= "www.erikjanjeuring.nl
";
$page_content.= "
";
$page_content.= "
";
}
else if($menu_id == 120)
{
$page_title = "Contact";
$page_show_title = 1;
}
else if($menu_id == 121)
{
$page_title = "Gastenboek";
$page_show_title = 1;
}
else if($menu_id == 122)
{
$page_title = "Fotoalbum";
$page_show_title = 1;
}
else if($menu_id == 123)
{
$page_title = "Occasions";
$page_show_title = 1;
}
else{
if($q_pages = mysql_query("SELECT * FROM pages WHERE menu_item_id = $menu_id AND page_active = 1"))
{
if(mysql_num_rows($q_pages) == 1)
{
$a_pages = mysql_fetch_array($q_pages);
$page_id = $a_pages["page_id"];
$page_title = stripslashes($a_pages["page_title"]);
$page_content = nl2br(stripslashes($a_pages["page_content"]));
$page_show_title = $a_pages["page_show_title"];
//Increase the number of views
$page_viewed = $a_pages["page_viewed"] + 1;
mysql_query("UPDATE pages SET page_viewed = $page_viewed WHERE page_id = $page_id");
}else if(mysql_num_rows($q_pages) > 1){
$page_content = "";
$page_content.= "
";
while($a_pages = mysql_fetch_array($q_pages))
{
$page_id = $a_pages["page_id"];
$page_title = stripslashes($a_pages["page_title"]);
$page_content = $page_content . "- ".$page_title."
";
}
$page_content.= "
";
}else
{
//No page found
$page_content = "Geen pagina gevonden";
}
}else
{
//Query mislukt
$page_content = "De pagina's konden niet worden opgehaald";
}
}
}else
{
if(isset($_GET["page_id"]))
{
$page_id = intval($_GET["page_id"]);
}else
{
$page_id = 1; // als er geen page id verzonden is in de url
}
if($q_pages = mysql_query("SELECT * FROM pages WHERE page_id = $page_id AND page_active = 1"))
{
if(mysql_num_rows($q_pages) == 1)
{
$a_pages = mysql_fetch_array($q_pages);
$page_id = $a_pages["page_id"];
$page_title = stripslashes($a_pages["page_title"]);
$page_content = nl2br(stripslashes($a_pages["page_content"]));
$page_show_title = $a_pages["page_show_title"];
//Increase the number of views
$page_viewed = $a_pages["page_viewed"] + 1;
mysql_query("UPDATE pages SET page_viewed = $page_viewed WHERE page_id = $page_id");
replaces($page_content, $_SESSION["cms_path"]); //hier wordt de replaces functie gebruikt om de paden naar images enzo te veranderen
}else
{
//No page found
$page_content = "Geen pagina gevonden";
}
}else
{
//Query mislukt
$page_content = "De pagina's konden niet worden opgehaald";
}
}
$page_content = replaces($page_content, $_SESSION["cms_path"]); //hier wordt de replaces functie gebruikt om de paden naar images enzo te veranderen
include 'template/index4.php';
?>