ciao io la classe la chiamo cosi :
Codice PHP:
require_once(DIR."/class/feedcreator.class.php");
header("Content-type: text/xml");
$artid = isset($_GET['article'])?$_GET['article']:'';
$getart = GetArticlesFromId($artid);
$rss = new UniversalFeedCreator();
$rss->useCached();
$rss->title = $settings['pathcms'];
$rss->description = "Feed del blog di Maurizio";
$rss->link = $settings['pathcms']; //Questo non viene reso nel feed, sarà un bug
$rss->feedURL = $settings['pathcms']."feedrss/index.php";
//Questa funzione rimpiazza alcuni caratteri speciali con le relative entità XML
//serve per evitare errori nell'output
function xmlentities ( $string ) {
$ar1 = array ( '&' , '"', ''' , '<' , '>' );
$ar2 = array ( '&', '"', "’", '<', '>' ) ;
return str_replace ( $ar1 , $ar2, $string );
}
//Questo ciclo che estrae le notizie dal DB e le inserisce come nuovo ITEM nel feed
//I campi da cui estraggo le notizie si chiamano 'subject', 'content', 'cat', e 'pubdate'
//ma nel vostro caso i nomi potrebbero essere differenti, e alcuni campi assenti
//(come Author nel mio caso)
//E infine l'output a video.
echo $rss->createFeed("RSS2.0", "");