//ini_set('display_errors', 1);
//ini_set('display_startup_errors', 1);
//error_reporting(E_ALL);
//ini_set('allow_url_fopen', 1);
//session_start();
require_once("../inc/shared_tourism_inc/incs.php");
$thefolder = $hostfolder;
$thepage = strtolower($thepage);
//if($thepage=="") $thepage = "home";
//echo($thepage);
#Get page content =========================
$getcontent = pagecontent::getPHPPage($thepage.".php");
#Get main template =========================
$thetempl = "main_";
//if(trim($_SESSION["pagetemplate"])!="") $thetempl = $_SESSION["pagetemplate"];
if(trim($pagetemplate)!="") $thetempl = $pagetemplate;
$template = pagecontent::getTemplate($thetempl.$lang);
$template = str_replace("||fkey||",$fkey,$template);
$thetempl = "main_";
#Get other templates =========================
$topmenu = pagecontent::getPHPPage($rootfolder."/templates/".$publicfolder."/layout/".$thetempl."menu_".$lang.".php");
$getfooter = pagecontent::getPHPPage($rootfolder."/templates/".$publicfolder."/layout/".$thetempl."footer_".$lang.".php");
$topcontent = pagecontent::getPHPPage($rootfolder."/templates/".$publicfolder."/layout/".$thetempl."top_".$lang.".php");
if(substr_count($getcontent,"")>0){
$splitit = explode("",$getcontent);
$headers = $splitit[0];
$maincontent = $splitit[1];
}else{
$headers = '
'.chr(10);
$headers .= ''.chr(10);
$headers .= ''.chr(10);
$maincontent = $getcontent;
}
# if backto page has been stated - insert pagelinks --------------------------------
if($backto!=""){
$intpagelinks = pagecontent::getPHPPage($rootfolder."/templates/".$publicfolder."/layout/main_page_intlinks_".$lang.".php");
$maincontent = $intpagelinks.$maincontent;
}
//$template = str_replace("||pimg||",$_SESSION["pimg"],$template);
$_SESSION["pagetemplate"] = "";
$_SESSION["pimg"] = "";
$_SESSION["backto"] = "";
$_SESSION["saveto"] = "";
$_SESSION["mapcoord"] = "";
$_SESSION["mapaddress"] = "";
$_SESSION["menupage"] = "";
$_SESSION["body"] = "";
# Set login info =============================================
// if($_SESSION["userlogged"]==true) $logininfo = "Du är inloggad som ".$_SESSION["username"]."";
# Get bannercontent ==============================================
$btype = "right";
$banners_right = pagecontent::getPHPPage($rootfolder."/inc/".$publicfolder."/banners.php");
$btype = "content";
$banners_content = pagecontent::getPHPPage($rootfolder."/inc/".$publicfolder."/banners.php");
$btype = "contentright";
$banners_contentright = pagecontent::getPHPPage($rootfolder."/inc/".$publicfolder."/banners.php");
//$banners_contentright = '
';
$banners_contentright = ''.t("Annonser",$lang).''.$banners_contentright.' | ';
# Change template with fetched content =========================
$template = str_replace("||headers||",$headers,$template);
// $template = str_replace("||logininfo||",$logininfo,$template);
$template = str_replace("||topcontent||",$topcontent,$template);
$template = str_replace("||topmenu||",$topmenu,$template);
$template = str_replace("||maincontent||",$maincontent,$template);
$template = str_replace("||footer||",$getfooter,$template);
$template = str_replace("||banners_right||",$banners_right,$template);
$template = str_replace("||banners_content||",$banners_content,$template);
$template = str_replace("||banners_contentright||",$banners_contentright,$template);
$template = str_replace("||body||",$body,$template);
$template = str_replace('”','"',$template);
$template = str_replace('