--- inc/common.inc 2001/02/22 21:07:44 1.5 +++ inc/common.inc 2001/09/18 10:38:55 1.14 @@ -1,10 +1,15 @@ 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"); $sth->execute(); while ($row=$sth->fetchrow_hash()) { $menu[]=$row; @@ -14,14 +19,14 @@ // fetch news -$sth = $dbh->prepare("select id,title from news where type='n' and visible order by date desc limit 5"); +$sth = $dbh->prepare("select id,title from news where type<>'e' and type<>'p' and $visible_is_true order by date desc limit 5"); $sth->execute(); while ($row=$sth->fetchrow_hash()) { $news[]=$row; } $smarty->assign("news",$news); -$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='e' and $visible_is_true order by priority desc,date desc limit 5"); $sth->execute(); while ($row=$sth->fetchrow_hash()) { $events[]=$row; @@ -52,6 +57,7 @@ } if ($show) { $smarty->assign(array( + "multi_page_show" => 1, "multi_page"=>$multi_page, "multi_page_current"=>($current+1), "multi_page_max"=>$max, @@ -62,4 +68,24 @@ } +function check_required() { + global $inputs_required; + global $inputs_required_type; + $ok=1; + if (isset($inputs_required)) { + foreach ($inputs_required as $i) { + if (! isset($GLOBALS[$i]) || $GLOBALS[$i] == "") $ok=0; + switch (strtolower($inputs_required_type[$i])) { + case 'email': + if (!strstr($GLOBALS[$i],'@')) $ok=0; + } +// print "$i: $GLOBALS[$i] type: $inputs_required_type[$i] $ok -- "; + + } + } else { + print ""; + } + return $ok; +} + ?>