';
$xml .= '';
$xml .= '';
$xml .= ''.$Site->title().'';
$xml .= ''.$Site->url().'';
$xml .= ''.$Site->description().'';
$posts = buildPostsForPage(0, 10, true);
foreach($posts as $Post)
{
$xml .= '- ';
$xml .= ''.$Post->title().'';
$xml .= ''.$Post->permalink(true).'';
$xml .= ''.$Post->description().'';
$xml .= '
';
}
$xml .= '';
// New DOM document
$doc = new DOMDocument();
// Friendly XML code
$doc->formatOutput = true;
$doc->loadXML($xml);
$doc->save(PATH_PLUGINS_DATABASES.$this->directoryName.DS.'rss.xml');
}
public function install($position = 0)
{
parent::install($position);
$this->createXML();
}
public function afterPostCreate()
{
$this->createXML();
}
public function afterPageCreate()
{
$this->createXML();
}
public function afterPostModify()
{
$this->createXML();
}
public function afterPageModify()
{
$this->createXML();
}
public function afterPostDelete()
{
$this->createXML();
}
public function afterPageDelete()
{
$this->createXML();
}
public function siteHead()
{
$html = ''.PHP_EOL;
return $html;
}
public function beforeRulesLoad()
{
global $Url;
if( $Url->uri() === HTML_PATH_ROOT.'rss.xml' )
{
// Send XML header
header('Content-type: text/xml');
// New DOM document
$doc = new DOMDocument();
// Load XML
libxml_disable_entity_loader(false);
$doc->load(PATH_PLUGINS_DATABASES.$this->directoryName.DS.'rss.xml');
libxml_disable_entity_loader(true);
// Print the XML
echo $doc->saveXML();
// Stop Bludit running
exit;
}
}
}