formatOutput = true; $roo = $xml->createElement('rss'); $roo->setAttribute('version', '2.0'); $roo->setAttribute('xmlns:atom', 'http://www.w3.org/2005/Atom'); $xml->appendChild($roo); $cha = $xml->createElement('channel'); $roo->appendChild($cha); $r2 = $xml->createElement('atom:link'); $r2->setAttribute('href', 'http://www.darkplaces.org'.$_SERVER['REQUEST_URI']); $r2->setAttribute('rel', 'self'); $r2->setAttribute('type', 'application/rss+xml'); $cha->appendChild($r2); $hea = $xml->createElement('title', utf8_encode('Darkplaces.org')); $cha->appendChild($hea); $hea = $xml->createElement('link', htmlentities('http://darkplaces.org')); $cha->appendChild($hea); $hea = $xml->createElement('copyright', 'Alex Ries'); $cha->appendChild($hea); if ($_GET['language']=="de") { $hea = $xml->createElement('description', utf8_encode($rss_desc_de)); } if ($_GET['language']=="fr") { $hea = $xml->createElement('description', utf8_encode($rss_desc_fr)); } $cha->appendChild($hea); $hea = $xml->createElement('image'); $h2 = $xml->createElement('url', htmlentities('http://www.darkplaces.org/'.$banner)); $hea->appendChild($h2); $h2 = $xml->createElement('title',utf8_encode('Darkplaces.org')); $hea->appendChild($h2); $h2 = $xml->createElement('link',htmlentities('http://darkplaces.org')); $hea->appendChild($h2); $cha->appendChild($hea); //var_dump($filteredlist); $conn_id = @mysql_connect($datenbankserver, $datenbankuser, $datenbankpasswort); @mysql_select_db($datenbankname,$conn_id); $result = mysql_query("select * from news order by timestamp DESC limit 10"); $c = 0; while (($row = mysql_fetch_object($result))&&($c<10)) { $c = $c + 1; //echo $row->description_de."
"; $itm = $xml->createElement('item'); // $itm->setAttribute('guid', crc32("$row->title_de")); if ($_GET['language']=="de") { $hea = $xml->createElement('title', utf8_encode(html_entity_decode(html_entity_decode($row->title_de)))); } if ($_GET['language']=="fr") { $hea = $xml->createElement('title', utf8_encode(html_entity_decode(html_entity_decode($row->title_fr)))); } $itm->appendChild($hea); $hea = $xml->createElement('pubDate', utf8_encode(date("D, j M Y H:i:s ",$row->timestamp).'GMT')); $itm->appendChild($hea); if ($_GET['language']=="de") { if ($row->thumbnail!=null) { $hea = $xml->createElement('description', utf8_encode(htmlentities(html_entity_decode($row->description_de))."

thumbnail."\"/>")); } else { $hea = $xml->createElement('description', utf8_encode(htmlentities(html_entity_decode($row->description_de)))); } } if ($_GET['language']=="fr") { if ($row->thumbnail!=null) { $hea = $xml->createElement('description', utf8_encode(htmlentities(html_entity_decode($row->description_fr))."

thumbnail."\"/>")); } else { $hea = $xml->createElement('description', utf8_encode(htmlentities(html_entity_decode($row->description_fr)))); } } $itm->appendChild($hea); if ($_GET['language']=="de") { if ($row->link_de!="") $hea = $xml->createElement('link', htmlentities($row->link_de)); $itm->appendChild($hea); $hea = $xml->createElement('guid', htmlentities($row->link_de)); $itm->appendChild($hea); } if ($_GET['language']=="fr") { if ($row->link_fr!="") $hea = $xml->createElement('link', htmlentities($row->link_fr)); $itm->appendChild($hea); $hea = $xml->createElement('guid', htmlentities($row->link_fr)); $itm->appendChild($hea); } $cha->appendChild($itm); } header("Content-Type: application/rss+xml"); print($xml->saveXML()); ?>