--- results.php 2001/02/28 18:00:26 1.3 +++ results.php 2001/03/05 15:06:53 1.5 @@ -9,25 +9,27 @@ $section="investor"; $title="INVESTOR'S PAGE"; +if ($menu_item) $title.=" : $menu_item"; $lpic="investor"; $lext=".jpg"; $mpic="investors.gif"; -if ($part && file_exists("templates/$part.tpl")) { - $main_file=$part; -} else { - $main_file="results"; -} +$main_file="results"; $smarty->assign( array ( lpic=>$lpic, lext=>$lext, mpic=>$mpic, Section_title=>$title ) ); - $sql="select id,title,pdf from news where type='r' and visible order by priority desc,date desc"; +if (! $type) $type="r"; + +$sql="select id,title,pdf from news where type='$type' and visible order by priority desc,date desc"; # print "$sql"; - $sth = $dbh->prepare("$sql"); - $sth->execute(); - while ($row=$sth->fetchrow_hash()) { - $results[]=$row; - } - $smarty->assign("results",$results); +$sth = $dbh->prepare("$sql"); +$sth->execute(); +while ($row=$sth->fetchrow_hash()) { + $results[]=$row; +} +$smarty->assign(array( + results=>$results, + type=>$type + )); $main=$smarty->fetch("$main_file.tpl");