/[corp_html]/new.php
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 /new.php

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

revision 1.4 by dpavlin, Thu Feb 22 20:51:10 2001 UTC revision 1.5 by dpavlin, Fri Feb 23 15:23:32 2001 UTC
# Line 47  if (file_exists(find_html_file("news",$m Line 47  if (file_exists(find_html_file("news",$m
47                  $sql_where.=" and id=$id ";                  $sql_where.=" and id=$id ";
48          }          }
49    
50          $sth = $dbh->prepare("select id,upper(title) as title,town_date,body,more,pdf from news $sql_where order by date desc");          if (isset($type)) {
51                    if ($type == "n") {
52                            $sql_where .= " and type='n'";
53                    }
54            }
55    
56            if (! isset($show) && !isset($start)) {
57                    $sql_limit="limit 10";
58            } elseif (isset($start)) {
59                    $sql_limit="limit 10,$start";
60            }
61    
62    
63            $num_selected=0;
64            $sql="select
65                            id,upper(title) as title,town_date,body,more,pdf,
66                            (date-now()::date) as comming
67                    from news $sql_where order by date desc $sql_limit";
68    #       print "$sql";
69            $sth = $dbh->prepare("$sql");
70          $sth->execute();          $sth->execute();
71          while ($row=$sth->fetchrow_hash()) {          while ($row=$sth->fetchrow_hash()) {
72                  $data[]=$row;                  $data[]=$row;
73                    $num_selected++;
74            }
75    
76            if ($num_selected == 10) {
77                    $smarty->assign(array(
78                            "multi_page_show" => 1,
79                            "multi_page_next" => "$PHP_SELF?start=".($start+10),
80                    ));
81            }
82            if ($start && $start >= 10) {
83                    $smarty->assign(array(
84                            "multi_page_show" => 1,
85                            "multi_page_prev" => "$PHP_SELF?start=".($start-10),
86                    ));
87          }          }
88    
89          $smarty->assign("data",$data);          $smarty->assign("data",$data);

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.26