/[pliva-si]/sections/novosti.inc
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sections/novosti.inc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by dpavlin, Fri Jun 29 14:12:07 2001 UTC revision 1.8 by dpavlin, Tue Nov 20 08:48:14 2001 UTC
# Line 2  Line 2 
2    
3  include("news_sif.inc");  include("news_sif.inc");
4    
5  $sql_where="where visible is true";  $sql_where="where $visible_is_true";
6    
7    $smarty->assign("m_session","&m=o_nas&");
8    $smarty->assign("m_session_urlend","&m=o_nas&");
9    $smarty->assign("m_form_session",'<input type="hidden" name="m" value="o_nas">');
10    
11  if (file_exists(find_html_file("more",$more))) {  if (file_exists(find_html_file("more",$more))) {
12    
# Line 23  if (file_exists(find_html_file("more",$m Line 27  if (file_exists(find_html_file("more",$m
27                          $title.=" : Dogotki";                          $title.=" : Dogotki";
28                  } elseif (strlen($type) == 3) {                  } elseif (strlen($type) == 3) {
29                          $sql_where .= " and type='$type'";                          $sql_where .= " and type='$type'";
30                            if (substr($type,0,2) == "mp" || $type=="mcx" || $type=="mix") $title.=" : Publikacije";
31                            if ($type=="mp_") {
32                                    $title.=" : PLIVA Magazin";
33                                    $smarty->assign("mtext","PLIVA Magazin");
34                            } elseif ($type=="mpx") {
35                                    $title.=" : Pharna Info";
36                                    $smarty->assign("mtext","Pharma Info");
37                            } elseif ($type=="mcx") {
38                                    $title.=" : Medicus";
39                                    $smarty->assign("mtext","Medicus");
40                            } elseif ($type=="mix") {
41                                    $title.=" : Medinfo bulletin";
42                                    $smarty->assign("mtext","Medinfo bulletin");
43                            }
44                  }                  }
45          }          }
46    
# Line 36  if (file_exists(find_html_file("more",$m Line 54  if (file_exists(find_html_file("more",$m
54          if (isset($days)) {          if (isset($days)) {
55                  if ($days != 0) {                  if ($days != 0) {
56                          $sql_where.=" and date(now())-date(date) > 0 and date(now())-date(date) < $days";                          $sql_where.=" and date(now())-date(date) > 0 and date(now())-date(date) < $days";
57                          $title.=" : News in last $days days";                          $title.=" : Pregled novic zadnjega $days dni";
58                  }                  }
59                  $smarty->assign("days",$days);                  $smarty->assign("days",$days);
60                  $smarty->assign("last_days",array(14,30,160,240,365));                  $smarty->assign("last_days",array(14,30,160,240,365));
61                  $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"));
62          }          }
63    
64          $num_selected=0;          $num_selected=0;
# Line 52  if (file_exists(find_html_file("more",$m Line 70  if (file_exists(find_html_file("more",$m
70          $sth = $dbh->prepare("$sql");          $sth = $dbh->prepare("$sql");
71          $sth->execute();          $sth->execute();
72          while ($row=$sth->fetchrow_hash()) {          while ($row=$sth->fetchrow_hash()) {
73                    if ($row[pdf]) $row[url]="blob/".$row[pdf];
74                  $data[]=$row;                  $data[]=$row;
75                  $num_selected++;                  $num_selected++;
76          }          }
# Line 90  if (file_exists(find_html_file("more",$m Line 109  if (file_exists(find_html_file("more",$m
109                  warning=>$warning                  warning=>$warning
110                  ));                  ));
111    
         $main=$smarty->fetch("novosti.tpl");  
112    
113          if (isset($id) && find_html_file("more",$data[0][more])) {          if (isset($id) && find_html_file("more",$data[0][more])) {
114                  $main=join('',file(find_html_file("more",$data[0][more])));                  $main=join('',file(find_html_file("more",$data[0][more])));
115            } else {
116                    if (! isset($p)) $p="novosti";
117                    $logo="p/${p}_".$data[0][type].".jpg";
118                    if (file_exists($logo)) {
119                            $smarty->assign("logo",$logo);
120                    }
121                    $main=$smarty->fetch("$p.tpl");
122          }          }
123    
124    
# Line 101  if (file_exists(find_html_file("more",$m Line 126  if (file_exists(find_html_file("more",$m
126    
127  $smarty->assign( array(back_url=>$back_url) );  $smarty->assign( array(back_url=>$back_url) );
128    
129    
130  ?>  ?>

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.26