--- inc/common.inc 2001/06/29 12:55:11 1.4 +++ inc/common.inc 2001/11/20 11:26:14 1.10 @@ -1,10 +1,18 @@ prepare("select item,url,file,w,h from menu where section='$section' and visible order by num"); +if (!isset($m)) { + $m=$section; +} else { + $smarty->assign("m_session","m=$m&"); + $smarty->assign("m_session_urlend","&m=$m"); + $smarty->assign("m_form_session",""); +} + +$sth = $dbh->prepare("select item,url,file,w,h from menu where section='$m' and $visible_is_true order by num"); $sth->execute(); while ($row=$sth->fetchrow_hash()) { $menu[]=$row; @@ -12,16 +20,31 @@ $smarty->assign("menu",$menu); + +// link na otroke sa slatkorne stran +if ($m == "sladkorna") $smarty->assign("link_otroci",1); + + +$sql_where=" and substr(type,3,1)<>'x'" ; // don't show locked records + +// auth... based on m +if ($m == "za_zdravnike") { + Header("X-auth: needed"); + print ""; + + $sql_where=""; +} + // fetch news -$sth = $dbh->prepare("select id,title from news where substr(type,1,1)='n' and visible order by date desc limit 5"); +$sth = $dbh->prepare("select id,title from news where substr(type,1,1)='n' $sql_where and $visible_is_true order by date desc limit 5"); $sth->execute(); while ($row=$sth->fetchrow_hash()) { $news[]=$row; } $smarty->assign("news",$news); -$sth = $dbh->prepare("select id,title from news where substr(type,1,1)='e' and visible order by priority desc,date desc limit 5"); +$sth = $dbh->prepare("select id,title from news where substr(type,1,1)='e' $sql_where and $visible_is_true order by priority desc,date desc limit 5"); $sth->execute(); while ($row=$sth->fetchrow_hash()) { $events[]=$row; @@ -30,39 +53,6 @@ #include("debug.inc"); -if ($multi_page) { - $max=count($multi_page); - $next=$multi_page[$current+1]; - $show=0; - - $uri=basename($GLOBALS[REQUEST_URI]); - - for ($i=0; $i<=$max; $i++) { - if ($multi_page[$i]==substr($uri,0,strlen($uri))) { - $current=$i; - $show=1; - } - } - - if ($current && $current!=0) { - $prev=$multi_page[$current-1]; - } - if ($current && $current!=$max) { - $next=$multi_page[$current+1]; - } - if ($show) { - $smarty->assign(array( - "multi_page_show" => 1, - "multi_page"=>$multi_page, - "multi_page_current"=>($current+1), - "multi_page_max"=>$max, - "multi_page_prev"=>$prev, - "multi_page_next"=>$next - )); - } - -} - function check_required() { global $inputs_required; global $inputs_required_type;