useCached(); $rss->title = "DNS Park System Status"; $rss->description = "Up to date status information for DNS Park"; $rss->link = "http://status.dnspark.net/"; $rss->syndicationURL = "http://status.dnspark.net/".$_SERVER["PHP_SELF"]; $image = new FeedImage(); $image->title = "DNS Park logo"; $image->url = "http://www.dnspark.com/images/dnspark.png"; $image->link = "http://www.dnspark.net/"; $rss->copyright = "Copyright 2007"; $image->description = "DNS Park system status update for all important events. Feed mirrored at http://status.dnspark.com/ and http://status.dnspark.net/."; $rss->image = $image; db_connect(); // get your news items from somewhere, e.g. your database: $res = $dbh->query("SELECT dp_newsid,DATE_FORMAT(dp_date,'%Y-%m-%dT%T+01:00') AS newsdate,dp_text,dp_title FROM dp_news WHERE dp_source='system-status' ORDER BY dp_date DESC"); // $res = $dbh->query("SELECT dp_newsid,UNIX_TIMESTAMP(dp_date) AS newsdate,dp_text,dp_title FROM dp_news ORDER BY dp_date DESC"); while ($data = mysql_fetch_object($res)) { $text = str_replace( "\n", "
\n", $data->dp_text ); // print "
"; print_r( $data ); print "
"; $item = new FeedItem(); $item->link = "http://status.dnspark.net/#". $data->dp_newsid; if ( empty( $data->dp_title ) ) { $item->title = $text; } else { $item->title = $data->dp_title; } $item->date = $data->newsdate; $item->description = $text; // $item->author = "DNS Park Support"; $rss->addItem($item); } $rss->saveFeed("RSS2.0", "rss2.xml"); // $rss->saveFeed("HTML", ""); ?>