<?php

$site_id = 'boysrepublic';
$page_id = 'news';

if (!defined("MNMURL")) define("MNMURL", "/home/lib/monolyth/");

if (!defined("ROOT")) define("ROOT", '');

$language_default = 2; // English

require_once(MNMURL."monolyth.lib");

$news = new News();
$items = $news->get_items(10);
$rss = new RSS();
$rss->channel->description->contents('RSS feed for news on Dutch rock group Boys Republic');
$rss->channel->title->contents('Boys Republic :.:.: T H E   N E W S :.:.:');
$rss->channel->managingeditor->contents('marijn@boysrepublic.nl');
$rss->channel->webmaster->contents('marijn@boysrepublic.nl');
$i = 5;
$page = 0;
foreach ($items as $item) {
	if ($i++ % 5 == 0) $page++;
	if ($i == 15) break;
	$item = $news->data[2][$item];
	//$rss->add_item($item->header, '/news.php?page='.$page, str_replace(N, ' ', preg_replace('/<a(.*)><img(.*)><\/a>/', '', $item->text)), date('D, d M Y H:i:s T', $item->rawdate));
	$text = array_chunk(explode(' ', strip_tags(str_replace(array("\R", N, BR), ' ', $item->text))), 50); // first fifty words only!
	$text = implode(' ', $text[0]).'...';

	$rss->add_item(strip_tags($item->header), '/news.php?page='.$page, $text, date('D, d M Y H:i:s T', strtotime($item->date)));
//		$string = preg_replace('/\[b*\](.*)\[\/b*\]/', "<b>\\1<\/b>", $string);

}
$rss->publish();
?>

