Advertisement
Syntafin

rss.php Antribute

Feb 24th, 2012
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.49 KB | None | 0 0
  1. <?php header("Content-type: text/xml");
  2. echo '<'.'?xml version="1.0" encoding="UTF-8"?'.'>'; ?>
  3. <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  4.  
  5. <channel>
  6.     <title>Antribute.eu</title><!-- Feed Titel -->
  7.     <language>de</language><!-- Language -->
  8.     <link>http://antribute.eu</link><!-- Adresse woher der Feed kommt -->
  9.     <description>Pay you Tribute to the Chaos ~ Next Generation beginn</description><!-- Beschreibung des Feeds -->
  10.     <copyright>Copyright <?php date(y); ?> antribute.eu</copyright><!-- Copyright -->
  11.  
  12. <?php
  13. include('config.php');
  14. $sql = "SELECT * FROM blog ORDER BY id DESC LIMIT 0, 5";
  15. mysql_query("SET NAMES 'utf8'");
  16.     $entry = mysql_query($sql,$datenbank) or die(mysql_error());
  17.     while($blog = mysql_fetch_object($entry))
  18.     {
  19.     $id = $blog->id;
  20.     $autor = $blog->autor;
  21.     $title = $blog->title;
  22.     $news = $blog->text;
  23.     $pubdate = strtotime($row['datum']);
  24.     $pubdate = date(r, $pubdate);  
  25. ?>
  26.     <item>
  27.         <title><?php echo $title; ?></title>
  28.         <link>http://antribute.eu/?p=blog&amp;mode=view&amp;id=<?php echo $id; ?></link>
  29.         <guid isPermaLink="false">http://antribute.eu/?p=blog&amp;mode=view&amp;id=<?php echo $id; ?></guid>
  30.         <author><?php echo $autor; ?></author>
  31.         <pubDate><?php echo $pubdate; ?></pubDate>
  32.         <?php if(mb_strlen($news,'utf-8') > 200){$text = mb_substr($news,0,200,'utf-8');} ?>
  33.         <description><![CDATA[ <?php echo $news; ?> ]]></description>
  34.     </item>
  35. <?php } /* close while*/ ?>
  36.  
  37. </channel>
  38. </rss>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement