25 |
$back_url="index.php"; |
$back_url="index.php"; |
26 |
} |
} |
27 |
|
|
28 |
$smarty->assign( array ( lpic=>$lpic, lext=>$lext, mpic=>$mpic, Section_title=>$title ) ); |
$smarty->assign( array ( lpic=>$lpic, lext=>$lext, mpic=>$mpic, ) ); |
29 |
|
|
30 |
$sql_where="where visible is true"; |
$sql_where="where visible is true"; |
31 |
|
|
50 |
if (isset($type)) { |
if (isset($type)) { |
51 |
if ($type == "n") { |
if ($type == "n") { |
52 |
$sql_where .= " and type='n'"; |
$sql_where .= " and type='n'"; |
53 |
|
$title.=" : News"; |
54 |
} elseif ($type == "e") { |
} elseif ($type == "e") { |
55 |
$sql_where .= " and type='e'"; |
$sql_where .= " and type='e'"; |
56 |
|
$title.=" : Events"; |
57 |
} |
} |
58 |
} |
} |
59 |
|
|
67 |
$num_selected=0; |
$num_selected=0; |
68 |
$sql="select |
$sql="select |
69 |
id,upper(title) as title,town_date,body,more,pdf, |
id,upper(title) as title,town_date,body,more,pdf, |
70 |
(date-now()::date) as comming |
(date-now()::date) as comming,type,title as title_lc |
71 |
from news $sql_where order by priority desc,date desc $sql_limit"; |
from news $sql_where order by priority desc,date desc $sql_limit"; |
72 |
print "$sql"; |
# print "$sql"; |
73 |
$sth = $dbh->prepare("$sql"); |
$sth = $dbh->prepare("$sql"); |
74 |
$sth->execute(); |
$sth->execute(); |
75 |
while ($row=$sth->fetchrow_hash()) { |
while ($row=$sth->fetchrow_hash()) { |
90 |
)); |
)); |
91 |
} |
} |
92 |
|
|
93 |
|
if (isset($id) && $num_selected == 1) { |
94 |
|
if ($data[0][type] == "n") { |
95 |
|
$title.=" : News : ".$data[0][title_lc]; |
96 |
|
} elseif ($data[0][type] == "e") { |
97 |
|
$title.=" : Event : ".$data[0][title_lc]; |
98 |
|
} elseif ($data[0][type] == "c") { |
99 |
|
$title.=" : Community : ".$data[0][title_lc]; |
100 |
|
} elseif ($data[0][type] == "r") { |
101 |
|
$title.=" : Result : ".$data[0][title_lc]; |
102 |
|
} |
103 |
|
} |
104 |
|
|
105 |
$smarty->assign("data",$data); |
$smarty->assign("data",$data); |
106 |
|
|
107 |
$main=$smarty->fetch("new.tpl"); |
$main=$smarty->fetch("new.tpl"); |
117 |
} |
} |
118 |
|
|
119 |
include("common.inc"); |
include("common.inc"); |
120 |
$smarty->assign( array(back_url=>$back_url, MAIN=>$main)); |
$smarty->assign( array(back_url=>$back_url, MAIN=>$main, |
121 |
|
Section_title=>$title ) ); |
122 |
|
|
123 |
$smarty->display("index.tpl"); |
$smarty->display("index.tpl"); |
124 |
?> |
?> |