CMS ultra léger au style oldschool, projet de la communauté Kalaïn Hundin.

rss.php 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. require_once 'user/config.php';
  3. $page_name=$meta_description;
  4. session_start();
  5. $sql1="SELECT * FROM blog_config";
  6. $bloginfo_rss_req = $dbh->query($sql1) or die('Erreur SQL !<br />'.$sql1.'<br />'.mysql_error());
  7. $bloginfo_rss = $bloginfo_rss_req->fetch(PDO::FETCH_ASSOC);
  8. echo "<?xml version='1.0' encoding='ISO-8859-1'?>
  9. <rss version='2.0'>
  10. <channel>
  11. <title>".$site_name."</title>
  12. <link>http://www.monsite.com</link>
  13. <description>{$bloginfo_rss["description"]}</description>";
  14. $sql_rss="SELECT * FROM article ORDER BY id_article DESC LIMIT 20";
  15. $req_rss = $dbh->query($sql_rss) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
  16. while($data_rss=$req_rss->fetch(PDO::FETCH_ASSOC))
  17. {
  18. $titre_article_rss=stripslashes($data_rss["titre"]);
  19. $article_desc=strip_tags($data_rss['article']);
  20. $description_rss=stripslashes($article_desc);
  21. //$article_desc = strip_tags($data_rss['article']);
  22. //
  23. //echo"{$data["titre"]}<///a><br />";
  24. //echo"<b>".$article_date_display." :</b> {$data["date"]}<br />";
  25. echo"
  26. <item>
  27. <title>{$titre_article_rss}</title>
  28. <link>{$root_path}?id={$data_rss["id_article"]}</link>
  29. <guid isPermaLink='false'>6</guid>
  30. <description>{$description_rss}</description>
  31. <pubDate>0000-00-00 00:00:00 GMT</pubDate>
  32. </item>";
  33. }
  34. echo"
  35. </channel>
  36. </rss>";
  37. ?>