37 |
|
|
38 |
$smarty->assign( array ( lpic=>$lpic, lext=>$lext, mpic=>$mpic, ) ); |
$smarty->assign( array ( lpic=>$lpic, lext=>$lext, mpic=>$mpic, ) ); |
39 |
|
|
40 |
|
include("find_html_file.inc"); |
|
function find_html_file($dir,$file) { |
|
|
$file="./$dir/$file"; |
|
|
if (is_file("$file") && file_exists("$file")) { return "$file"; } |
|
|
if (is_file("$file.htm") && file_exists("$file.htm")) { return "$file.htm"; } |
|
|
if (is_file("$file.html") && file_exists("$file.html")) { return "$file.html"; } |
|
|
return 0; |
|
|
} |
|
41 |
|
|
42 |
if (file_exists(find_html_file("news",$more))) { |
if (file_exists(find_html_file("news",$more))) { |
43 |
|
|
69 |
} |
} |
70 |
|
|
71 |
|
|
72 |
|
if (isset($days)) { |
73 |
|
if ($days != 0) { |
74 |
|
$sql_where.=" and date(now())-date(date) > 0 and date(now())-date(date) < $days"; |
75 |
|
$title.=" : News in last $days days"; |
76 |
|
} |
77 |
|
$smarty->assign("days",$days); |
78 |
|
$smarty->assign("last_days",array(14,30,160,240,365)); |
79 |
|
$smarty->assign("last_desc",array("two week","one month","four months","six months","one year")); |
80 |
|
} |
81 |
|
|
82 |
$num_selected=0; |
$num_selected=0; |
83 |
$sql="select |
$sql="select |
84 |
id,upper(title) as title,town_date,body,more,pdf, |
id,upper(title) as title,town_date,body,more,pdf, |
121 |
} |
} |
122 |
} |
} |
123 |
|
|
124 |
$smarty->assign("data",$data); |
|
125 |
|
if (isset($days) && $num_selected == 0) { |
126 |
|
$warning = "There are no news for last $days days."; |
127 |
|
} |
128 |
|
|
129 |
|
if ($main == "" && $num_selected == 0) { |
130 |
|
$warning = "This news item is no longer available"; |
131 |
|
} |
132 |
|
|
133 |
|
$smarty->assign(array( |
134 |
|
data=>$data, |
135 |
|
warning=>$warning |
136 |
|
)); |
137 |
|
|
138 |
$main=$smarty->fetch("new.tpl"); |
$main=$smarty->fetch("new.tpl"); |
139 |
|
|
141 |
$main=join('',file(find_html_file("news",$data[0][more]))); |
$main=join('',file(find_html_file("news",$data[0][more]))); |
142 |
} |
} |
143 |
|
|
|
if ($main == "") { |
|
|
$main = "This news item is no longer available"; |
|
|
} |
|
144 |
|
|
145 |
} |
} |
146 |
|
|