--- index.php 2001/08/22 11:43:59 1.3 +++ index.php 2001/09/19 12:23:56 1.11 @@ -1,50 +1,102 @@ assign("ns4", $ns4); + if (!$section) $section = "home"; + $main_template = "index.tpl"; $fname = "$section.tpl"; $section_name = ""; - if ($section == "home") { - $section_name = "Home"; - include_once("inc/menuHome.php"); - $f = "inc/pgHome".($section_menu?"-$section_menu":"").".php"; - @include_once($f); - } else if ($section == "ds") { - $section_name = "Disease & Symptomes"; - include_once("inc/menuDS.php"); - $f = "inc/pgDS".($section_menu?"-$section_menu":"").".php"; - @include_once($f); - } else if ($section == "conditions") { - $section_name = "Conditions"; - include_once("inc/menuConditions.php"); - $f = "inc/pgConditions".($section_menu?"-$section_menu":"").".php"; - @include_once($f); - } else if ($section == "lifestyle") { - $section_name = "Lifestyle"; - include_once("inc/menuLifestyle.php"); - $f = "inc/pgLifestyle".($section_menu?"-$section_menu":"").".php"; - @include_once($f); - } else if ($section == "library") { - $section_name = "Library"; - include_once("inc/menuLibrary.php"); - $f = "inc/pgLibrary".($section_menu?"-$section_menu":"").".php"; - @include_once($f); + $inc = $mnu = ""; + $PATH = array($isMed ? "PLIVAMED.NET" : "PLIVAHEALTH.HR"); + if ($isMed) { + $mnu = "inc/menuMED.php"; + if ($section == "home") { + $section_name = "Home"; + $inc = "inc/pgHome"; + } else if ($section == "registracija") { + $section_name = "Registracija"; + $inc = "inc/pgRegistracija"; + } else if ($section == "onama") { + $section_name = "O nama"; + $inc = "inc/pgONama"; + } else if ($section == "knjiznica") { + $section_name = "Knjižnica"; + $inc = "inc/pgKnjiznica2"; + } else if ($section == "linkovi") { + $section_name = "Linkovi"; + $inc = "inc/pgLinkovi"; + } else if ($section == "pretrazivanje") { + $section_name = "Pretraživanje"; + $inc = "inc/pgPretrazivanje"; + } + } else { + if ($section == "home") { + $section_name = "Home"; + $mnu = "inc/menuHome.php"; + $inc = "inc/pgHome"; + } else if ($section == "bolesti") { + $section_name = "Bolesti"; + $mnu = "inc/menuBolesti.php"; + $inc = "inc/pgBolesti"; + } else if ($section == "simptomi") { + $section_name = "Simptomi"; + $mnu = "inc/menuSimptomi.php"; + $inc = "inc/pgSimptomi"; + } else if ($section == "stanja") { + $section_name = "Stanja"; + $mnu = "inc/menuStanja.php"; + $inc = "inc/pgStanja"; + } else if ($section == "lifestyle") { + $section_name = "Lifestyle"; + $mnu = "inc/menuLifestyle.php"; + $inc = "inc/pgLifestyle"; + } else if ($section == "knjiznica") { + $section_name = "Knjižnica"; + $mnu = "inc/menuKnjiznica.php"; + $inc = "inc/pgKnjiznica"; + } + } + if ($mnu && file_exists($mnu)) { + $keep_template = false; + include_once($mnu); + # if (!$section_menu) $section_menu = $menu[0]["name"]; + $section_menu_name = ""; + while (list($k, $v) = each($menu)) { + $menu[$k]["caption2"] = urlencode($menu[$k]["caption"]); + if ($v["name"] == $section_menu) $section_menu_name = $v["caption"]; + } + $tpl->assign("MENU", $menu); + if ($section_menu && !$keep_template) + $fname = eregi_replace("(".$tpl->tpl_file_ext.")$", "-$section_menu\\1", $fname); + $inc2 = $inc.($section_menu?"-$section_menu":""); + $inc .= ".php"; + $inc2 .= ".php"; + if ($inc2 && file_exists($inc2)) $inc = $inc2; } + if ($section_name) array_push($PATH, MyUpper($section_name)); + if ($section_menu_name) array_push($PATH, MyUpper($section_menu_name)); + 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("aupicdir", "$aupicdir/"); $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("spec", $spec); + $main = $fname ? $tpl->fetch($fname) : ""; $tpl->assign("MAIN", $main); + $tpl->assign("FOOTER", $tpl->fetch("footer.tpl")); $tpl->assign("onload", $onload); - $tpl->display("index.tpl"); + $tpl->display($main_template); + include_once("inc/tracker.php"); ?>