<?php
header("Content-Type: application/rss+xml"); echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>

<rss version=\"2.0\">
<channel>
  <language>de</language>";

include("config.inc.php"); mysql_connect("$dbserver","$dbuser","$dbpass"); mysql_select_db($dbdata); $geteinst=mysql_query("SELECT * FROM ".$dbx."_einstellungen"); $cdb=array(); while($dbe=mysql_fetch_array($geteinst)) $cdb[$dbe[vari]]=$dbe[wert]; $rss=explode("_",addslashes(htmlspecialchars($_GET[rss]))); $rss2=$rss[1]; $rss=$rss[0]; if($rss=="events") { $getdb=mysql_query("SELECT * FROM ".$dbx."_events ORDER BY id DESC LIMIT 0,10"); echo "
  <title>Events</title>
  <link>http://".$cdb[url]."?d=events</link>
  <description>Event-Kalender</description>"; while($db = @mysql_fetch_array($getdb)) { echo "
<item>
  <title>".str_replace("&","&amp;",htmlentities($db[titel]))."</title>
  <link>http://".$cdb[url]."?d=events&amp;s=".$db[id]."</link>
  <description>".str_replace("&","&amp;",htmlentities($db[cont]))."</description>
  <pubDate>".date("D, j M Y G:i:s T",$db[datumvon])."</pubDate>
</item>
"; }} elseif($rss=="blogs") { $getbb=mysql_query("SELECT * FROM ".$dbx."_blogs WHERE id='".$rss2."'"); $bb = @mysql_fetch_array($getbb); $getdb=mysql_query("SELECT * FROM ".$dbx."_blogs_data WHERE blog='".$rss2."' ORDER BY datum DESC LIMIT 0,10"); echo "
  <title>".str_replace("&","&amp;",htmlentities($bb[titel]))."</title>
  <link>http://".$cdb[url]."?d=blogs&amp;s=".$bb[id]."</link>
  <description>".str_replace("&","&amp;",htmlentities($bb[cont]))."</description>"; while($db = @mysql_fetch_array($getdb)) { echo "
<item>
  <title>".str_replace("&","&amp;",htmlentities($db[titel]))."</title>
  <link>http://".$cdb[url]."?d=events&amp;s=".$bb[id]."&amp;u=".$db[id]."</link>
  <description>".str_replace("&","&amp;",htmlentities(strip_tags($db[cont])))."</description>
  <pubDate>".date("D, j M Y G:i:s T",$db[datum])."</pubDate>
</item>
"; }} ?></channel>
</rss>