include("include.php3"); ?>
$newsgroups = "/var/lib/news/newsgroups";
if (file_exists($newsgroups)) {
$fd = fopen ($newsgroups, "r");
while($line=fgets($fd,4096)) {
$line=explode("\t",ereg_replace("^([a-z\\.-]+)[ \t]+","\\1\t",$line));
$descr[$line[0]]=$line[1];
}
}
$active = "/var/lib/news/active";
if (!file_exists($active)) {
openbox("black","#ffaaaa");
?> Could not open active file ... sorry
} else {
$fd = fopen ($active, "r");
openbox("#888888","white");
/* on parse les headers et on chipe tout ce qui est intéressant */
while($line=fgets($fd,4096)) {
if(!ereg("^(control|junk)",$line) and !(ereg("^ecp\\.",$line) and (substr($REMOTE_ADDR,0,7)!="138.195"))) {
$line = substr($line,0,-1);
$entities = explode(" ",$line);
?>
echo $entities[0]; ?>
-
echo $descr[$entities[0]]; ?>
}
}
?>
}
closebox();
?>
VIA's little usenet browser is still pre-alpha. Feel free to send comments to Sam