I am trying to edit FirstRSS to limit output of RSS items to 10. Here is the code that outputs all items in the feed. I am not a programmer so any help is appreciated! I pulled this off of the firstrss comment page.
Here is the snippet I want to put in to limit output to 10 items. It isn't working though, all items are still displayed.
Code:
[B]
// Item title, description, & link
foreach($rss->items as $item) {
$title = $item[title];
$link = htmlentities($item[link]);
if ($title != '') $disp .= "\t<a href='$link'>$title</a><br />\n";
}
}
[/B]
Code:
// Item title, description, & link
$i=0;
foreach($rss->items as $item) {
if($i < 10) {
$title = $item[title];
$link = htmlentities($item[link]);
if ($title != '') $disp .= "\t$title\n";
}
$i++;
}
Last edited: