--- index.php 2001/10/04 14:59:34 1.18 +++ index.php 2001/10/23 16:13:59 1.22 @@ -1,15 +1,12 @@ 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 && $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), @@ -206,11 +226,20 @@ $tpl->assign("onload", $onload); $tpl->assign("refresh", $refresh); $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);