Advertisement
Guest User

Untitled

a guest
Apr 24th, 2012
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
  2. <?php header("Content-type: text/xml");
  3. echo '<'.'?xml version="1.0" encoding="ISO-8859-1"?'.'>'; ?>
  4. <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  5.  
  6. <channel>
  7. <title>HeroFire.de RSS-Feeds</title>
  8. <language>de</language>
  9. <link>http://HeroFire.net</link>
  10. <description>News,Event,User</description>
  11. <copyright>Copyright <?php date(y); ?> HeroFire.net</copyright>
  12.  
  13. <?php
  14.  
  15. require_once('./_config/core.php');
  16.  
  17.  
  18. // Datenbankabfrage
  19. $query = "SELECT id, author, title, shortstory, published FROM cms_news ORDER BY id DESC LIMIT 2";
  20. $result = mysql_query($query) or die (mysql_error());
  21.  
  22. // Ausgabe der Daten
  23. while ($row = mysql_fetch_array($result)){
  24. $id = $row['id'];
  25. $title = $row['title'];
  26. $shortstory = $row['shortstory'];
  27. $published = strtotime($row['date']);
  28.  
  29. ?>
  30. <item>
  31. <title><?php echo $title; ?></title>
  32. <link>http://herofire.net/articles/<?php echo $id; ?></link>
  33. <guid isPermaLink="false">http://herofire.net/articles</guid>
  34. <pubDate>Geschrieben am: <?php echo date('d.m.Y'); ?></pubDate>
  35. <description><![CDATA[ <?php echo $shortstory; ?> ]]></description>
  36. </item>
  37. <?php } /* close while*/ ?>
  38.  
  39. </channel>
  40. </rss>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement