14 |
|
|
15 |
// fetch news |
// fetch news |
16 |
|
|
17 |
$sth = $dbh->prepare("select id,title from news where type='n' and visible order by id desc limit 5"); |
$sth = $dbh->prepare("select id,title from news where type<>'e' and type<>'p' 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 id desc limit 5"); |
$sth = $dbh->prepare("select id,title from news where type='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; |
52 |
} |
} |
53 |
if ($show) { |
if ($show) { |
54 |
$smarty->assign(array( |
$smarty->assign(array( |
55 |
|
"multi_page_show" => 1, |
56 |
"multi_page"=>$multi_page, |
"multi_page"=>$multi_page, |
57 |
"multi_page_current"=>($current+1), |
"multi_page_current"=>($current+1), |
58 |
"multi_page_max"=>$max, |
"multi_page_max"=>$max, |
63 |
|
|
64 |
} |
} |
65 |
|
|
66 |
|
function check_required() { |
67 |
|
global $inputs_required; |
68 |
|
global $inputs_required_type; |
69 |
|
$ok=1; |
70 |
|
if (isset($inputs_required)) { |
71 |
|
foreach ($inputs_required as $i) { |
72 |
|
if (! isset($GLOBALS[$i]) || $GLOBALS[$i] == "") $ok=0; |
73 |
|
switch (strtolower($inputs_required_type[$i])) { |
74 |
|
case 'email': |
75 |
|
if (!strstr($GLOBALS[$i],'@')) $ok=0; |
76 |
|
} |
77 |
|
// print "$i: $GLOBALS[$i] type: $inputs_required_type[$i] $ok -- "; |
78 |
|
|
79 |
|
} |
80 |
|
} else { |
81 |
|
print "<!-- no inputs required -->"; |
82 |
|
} |
83 |
|
return $ok; |
84 |
|
} |
85 |
|
|
86 |
?> |
?> |