--- index.php 2001/09/26 13:04:28 1.13 +++ index.php 2001/10/30 16:11:28 1.24 @@ -1,15 +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), array("sec" => "linkovi", "alt" => "linkovi", "w" => 60, "h" => 23), array("sec" => "knjiznica", "alt" => "knjižnica", "w" => 74, "h" => 23), - array("sec" => "pretrazivanje", "alt" => "pretraživanje", "w" => 101, "h" => 23) + array("sec" => "lijekovi", "alt" => "Lista HZZO lijekova", "w" => 134, "h" => 23) )); } else { $tpl->assign("mainmenu", array( @@ -156,34 +222,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); - $banner = $banner_url = ""; - if ($isMed && $isReg) { - $banneri = array( - array("slika" => "gastal.gif", "alt" => "Gastal", "url" => "http://www.gastal.com/"), - array("slika" => "plivitc.gif", "alt" => "Plivit C", "url" => "http://www.plivitc.com/"), - array("slika" => "bisolex.gif", "alt" => "Bisolex", "url" => "http://www.bisolex.com/"), - array("slika" => "andolc.gif", "alt" => "Andol C", "url" => "http://www.andolc.com/"), - ); - } else { - $banneri = array( - array("slika" => "gastal.gif", "alt" => "Gastal", "url" => "http://www.gastal.com/"), - array("slika" => "plivitc.gif", "alt" => "Plivit C", "url" => "http://www.plivitc.com/"), - array("slika" => "bisolex.gif", "alt" => "Bisolex", "url" => "http://www.bisolex.com/"), - array("slika" => "andolc.gif", "alt" => "Andol C", "url" => "http://www.andolc.com/") - // array("slika" => "viponline.gif", "alt" => "VIPonline", "url" => "http://www.vip.hr/"), - // array("slika" => "globalnet.gif", "alt" => "GlobalNET", "url" => "http://www.globalnet.hr/") - ); + $tpl->assign("trazi", $trazi); + $tpl->assign("SEMAFOR", GetSemafor()); + include_once("inc/banneri.php"); + $idx = rand(0, count($banneri) - 1); + $idx2 = $i = 0; + $bnr = array(); + reset($banneri); + while (list($k, $v) = each($banneri)) { + $idx2 = $k; + $bnr = $v; + if ($i++ >= $idx) break; } - $bnr = $banneri[rand(0, count($banneri) - 1)]; $tpl->assign("banner", $bnr["slika"]); $tpl->assign("banner_alt", $bnr["alt"]); - $tpl->assign("banner_url", $bnr["url"]); + $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"); ?>