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 |
|
$smarty->assign("m_form_session","<input type=\"hidden\" name=\"m\" value=\"$m\">"); |
12 |
|
} |
13 |
|
|
14 |
|
$sth = $dbh->prepare("select item,url,file,w,h from menu where section='$m' and visible order by num"); |
15 |
$sth->execute(); |
$sth->execute(); |
16 |
while ($row=$sth->fetchrow_hash()) { |
while ($row=$sth->fetchrow_hash()) { |
17 |
$menu[]=$row; |
$menu[]=$row; |
21 |
|
|
22 |
// fetch news |
// fetch news |
23 |
|
|
24 |
$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"); |
25 |
$sth->execute(); |
$sth->execute(); |
26 |
while ($row=$sth->fetchrow_hash()) { |
while ($row=$sth->fetchrow_hash()) { |
27 |
$news[]=$row; |
$news[]=$row; |
28 |
} |
} |
29 |
$smarty->assign("news",$news); |
$smarty->assign("news",$news); |
30 |
|
|
31 |
$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"); |
32 |
$sth->execute(); |
$sth->execute(); |
33 |
while ($row=$sth->fetchrow_hash()) { |
while ($row=$sth->fetchrow_hash()) { |
34 |
$events[]=$row; |
$events[]=$row; |
37 |
|
|
38 |
#include("debug.inc"); |
#include("debug.inc"); |
39 |
|
|
|
if ($multi_page) { |
|
|
$max=count($multi_page); |
|
|
$next=$multi_page[$current+1]; |
|
|
$show=0; |
|
|
|
|
|
$uri=basename($GLOBALS[REQUEST_URI]); |
|
|
|
|
|
for ($i=0; $i<=$max; $i++) { |
|
|
if ($multi_page[$i]==substr($uri,0,strlen($uri))) { |
|
|
$current=$i; |
|
|
$show=1; |
|
|
} |
|
|
} |
|
|
|
|
|
if ($current && $current!=0) { |
|
|
$prev=$multi_page[$current-1]; |
|
|
} |
|
|
if ($current && $current!=$max) { |
|
|
$next=$multi_page[$current+1]; |
|
|
} |
|
|
if ($show) { |
|
|
$smarty->assign(array( |
|
|
"multi_page_show" => 1, |
|
|
"multi_page"=>$multi_page, |
|
|
"multi_page_current"=>($current+1), |
|
|
"multi_page_max"=>$max, |
|
|
"multi_page_prev"=>$prev, |
|
|
"multi_page_next"=>$next |
|
|
)); |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
40 |
function check_required() { |
function check_required() { |
41 |
global $inputs_required; |
global $inputs_required; |
42 |
global $inputs_required_type; |
global $inputs_required_type; |