<?PHP

error_reporting (E_ALL ^E_NOTICE);
require_once("./inc/functions.inc.php");
require_once("./data/config.php");
//$PHP_SELF = "";

if($id != ""){

   if($archive != ""){ $news_file = "./archives/$archive.news.arch"; }
   else{ $news_file = "./data/news.txt"; }

$all_news = file("$news_file");
   $found = FALSE;
   foreach($all_news as $news_line){
    $news_arr = explode("|", $news_line);
       if($news_arr[0] == $id){ $found = TRUE; break;}
   }
   if($found == TRUE){
 $title = $news_arr[2];
       $date = date("j F Y h:i A", $news_arr[0]);
       if($news_arr[4] != ""){
        $news = replace_news("show", $news_arr[4]);
 }else{
        $news = replace_news("show", $news_arr[3]);
       }

echo<<<PRINTABLE
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>nca Malabocca - $title</title>
</HEAD>
<BODY bgcolor="#ffffff" text="#000000" onload="window.print()">

<b>$title</b> @ <small>$date</small>
<hr>
Articolo stampato dal sito del <b>nca Malabocca</b> - www.inventati.org/malabocca - No copyright
<hr>
$news


</BODY>
</HTML>
PRINTABLE;



   }else{
    echo"The news you what to print was not found.";
}

}else{ echo"No"; }

?>
