$_flag=0;
$homepageid = 274;
$colofonid = 301;
$id = (int)$_REQUEST["id"];
$requestid = $id;
$level = -1; //don't count root page
getLevel($id, $level);
if ($level==3) {
//zoek naar een pagina met de titel introductie
$q = "select id from cms_data where ltrim(rtrim(paginaTitel)) = 'Introductie' and parentpage = ".$id;
$res2 = mysql_query($q) or die($q.mysql_error());
if (mysql_num_rows($res2)>0) {
$id = mysql_result($res2,0);
}
}
$pid = getParent($id);
//set a default page if an id is omitted
$conn = db_connect();
$q = "select * from cms_data where id = ".$id;
$res_page = @$conn->query($q);
$pagina = mysqli_fetch_array($res_page);
if ($level==1 && $id!=$homepageid) {
//createMenuHead($pagina["paginaTitel"], $id);
createMenuHeadEmpty();
$_flag++;
$subs = array(-1);
$q = "select id from cms_data where parentpage = $id";
$res = @$conn->query($q);
while ($row = mysqli_fetch_array($res)) {
$subs[]=$row["id"];
}
$subs = implode(",",$subs);
$q = "select paginaTitel,id from cms_data where parentpage IN (".$subs.") and isMenuItem = 1 order by pageLabel";
$res = @$conn->query($q);
while ($row = mysqli_fetch_array($res)) {
createMenuItem($row["paginaTitel"], $row["id"], $level, 1);
$_flag++;
}
} elseif ($level==3 || $level==4) {
$sublevel = -1;
getLevel($requestid, $sublevel);
if ($sublevel==4) {
$menuid = getParent($requestid);
} else {
$menuid = $requestid;
}
$q = "select paginaTitel from cms_data where id = $menuid";
$res = mysql_query($q) or die($q);
createMenuHead(mysql_result($res,0), $menuid);
$q = "select paginaTitel,id from cms_data where isMenuItem = 1 and parentpage = $menuid order by pageLabel";
$res = @$conn->query($q);
while ($row = mysqli_fetch_array($res)) {
createMenuItem($row["paginaTitel"], $row["id"], $level, 1);
$_flag++;
}
}
if (!$_flag) { echo " | "; }
?>
|
if ($level==1 && $_REQUEST["cmd"] != "search" && $id!=$homepageid && $id!=$colofonid){ ?>
| |