--- new.php 2001/03/05 12:34:12 1.10 +++ new.php 2001/04/05 11:54:08 1.13 @@ -76,6 +76,16 @@ } + 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"; + } + $smarty->assign("days",$days); + $smarty->assign("last_days",array(14,30,160,240,365)); + $smarty->assign("last_desc",array("two week","one month","four months","six months","one year")); + } + $num_selected=0; $sql="select id,upper(title) as title,town_date,body,more,pdf, @@ -111,10 +121,26 @@ $title.=" : Community : ".$data[0][title_lc]; } elseif ($data[0][type] == "r") { $title.=" : Result : ".$data[0][title_lc]; + } elseif ($data[0][type] == "i") { + $title.=" : Investors News : ".$data[0][title_lc]; + } elseif ($data[0][type] == "a") { + $title.=" : Annual Report : ".$data[0][title_lc]; } } - $smarty->assign("data",$data); + + if (isset($days) && $num_selected == 0) { + $warning = "There are no news for last $days days."; + } + + if ($main == "" && $num_selected == 0) { + $warning = "This news item is no longer available"; + } + + $smarty->assign(array( + data=>$data, + warning=>$warning + )); $main=$smarty->fetch("new.tpl"); @@ -122,9 +148,6 @@ $main=join('',file(find_html_file("news",$data[0][more]))); } - if ($main == "") { - $main = "This news item is no longer available"; - } }