4 |
|
|
5 |
// fetch menu |
// fetch menu |
6 |
|
|
7 |
$sth = $dbh->prepare("select item,url,file from menu where section='$section' order by num"); |
if (!isset($m)) { |
8 |
|
$m=$section; |
9 |
|
} else { |
10 |
|
$smarty->assign("m_session","m=$m&"); |
11 |
|
} |
12 |
|
|
13 |
|
$sth = $dbh->prepare("select item,url,file,w,h from menu where section='$m' and visible order by num"); |
14 |
$sth->execute(); |
$sth->execute(); |
15 |
while ($row=$sth->fetchrow_hash()) { |
while ($row=$sth->fetchrow_hash()) { |
16 |
$menu[]=$row; |
$menu[]=$row; |
20 |
|
|
21 |
// fetch news |
// fetch news |
22 |
|
|
23 |
$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"); |
24 |
$sth->execute(); |
$sth->execute(); |
25 |
while ($row=$sth->fetchrow_hash()) { |
while ($row=$sth->fetchrow_hash()) { |
26 |
$news[]=$row; |
$news[]=$row; |
27 |
} |
} |
28 |
$smarty->assign("news",$news); |
$smarty->assign("news",$news); |
29 |
|
|
30 |
$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"); |
31 |
$sth->execute(); |
$sth->execute(); |
32 |
while ($row=$sth->fetchrow_hash()) { |
while ($row=$sth->fetchrow_hash()) { |
33 |
$events[]=$row; |
$events[]=$row; |