--- index.php 2001/08/30 16:35:36 1.5 +++ index.php 2001/09/04 09:48:51 1.7 @@ -7,42 +7,49 @@ include_once("inc/Smarty.local.php"); $onload = ""; $tpl = new Smarty(); - if (!$section) { - header("Location: $PHP_SELF?section=home"); - exit; - } + if (!$section) $section = "home"; $fname = "$section.tpl"; $section_name = ""; - $inc = ""; + $inc = $mnu = ""; + $PATH = array("PLIVAHEALTH.COM"); if ($section == "home") { $section_name = "Home"; - include_once("inc/menuHome.php"); + $mnu = "inc/menuHome.php"; $inc = "inc/pgHome".($section_menu?"-$section_menu":"").".php"; - } else if ($section == "ds") { - $section_name = "Disease & Symptomes"; - include_once("inc/menuDS.php"); - $inc = "inc/pgDS".($section_menu?"-$section_menu":"").".php"; + } else if ($section == "bolesti") { + $section_name = "Bolesti"; + $mnu = "inc/menuBolesti.php"; + $inc = "inc/pgBolesti".($section_menu?"-$section_menu":"").".php"; + } else if ($section == "simptomi") { + $section_name = "Simptomi"; + $mnu = "inc/menuSimptomi.php"; + $inc = "inc/pgSimptomi".($section_menu?"-$section_menu":"").".php"; } else if ($section == "stanja") { $section_name = "Stanja"; - include_once("inc/menuStanja.php"); + $mnu = "inc/menuStanja.php"; $inc = "inc/pgStanja".($section_menu?"-$section_menu":"").".php"; } else if ($section == "lifestyle") { $section_name = "Lifestyle"; - include_once("inc/menuLifestyle.php"); + $mnu = "inc/menuLifestyle.php"; $inc = "inc/pgLifestyle".($section_menu?"-$section_menu":"").".php"; } else if ($section == "knjiznica") { $section_name = "Knjižnica"; - include_once("inc/menuKnjiznica.php"); + $mnu = "inc/menuKnjiznica.php"; $inc = "inc/pgKnjiznica".($section_menu?"-$section_menu":"").".php"; } + if ($section_name) array_push($PATH, MyUpper($section_name)); + if ($section_menu_name) array_push($PATH, MyUpper($section_menu_name)); + if ($mnu && file_exists($mnu)) { + include_once($mnu); + include_once("inc/menu.php"); + } if ($inc && file_exists($inc)) include_once($inc); $tpl->assign("isedit", $isEdit); $tpl->assign("ismed", $isMed); + $tpl->assign("PATH", $PATH); $tpl->assign("newspicdir", "$picdir/"); $tpl->assign("section", $section); - $tpl->assign("section_name", strtoupper($section_name)); $tpl->assign("section_menu", $section_menu); - $tpl->assign("section_menu_name", strtoupper($section_menu_name)); if ($fname) $main = $tpl->fetch($fname); $tpl->assign("MAIN", $main); $tpl->assign("onload", $onload);