--- inc/common.inc 2001/06/25 09:57:25 1.1 +++ inc/common.inc 2001/07/02 06:55:32 1.6 @@ -4,7 +4,14 @@ // fetch menu -$sth = $dbh->prepare("select item,url,file from menu where section='$section' order by num"); +if (!isset($m)) { + $m=$section; +} else { + $smarty->assign("m_session","m=$m&"); + $smarty->assign("m_form_session",""); +} + +$sth = $dbh->prepare("select item,url,file,w,h from menu where section='$m' and visible order by num"); $sth->execute(); while ($row=$sth->fetchrow_hash()) { $menu[]=$row; @@ -14,14 +21,14 @@ // fetch news -$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"); $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 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"); $sth->execute(); while ($row=$sth->fetchrow_hash()) { $events[]=$row;