--- new.php 2001/02/23 15:42:52 1.6 +++ new.php 2001/02/28 09:48:31 1.8 @@ -18,6 +18,10 @@ $lpic="investor"; $lext=".jpg"; $mpic="investors.gif"; $back_url="investor.php"; +} elseif ($section == "about") { + $title="ABOUT US"; + $lpic="about"; $lext=".gif"; + $mpic="about.gif"; } else { $title="What's New"; $lpic="new"; $lext=".jpg"; @@ -25,7 +29,7 @@ $back_url="index.php"; } -$smarty->assign( array ( lpic=>$lpic, lext=>$lext, mpic=>$mpic, Section_title=>$title ) ); +$smarty->assign( array ( lpic=>$lpic, lext=>$lext, mpic=>$mpic, ) ); $sql_where="where visible is true"; @@ -50,8 +54,13 @@ if (isset($type)) { if ($type == "n") { $sql_where .= " and type='n'"; + $title.=" : News"; } elseif ($type == "e") { $sql_where .= " and type='e'"; + $title.=" : Events"; + } elseif ($type == "c") { + $sql_where .= " and type='c'"; + $title.=" : Community"; } } @@ -65,9 +74,9 @@ $num_selected=0; $sql="select id,upper(title) as title,town_date,body,more,pdf, - (date-now()::date) as comming + (date-now()::date) as comming,type,title as title_lc from news $sql_where order by priority desc,date desc $sql_limit"; - print "$sql"; +# print "$sql"; $sth = $dbh->prepare("$sql"); $sth->execute(); while ($row=$sth->fetchrow_hash()) { @@ -88,6 +97,18 @@ )); } + if (isset($id) && $num_selected == 1) { + if ($data[0][type] == "n") { + $title.=" : News : ".$data[0][title_lc]; + } elseif ($data[0][type] == "e") { + $title.=" : Event : ".$data[0][title_lc]; + } elseif ($data[0][type] == "c") { + $title.=" : Community : ".$data[0][title_lc]; + } elseif ($data[0][type] == "r") { + $title.=" : Result : ".$data[0][title_lc]; + } + } + $smarty->assign("data",$data); $main=$smarty->fetch("new.tpl"); @@ -103,7 +124,8 @@ } include("common.inc"); -$smarty->assign( array(back_url=>$back_url, MAIN=>$main)); +$smarty->assign( array(back_url=>$back_url, MAIN=>$main, + Section_title=>$title ) ); $smarty->display("index.tpl"); ?>