Page 1 of 1

More than 1 rss feed on my site?

Posted: Sat Oct 22, 2005 5:53 am
by sebfck
feyd | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]


Hey,

Is it possible to have more than one RSS feed on my website. Because when i try putting 2 of this code in, it only shows the first RSS FEED

[b]Code:[/b]

Code: Select all

<?
require('magpierss-0.71.1/rss_fetch.inc');
$rss = fetch_rss('http://nyhederne.tv2.dk/rss/nyhederne.xml');
$num_items = 5;
$items = array_slice($rss->items, 0, $num_items);

        foreach ($items as $item) {
        $title = $item['title'];
        $href = $item['link'];
        $description = str_replace('','',$item['description']);
		echo "<li><a href=$href>$title</a>".$item['description']."</li>"
;
        }
?>

The SECOND code i put in is this

Code:

Code: Select all

<?
require('magpierss-0.71.1/rss_fetch.inc');
$rss = fetch_rss('http://www.dr.dk/Forms/Published/rssNewsFeed.aspx?config=4cdd8bff-48a5-461c-a848-f553db411d4c&rss=Yes&rssTitle=DR+Nyheder+Online+-+Alle+nyheder&overskrift=Alle+nyheder+-+24+timer&Url=%2fnyheder%2f');
$num_items = 5;
$items = array_slice($rss->items, 0, $num_items);

        foreach ($items as $item) {
        $title = $item['title'];
        $href = $item['link'];
        $description = str_replace('','',$item['description']);
		echo "<li><a href=$href>$title</a>".$item['description']."</li>"
;
        }
?>
But it only shows the first RSS feed.

How can i show both?

/Sebastian


feyd | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Posted: Sat Oct 22, 2005 8:48 am
by feyd
when and where do you call the second one in relation to the first?