Advertisement
Syntafin

rss.php

Feb 18th, 2012
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.45 KB | None | 0 0
  1. <?php
  2.   header("Content-Type: application/rss+xml");  
  3.   echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>";
  4. ?>
  5.     <rss version="2.0">
  6.     <channel>
  7.     <title>Antribute.eu // Minecraft</title>
  8.     <link>http://mc.antribute.eu</link>
  9.     <description>Die Offizielle Seite des Minecraft-Servers von Antribute.eu</description>
  10.     <language>de-de</language>
  11.     <copyright>Copyright by Antribute.eu Projekt</copyright>
  12.     <image>
  13.     <url>http://antribute.eu/content/images/icon_512.png</url>
  14.     <link>http://mc.antribute.eu</link>
  15.     <width>80</width>
  16.     <height>80</height>
  17.     <description>Antribute.eu // Minecraft</description>
  18.     <title>Antribute.eu // Minecraft</title>
  19.     </image>
  20. <?php
  21.     include('config.php');
  22.     $sql = "SELECT * FROM news ORDER BY id DESC";
  23.     $entry = mysql_query($sql,$datenbank) or die(mysql_error());
  24.     while($news = mysql_fetch_object($entry))
  25.     {
  26. ?>
  27.     <item>
  28.     <title><?php echo $news->title ?>></title>
  29.     <link>http://mc.antribute.eu/?p=news&mode=view&id=<?php echo $news->id ?></link>
  30.     <guid>http://mc.antribute.eu/?p=news&mode=view&id=<?php echo $news->id ?></guid>
  31.     <description><?php if(strlen($news->text) >= 150) { $news->text=wordwrap($news->text,150); $news->text = substr($news->text,0,strpos($news->text,"\n")).'...'; } echo($news->text); ?></description>
  32.     <category><?php echo $news->cat ?></category>
  33.     <pubDate><?php echo $news->datum ?></pubDate>
  34.     </item>
  35. <?php } ?>
  36. </channel>
  37. </rss>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement