--- index.php 2001/08/07 13:55:51 1.2 +++ index.php 2001/08/22 11:43:59 1.3 @@ -4,34 +4,46 @@ $syspicdir = $HTTP_SERVER_VARS["DOCUMENT_ROOT"].$picdir; include_once("inc/Smarty.class.php"); include_once("inc/Smarty.local.php"); - $fname = ""; $onload = ""; $tpl = new Smarty(); if (!$section) { header("Location: $PHP_SELF?section=home"); exit; } + $fname = "$section.tpl"; $section_name = ""; if ($section == "home") { - $section_name = "HOME"; - include_once("inc/pgHome.php"); - } else if ($section == "d_s") { - $section_name = "DISEASE & SYMPTOMES"; + $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/pgConditions.php"); + $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/pgLifestyle.php"); + $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/pgLibrary.php"); + $section_name = "Library"; + include_once("inc/menuLibrary.php"); + $f = "inc/pgLibrary".($section_menu?"-$section_menu":"").".php"; + @include_once($f); } - $tpl->assign("section", $section); - $tpl->assign("section_name", $section_name); $tpl->assign("newspicdir", "$picdir/"); - if (!$fname) $fname = "$section.tpl"; - if ($section_name) $main = $tpl->fetch($fname); + $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); $tpl->display("index.tpl");