--- sections/novosti.inc 2001/06/29 14:12:07 1.2 +++ sections/novosti.inc 2001/11/20 08:48:14 1.8 @@ -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))) { @@ -23,6 +27,20 @@ $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"); + } } } @@ -36,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 dveh tednov","one month","four months","six months","one year")); } $num_selected=0; @@ -52,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++; } @@ -90,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"); } @@ -101,4 +126,5 @@ $smarty->assign( array(back_url=>$back_url) ); + ?>