--- index.php 2001/09/28 23:34:37 1.14 +++ index.php 2001/10/27 16:54:50 1.23 @@ -1,24 +1,29 @@ 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":""); - if ($inc2 && file_exists("inc/$inc2.php")) $inc = $inc2; } + if ($section_menu && !$keep_template) + $fname = eregi_replace("(".$tpl->tpl_file_ext.")$", "-$section_menu\\1", $fname); + $inc2 = $inc.($section_menu?"-$section_menu":""); + if ($inc2 && file_exists("inc/$inc2.php")) $inc = $inc2; $inc .= ".php"; if ($section_name) array_push($PATH, MyUpper($section_name)); - if ($section_menu_name) array_push($PATH, MyUpper($section_menu_name)); + if ($section_menu_name && $push_menu) array_push($PATH, MyUpper($section_menu_name)); if ($section_menu2_name) array_push($PATH, MyUpper($section_menu2_name)); if ($inc && file_exists("inc/$inc")) include_once("inc/$inc"); + unset($dbh); if ($isMed) { $tpl->assign("mainmenu", array( array("sec" => "home", "alt" => "home", "w" => 56, "h" => 23), @@ -181,18 +218,31 @@ $tpl->assign("section_menu", $section_menu); $tpl->assign("section_menu2", $section_menu2); $tpl->assign("spec", $spec); + $tpl->assign("offset", $offset); if ($fname && $section_name) $main = $tpl->fetch($fname); $tpl->assign("MAIN", $main); $tpl->assign("FOOTER", $tpl->fetch("footer.tpl")); $tpl->assign("onload", $onload); $tpl->assign("refresh", $refresh); - $tpl->assign("query", $query); + $tpl->assign("trazi", $trazi); + $tpl->assign("SEMAFOR", GetSemafor()); include_once("inc/banneri.php"); $idx = rand(0, count($banneri) - 1); - $tpl->assign("banner", $banneri[$idx]["slika"]); - $tpl->assign("banner_alt", $banneri[$idx]["alt"]); - $tpl->assign("banner_url", "?redir=".($idx + 1)); + $idx2 = $i = 0; + $bnr = array(); + reset($banneri); + while (list($k, $v) = each($banneri)) { + $idx2 = $k; + $bnr = $v; + if ($i++ >= $idx) break; + } + $tpl->assign("banner", $bnr["slika"]); + $tpl->assign("banner_alt", $bnr["alt"]); + $tpl->assign("banner_url", "?redir=$idx2"); $tpl->assign("show", $show ? true : false); + $tpl->assign("date", strftime("%d.%m.%Y.")); + $tpl->assign("acat", $acat); + $tpl->assign("acat2", $acat2); $tpl->display($main_template); include_once("inc/tracker.php"); ?>