require 'admin/includes/connect.php';
$pageID = $_GET['pageID'];
$setlang = $_GET['setlang'];
$nieuwsID = $_GET['nieuwsID'];
// ################ TAAL INSTELLEN #############################################
if (isset($setlang))
{
setcookie('taalID',"$setlang");
$_COOKIE['taalID']="$setlang";
}
elseif (!isset($_COOKIE['taalID']))
{
setcookie('taalID','1');
$_COOKIE['taalID']='1';
}
// ################ MENU ZOEKEN INDIEN NODIG ###################################
if (!isset($menuID))
{
if (isset($nieuwsID))
{
$menuID=2;
$query = 'Select menus.Titel, paginas.ID from paginas left join menus on menus.ID=paginas.menuID WHERE menuID LIKE "2" ORDER BY paginas.Positie LIMIT 1';
$qresult = mysql_query($query) OR DIE(mysql_error());
$data = mysql_fetch_row($qresult);
$nieuwspage = $data[1];
$nieuwstitel = $data[0];
}
else if (isset($pageID))
{
$query = "Select menuID from paginas WHERE ID LIKE \"$pageID\" ORDER BY Positie LIMIT 1";
$qresult = mysql_query($query) OR DIE(mysql_error());
$data = mysql_fetch_row($qresult);
$menuID = $data[0];
$query2 = "Select Titel from menus WHERE ID LIKE \"$data[0]\"";
$qresult2 = mysql_query($query2) OR DIE(mysql_error());
$data2 = mysql_fetch_row($qresult2);
$menutitel = $data2[0];
}
else
{
if ($_COOKIE['taalID']=='1')
{
$menuID=1;
}
else
{
$menuID=16;
}
// Pagina ophalen
$query = "Select ID from paginas WHERE menuID LIKE \"$menuID\" ORDER BY Positie LIMIT 1";
$qresult = mysql_query($query) OR DIE(mysql_error());
$data = mysql_fetch_row($qresult);
$pageID = $data[0];
}
}
// ################ BEGINPAD INSTELLEN #########################################
$pad = 'home';
// ################ MENUS OPHALEN ##############################################
$query = 'Select ID,Titel,Link from menus WHERE TaalID LIKE '.$_COOKIE['taalID'].' ORDER BY Positie';
$qresult = mysql_query($query) OR DIE(mysql_error());
while ($data = mysql_fetch_row($qresult))
{
if ($data[0]==$menuID)
{
$menupad = $data[1];
}
if ($data[2]!='')
{
$menus .= "$data[1]
";
}
else
{
$query2 = "Select ID from paginas WHERE MenuID LIKE \"$data[0]\" ORDER BY Positie LIMIT 1";
$qresult2 = mysql_query($query2) OR DIE(mysql_error());
$data2 = mysql_fetch_row($qresult2);
$menus .= "$data[1]
";
}
}
// ################ SUBMENUS OPHALEN ###########################################
$submenus = ' ';
$query = 'Select ID,Naam from paginas WHERE MenuID LIKE "'.$menuID.'" ORDER BY Positie';
$qresult = mysql_query($query) OR DIE(mysql_error());
if (mysql_num_rows($qresult)>1)
{
while ($data = mysql_fetch_row($qresult))
{
$submenus .= "$data[1]
";
}
}
else
{
$submenus = '';
}
// ################ INHOUD OPHALEN #############################################
if (isset($nieuwsID))
{
// Nieuwsitem ophalen
$query = "Select ID,Menutitel,'',Tekst,Titel from nieuws WHERE ID LIKE \"$nieuwsID\"";
}
else if (isset($pageID))
{
// Pagina ophalen
$query = 'Select ID,Naam,Afbeelding,Tekst,Paginatitel from paginas WHERE ID LIKE "'.$pageID.'" ORDER BY Positie LIMIT 1';
}
$qresult = mysql_query($query) OR DIE(mysql_error());
$data = mysql_fetch_row($qresult);
if ($data[2]<>'')
{
$afbeelding = "";
}
$titel = $data[4];
$tekst = $data[3];
if (isset($nieuwsID))
{
// Nieuwsitem ophalen
$menupad = " > $nieuwstitel";
if ($data[1]!=$menupad)
{
$pad .= $menupad;
}
}
else
{
if ($data[1]!=$menutitel)
{
$pad .= " > $menutitel";
}
}
$pad .= " > $data[1]";
// ################ NIEUWS ITEMS WEERGEVEN INDIEN NODIG ########################
if (strpos($tekst,'[%NIEUWS]')===false)
{
// geen nieuws
}
else
{
$query = 'Select ID,Titel from nieuws WHERE TaalID LIKE '.$_COOKIE['taalID'].' ORDER BY Positie';
$qresult = mysql_query($query) OR DIE(mysql_error());
while ($data = mysql_fetch_row($qresult))
{
$nieuws .= "
|
|
|