useCached(); $rss->title = "La Gazzetta di Rennes-le-Château"; $rss->description = "Feed della Gazzetta di Rennes-le-Château"; $rss->link = "http://www.renneslechateau.it/rennes-le-chateau.php?sezione=gazzetta"; $rss->feedURL = "http://www.renneslechateau.it/rss/index.php"; function xmlentities ( $string ) { $ar1 = array ( '&' , '"', ''' , '<' , '>', '«', '»' ); $ar2 = array ( '&', '"', "’", '<', '>', '"', '"' ) ; return str_replace ( $ar1 , $ar2, $string ); } $name=Array(); $files=Array(); $img=Array(); $prefissi=Array("pp"=>"Primo piano","rlc"=>"Notizie da Rennes-le-Château", "mammaoca"=>"Les Contes de Mammaoca","indy"=>"I racconti di Indiana Mauro"); foreach($prefissi as $prefix=>$cat) { $d = dir("../news/$prefix"); while ($entry = $d->read()) { if(substr($entry,-3)=="txt") { $name[]=$entry; $files[]="../news/$prefix/$entry"; $img[]=substr($entry,0,strlen($entry)-4); $category[]=$cat; $pref[]=$prefix; } } $d->close(); } array_multisort($name,SORT_DESC,$files,$img,$category,$pref); $item = new FeedItem(); for($i=0;$ititle = xmlentities($f[1]); $item->link = "http://www.renneslechateau.it/rennes-le-chateau.php?sezione=gazzetta&tipo=".$pref[$i]."&articolo=".$name[$i]; if($pref[$i]=="pp") { $item->description = xmlentities($f[3]); } else { $item->description = xmlentities($f[2]); } $item->category = xmlentities($category[$i]); $item->date = gmmktime(0, 0, 0, round(substr($name[$i],4,2)), round(substr($name[$i],6,2)), round(substr($name[$i],0,4))); $item->author = "(tomatismariano@hotmail.com) Mariano Tomatis"; $item->descriptionHtmlSyndicated = true; $item->categoryHtmlSyndicated = true; //$item->descriptionTruncSize = 500; $rss->addItem($item); } echo $rss->createFeed("RSS2.0", ""); ?>