<?php
function lecteur_rss($file) {
	$max=3;
	print "<div id='lecteur_rss'>\n<ul>\n";
	## affichage flux
	$raw=@file_get_contents($file);
	if ($raw){
		if (eregi("<item(.*)</item>",$raw,$rawitems)){
			$items=explode("<item",$rawitems[0]);
			$nb=count($items);
			$maximun=(($nb-1)<$max) ? ($nb-1) : $max;
			for ($i=0;$i<$maximun;$i++){
				eregi("<title>(.*)</title>",$items[$i+1],$title);
				eregi("<description>(.*)</description>",$items[$i+1],$description);
				eregi("<link>(.*)</link>",$items[$i+1],$link);
				print '<li> <a href="'.$link[1].'" title="'.$title[1].'">'.$title[1].'</a> <p>'.unhtmlentities($description[1]).'</p></li>';
			}
		}else print "<li>&nbsp;</li>\n";
	}
	else print "<li>&nbsp;</li>\n";
	print "</ul>\n</div>\n";
 }
?>