<?php
include($_SERVER['DOCUMENT_ROOT'].'/dateien/basis.php');
header('Content-Type: application/rss+xml; charset=UTF-8');
echo '<?xml version="1.0" encoding="UTF-8" ?>'."\r\n";
?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>

<title>TextTexturen</title>
<description><?php echo $beschreibungAllerlei; ?></description>
<link>http://<?php echo $_SERVER['HTTP_HOST']; ?>/</link>
<language>de</language>
<copyright><?php
$copy = preg_split('/,/', $copyright);
echo $copy[0];
?>, Nico Dorn</copyright>
<lastBuildDate><?php
foreach ($texte as $w) {
	echo $w['pubDate'];
	break;
}
?></lastBuildDate>
<image>
<title>TextTexturen</title>
<link>http://<?php echo $_SERVER['HTTP_HOST']; ?>/</link>
<url>http://<?php echo $_SERVER['HTTP_HOST']; ?>/bilder/texttexturen.gif</url>
<width>144</width>
<height>20</height>
</image>
<atom:link href="http://<?php echo $_SERVER['HTTP_HOST']; ?>/rss.xml" rel="self" type="application/rss+xml" />

<?php
$i = 1;
$output = '';
foreach ($texte as $s => $w) {
	if ($i <= 10) {
		$output .= '<item>';
		$output .= '<title>'.preg_replace('/<abbr.*?>|<\/abbr>|<acronym.*?>|<\/acronym>/', '', preg_replace('/<\/cite>|<\/q>/', '«', preg_replace('/<cite.*?>|<q.*?>/', '»', $w['titel']))).'</title>';
		$output .= '<description><![CDATA[';
		$output .= $w['abstract'];
		$output .= ']]></description>';
		$output .= '<link>http://'.$_SERVER['HTTP_HOST'].'/'.$w['bereich'].'/'.$s.'/</link>';
		$output .= '<guid>http://www.texttexturen.de/'.$w['bereich'].'/'.$s.'/</guid>';
		$output .= '<pubDate>'.$w['pubDate'].'</pubDate>';
		$output .= '</item>'."\r\n";
		$i++;
	} else {
		break;
	}
}
echo $output;
?>

</channel>
</rss>