Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
RSS Tip
#1
Hello,

this is a little contribution on how setup rss read in your site:

- You need MagpieRSS libs to read the rss. http://magpierss.sourceforge.net
- You need DynPages plugin to integrate the php code

1) First mkdir (extra in my example) and put all MagpieRSS files.
2) Create a php file named rss_parser.php with

Code:
<?php
require_once("extra/rss_fetch.inc");

function FeedParser($url_feed, $nb_items_affiches=10)
{
  $rss = fetch_rss($url_feed);

  if (is_array($rss->items))
   {

   $items = array_slice($rss->items, 0, $nb_items_affiches);
   $html = "<ul type='square'>\n";

   foreach ($items as $item)
    {
    $html .= "<li>";
    $titre = utf8_encode($item['title']);
    $html .= "<a href=\"".$item['link']."\" target=\"_blank\">".$titre."</a>";
    $html .= "</li>\n";
    }
   $html .= "</ul>\n";
}
return $html;
}

?>

3) Create a component in your admin panel named rssmain with,

Code:
<?php
require_once("extra/rss_parser.php");
echo '<b>My RSS Reader</b>';
echo FeedParser("http://www.myrssweb.com/articles.rss");
?>

4) Add { %rssmain% } on the desired page and it will show the rss feed, by default 10 title.



Enjoy Smile
Reply
#2
that's a good idea!

I will test it. Why not make a plugin and put it into "Extends"?
|--

Das deutschsprachige GetSimple-(Unter-)Forum:   http://get-simple.info/forums/forumdisplay.php?fid=18
Reply
#3
such a plugin already and it works
http://artelena-photo.ru/news
http://without-db.ru/rss
Download here
http://get-simple.info/forum/topic/643/g...eeds-beta/
Reply




Users browsing this thread: 1 Guest(s)