--- new.php 2001/04/09 13:30:14 1.15 +++ new.php 2002/04/30 13:26:33 1.27 @@ -6,38 +6,30 @@ $smarty->assign( array ( Title=>"Pliva d.d." ) ); - if (isset($from)) { $section=$from; } else { $section="new"; } -$sql_where="where visible is true"; +$sql_where="where $visible_is_true"; + +include("section.inc"); if ($section == "investor") { - $title="INVESTOR'S PAGE"; - $lpic="investor"; $lext=".jpg"; - $mpic="investors.gif"; $back_url="investor.php"; if (! isset($type)) { $sql_where .= " and type='i'"; } - $title.=" : Investors News"; -} elseif ($section == "about") { - $title="ABOUT US"; - $lpic="about"; $lext=".gif"; - $mpic="about.gif"; } else { - $title="What's New"; - $lpic="new"; $lext=".jpg"; - $mpic="new.gif"; $back_url="index.php"; + $sql_where.=" and (type='a' or type='c' or type='e' or type='f' or type='i' or type='n' or type='p' or type='r')"; // don't show company profile } $smarty->assign( array ( lpic=>$lpic, lext=>$lext, mpic=>$mpic, ) ); include("find_html_file.inc"); +include("news_type.inc"); if (file_exists(find_html_file("news",$more))) { @@ -52,13 +44,12 @@ if (isset($type)) { if ($type == "n") { $sql_where .= " and (type='n' or type='i')"; - $title.=" : News"; } elseif ($type == "e") { - $sql_where .= " and type='e'"; - $title.=" : Events"; + $sql_where .= " and (type='e' or type='f')"; + } elseif ($type == "f") { + $sql_where .= " and type='f'"; } elseif ($type == "c") { $sql_where .= " and type='c'"; - $title.=" : Community"; } } @@ -95,6 +86,7 @@ if ($num_selected == 10) { $tmp="$PHP_SELF?start=".($start+10); if ($days) $tmp.="&days=$days"; + if ($from) $tmp.="&from=$from"; $smarty->assign(array( "multi_page_show" => 1, "multi_page_next" => $tmp @@ -103,6 +95,7 @@ if ($start && $start >= 10) { $tmp="$PHP_SELF?start=".($start-10); if ($days) $tmp.="&days=$days"; + if ($from) $tmp.="&from=$from"; $smarty->assign(array( "multi_page_show" => 1, "multi_page_prev" => $tmp @@ -110,19 +103,7 @@ } 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]; - } elseif ($data[0][type] == "i") { - $title.=" : Investors News : ".$data[0][title_lc]; - } elseif ($data[0][type] == "a") { - $title.=" : Annual Report : ".$data[0][title_lc]; - } + $title.=" : ".$news_type[ $data[0][type] ]." : ".$data[0][title_lc]; }