<?
include("include/feedcreator.class.php");
include_once("admin/include/config.php");
$rss = new UniversalFeedCreator();
$rss->useCached();
$rss->link = "http://www.entinoprofit.org/rss.php";
$rss->syndicationURL = "http://www.entinoprofit.org/rss.php";
if(isset($_GET['id']) && ereg("^[0-9]+$",$_GET['id']) == true) {
$id = mysql_escape_string($_GET['id']);
$res = mysql_query("SELECT id,titolo,testo,date FROM news WHERE idclub = $id ORDER BY id DESC LIMIT 50");
$risultato2 = mysql_query('SELECT id,nome,alias FROM club_list WHERE id = '.$id.'') or die(mysql_error());
$array2 = mysql_fetch_array($risultato2, MYSQL_BOTH);
$rss->title = "".$array2['nome']." | ACSI Padova RSS";
$rss->description = "Feed del sito ACSI Padova";
} else {
$res = mysql_query("SELECT id,titolo,testo,date FROM news WHERE acsi = '1' ORDER BY id DESC LIMIT 50");
$rss->title = "ACSI Padova RSS";
$rss->description = "Feed del sito ACSI Padova";
}
$ore = 00;
$minuti = 00;
$secondi = 0;
// get your news items from somewhere, e.g. your database:
while ($data = mysql_fetch_object($res)) {
$item = new FeedItem();
$item->title = stripslashes($data->titolo);
$item->link = "http://www.entinoprofit.org/news.php?id=".$data->id ;
$item->description = stripslashes(cutHtmlText($data->testo,150,'...',false, false, false));
list($anno, $mese, $giorno) = explode("-", $data->date);
$item->date = mktime(date('H'), date('i'), date('s'), $mese, $giorno, $anno);
$item->pubDate = mktime($ore, $minuti, $secondi, $mese, $giorno, $anno);
$item->source = "http://www.entinoprofit.org";
$item->author = "ACSI Padova";
$item->authorEmail = "webmaster@acsipadova.it";
$rss->addItem($item);
}
//$rss->saveFeed("RSS1.0", "news/feed.xml");
if ($_GET['type'] == 'atom') {
$rss->outputFeed("ATOM1.0");
//$feed->saveFeed("ATOM1.0", "news/feed.xml");
} else if ($_GET['type'] == 'atom0'){
$rss->outputFeed("ATOM0.3");
} else if ($_GET['type'] == 'rss2.0'){
$rss->outputFeed("RSS2.0");
} else {
$rss->outputFeed("RSS");
}
?>