4 |
|
|
5 |
// fetch menu |
// fetch menu |
6 |
|
|
7 |
$sth = $dbh->prepare("select item,url,file from menu where section='$section' order by num"); |
$sth = $dbh->prepare("select item,url,file,w,h from menu where section='$section' and visible order by num"); |
8 |
$sth->execute(); |
$sth->execute(); |
9 |
while ($row=$sth->fetchrow_hash()) { |
while ($row=$sth->fetchrow_hash()) { |
10 |
$menu[]=$row; |
$menu[]=$row; |
14 |
|
|
15 |
// fetch news |
// fetch news |
16 |
|
|
17 |
$sth = $dbh->prepare("select id,title from news where type<>'e' and type<>'p' and visible order by date desc limit 5"); |
$sth = $dbh->prepare("select id,title from news where substr(type,1,1)='n' and visible order by date desc limit 5"); |
18 |
$sth->execute(); |
$sth->execute(); |
19 |
while ($row=$sth->fetchrow_hash()) { |
while ($row=$sth->fetchrow_hash()) { |
20 |
$news[]=$row; |
$news[]=$row; |
21 |
} |
} |
22 |
$smarty->assign("news",$news); |
$smarty->assign("news",$news); |
23 |
|
|
24 |
$sth = $dbh->prepare("select id,title from news where type='e' and visible order by priority desc,date desc limit 5"); |
$sth = $dbh->prepare("select id,title from news where substr(type,1,1)='e' and visible order by priority desc,date desc limit 5"); |
25 |
$sth->execute(); |
$sth->execute(); |
26 |
while ($row=$sth->fetchrow_hash()) { |
while ($row=$sth->fetchrow_hash()) { |
27 |
$events[]=$row; |
$events[]=$row; |