--- results.php 2001/03/03 12:56:33 1.4 +++ results.php 2001/03/05 15:06:53 1.5 @@ -13,22 +13,23 @@ $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");