View file news/rss.php

File size: 2.44Kb
  1. <?php
  2. #-----------------------------------------------------#
  3. # ********* ROTORCMS ********* #
  4. # Made by : VANTUZ #
  5. # E-mail : visavi.net@mail.ru #
  6. # Site : http://pizdec.ru #
  7. # WAP-Site : http://visavi.net #
  8. # ICQ : 36-44-66 #
  9. # Вы не имеете право вносить изменения в код скрипта #
  10. # для его дальнейшего распространения #
  11. #-----------------------------------------------------#
  12. require_once "../includes/start.php";
  13. require_once "../includes/functions.php";
  14. require_once "../includes/header.php";
  15.  
  16. header("Content-type:application/rss+xml; charset=utf-8");
  17. echo '<?xml version="1.0" encoding="utf-8" ?>';
  18. echo '<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel>';
  19. echo '<title>' . $config['title'] . ' News</title>';
  20. echo '<link>' . $config['home'] . '</link>';
  21. echo '<description>Новости RSS - ' . $config['title'] . '</description>';
  22. echo '<image><url>' . $config['logotip'] . '</url>';
  23. echo '<title>' . $config['title'] . ' News</title>';
  24. echo '<link>' . $config['home'] . '</link></image>';
  25. echo '<language>ru</language>';
  26. echo '<copyright>' . $config['copy'] . '</copyright>';
  27. echo '<managingEditor>' . $config['emails'] . ' (' . $config['nickname'] . ')</managingEditor>';
  28. echo '<webMaster>' . $config['emails'] . ' (' . $config['nickname'] . ')</webMaster>';
  29. echo '<lastBuildDate>' . date("r", SITETIME) . '</lastBuildDate>';
  30.  
  31. $querynews = DB :: $dbh -> query("SELECT * FROM `news` ORDER BY `news_id` DESC LIMIT 15;");
  32.  
  33. while ($data = $querynews -> fetch()) {
  34. $data['news_text'] = bb_code($data['news_text']);
  35. $data['news_text'] = str_replace('../images/smiles', $config['home'] . '/images/smiles', $data['news_text']);
  36. $data['news_text'] = htmlspecialchars($data['news_text']);
  37.  
  38. echo '<item><title>' . $data['news_title'] . '</title><link>' . $config['home'] . '/news/index.php?act=read&amp;id=' . $data['news_id'] . '</link>';
  39. echo '<description>' . $data['news_text'] . ' </description><author>' . nickname($data['news_author']) . '</author>';
  40. echo '<pubDate>' . date("r", $data['news_time']) . '</pubDate><category>Новости</category><guid>' . $config['home'] . '/news/index.php?act=read&amp;id=' . $data['news_id'] . '</guid></item>';
  41. }
  42.  
  43. echo '</channel></rss>';
  44.  
  45. ?>