topical media & game development
professional-search-07-seophp-include-rss-factory.inc.php / php
<?php
// load social bookmarking helper class
require_once 'social_bookmarking.inc.php';
class RSSFactory
{
var _link;
var _language;
var str)
{
translation as value)
{
key] = '&#' . ord(translation[chr(38)] = '&';
return preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/","&",
strtr(translation));
}
// the class constructor is executed when creating an instance of the class
function RSSFactory(link, language = 'en-us', this->_title = this->_link = this->_description = this->_language = this->_items = title, description, this->_items[] =
array_merge(array('title' => link,
'description' => additional_fields);
}
// generates feed
function get()
{
// initial preparations
ob_start();
header('Content-type: text/xml');
// generate feed header
echo '<rss version="2.0">' .
'<channel>' .
'<title>' . RSSFactory::_escapeXML(this->_link) . '</link>' .
'<description>' .
RSSFactory::_escapeXML(this->_items as feed_item as item_value)
{
// add social bookmarking icons to feed description
if (social = new SocialBookmarking(feed_item['title'],
item_value = social->getFeedHTML();
}
// output feed item
echo "<item_value) .
"</
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.