1 |
<? |
<? |
2 |
|
|
3 |
global $smarty,$dbh; |
global $smarty,$dbh,$visible_is_true; |
4 |
|
|
5 |
|
// just to be on safe side |
6 |
|
if (! isset($visible_is_true)) { |
7 |
|
$visible_is_true="visible is true"; |
8 |
|
} |
9 |
|
|
10 |
// fetch menu |
// fetch menu |
11 |
|
|
12 |
$sth = $dbh->prepare("select item,url,file from menu where section='$section' order by num"); |
$sth = $dbh->prepare("select item,url,file from menu where section='$section' and $visible_is_true order by num"); |
13 |
$sth->execute(); |
$sth->execute(); |
14 |
while ($row=$sth->fetchrow_hash()) { |
while ($row=$sth->fetchrow_hash()) { |
15 |
$menu[]=$row; |
$menu[]=$row; |
19 |
|
|
20 |
// fetch news |
// fetch news |
21 |
|
|
22 |
$sth = $dbh->prepare("select id,title from news where type<>'e' and visible order by date desc limit 5"); |
$sth = $dbh->prepare("select id,title from news where (type='n' or type='c' or type='a' or type='i' or type='r' or type='p') and $visible_is_true order by date desc limit 5"); |
23 |
$sth->execute(); |
$sth->execute(); |
24 |
while ($row=$sth->fetchrow_hash()) { |
while ($row=$sth->fetchrow_hash()) { |
25 |
$news[]=$row; |
$news[]=$row; |
26 |
} |
} |
27 |
$smarty->assign("news",$news); |
$smarty->assign("news",$news); |
28 |
|
|
29 |
$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 type='e' and $visible_is_true order by priority desc,date desc limit 5"); |
30 |
$sth->execute(); |
$sth->execute(); |
31 |
while ($row=$sth->fetchrow_hash()) { |
while ($row=$sth->fetchrow_hash()) { |
32 |
$events[]=$row; |
$events[]=$row; |
35 |
|
|
36 |
#include("debug.inc"); |
#include("debug.inc"); |
37 |
|
|
38 |
|
// multipage |
39 |
|
|
40 |
if ($multi_page) { |
if ($multi_page) { |
41 |
$max=count($multi_page); |
$max=count($multi_page); |
42 |
$next=$multi_page[$current+1]; |
$next=$multi_page[$current+1]; |
70 |
|
|
71 |
} |
} |
72 |
|
|
73 |
|
// banner |
74 |
|
|
75 |
|
include("banner.inc"); |
76 |
|
|
77 |
|
function check_required() { |
78 |
|
global $inputs_required; |
79 |
|
global $inputs_required_type; |
80 |
|
$ok=1; |
81 |
|
if (isset($inputs_required)) { |
82 |
|
foreach ($inputs_required as $i) { |
83 |
|
if (! isset($GLOBALS[$i]) || $GLOBALS[$i] == "") $ok=0; |
84 |
|
switch (strtolower($inputs_required_type[$i])) { |
85 |
|
case 'email': |
86 |
|
if (!strstr($GLOBALS[$i],'@')) $ok=0; |
87 |
|
} |
88 |
|
// print "$i: $GLOBALS[$i] type: $inputs_required_type[$i] $ok -- "; |
89 |
|
|
90 |
|
} |
91 |
|
} else { |
92 |
|
print "<!-- no inputs required -->"; |
93 |
|
} |
94 |
|
return $ok; |
95 |
|
} |
96 |
|
|
97 |
?> |
?> |