--- sections/novosti.inc 2001/06/29 12:57:06 1.1 +++ sections/novosti.inc 2001/11/21 09:16:47 1.10 @@ -2,7 +2,11 @@ include("news_sif.inc"); -$sql_where="where visible is true"; +$sql_where="where $visible_is_true"; + +$smarty->assign("m_session","&m=o_nas&"); +$smarty->assign("m_session_urlend","&m=o_nas&"); +$smarty->assign("m_form_session",''); if (file_exists(find_html_file("more",$more))) { @@ -21,6 +25,22 @@ } elseif ($type == "e") { $sql_where .= " and substr(type,1,1)='e'"; $title.=" : Dogotki"; + } elseif (strlen($type) == 3) { + $sql_where .= " and type='$type'"; + if (substr($type,0,2) == "mp" || $type=="mcx" || $type=="mix") $title.=" : Publikacije"; + if ($type=="mp_") { + $title.=" : PLIVA Magazin"; + $smarty->assign("mtext","PLIVA Magazin"); + } elseif ($type=="mpx") { + $title.=" : Pharna Info"; + $smarty->assign("mtext","Pharma Info"); + } elseif ($type=="mcx") { + $title.=" : Medicus"; + $smarty->assign("mtext","Medicus"); + } elseif ($type=="mix") { + $title.=" : Medinfo bulletin"; + $smarty->assign("mtext","Medinfo bulletin"); + } } } @@ -34,11 +54,11 @@ if (isset($days)) { if ($days != 0) { $sql_where.=" and date(now())-date(date) > 0 and date(now())-date(date) < $days"; - $title.=" : News in last $days days"; + $title.=" : Pregled novic zadnjega $days dni"; } $smarty->assign("days",$days); $smarty->assign("last_days",array(14,30,160,240,365)); - $smarty->assign("last_desc",array("two weeks","one month","four months","six months","one year")); + $smarty->assign("last_desc",array("zadnjih 14 dneh","meseca","štirih mesecev","šestih mesecev","enega leta")); } $num_selected=0; @@ -50,6 +70,7 @@ $sth = $dbh->prepare("$sql"); $sth->execute(); while ($row=$sth->fetchrow_hash()) { + if ($row[pdf]) $row[url]="blob/".$row[pdf]; $data[]=$row; $num_selected++; } @@ -78,9 +99,9 @@ if (isset($days) && $num_selected == 0) { - $warning = "There are no news for last $days days."; + $warning = "Ni novic v zadnjih $days dneh."; } elseif ($main == "" && $num_selected == 0) { - $warning = "This news item is no longer available"; + $warning = "Podatki niso već dostopni."; } $smarty->assign(array( @@ -88,10 +109,16 @@ warning=>$warning )); - $main=$smarty->fetch("novosti.tpl"); if (isset($id) && find_html_file("more",$data[0][more])) { $main=join('',file(find_html_file("more",$data[0][more]))); + } else { + if (! isset($p)) $p="novosti"; + $logo="p/${p}_".$data[0][type].".jpg"; + if (file_exists($logo)) { + $smarty->assign("logo",$logo); + } + $main=$smarty->fetch("$p.tpl"); } @@ -99,4 +126,5 @@ $smarty->assign( array(back_url=>$back_url) ); + ?>