Jump to content

RSS Feeds?


shainh

Recommended Posts

Hey PHP Gurus

I desperately need some help with PHP and XML.

This is my dilema;
I have a php script that reads and xml feed and parses it to html on my site, this works very well and I am quite happy with it. This php script has a $counter in it which, at this time, displays the latest 50 articles. I need to add an archive link and I was wondering if there is anyway that I can either replace or edit the following;
[code=php:0]
for ($counter = 1; $counter <= 50; $counter++;)
[/code]
to show the rest of the articles after the first 50 - so if there is a total of 1000 articles, only display the articles AFTER the first 50 (the last 950 articles).

I would appreciate the help.

Regards
S
Link to comment
https://forums.phpfreaks.com/topic/35486-rss-feeds/
Share on other sites

That shouldn't be a problem.  It all depends on how you are parsing the xml.

If you are using $counter as some kind of index into the xml, then you can just do

[code]
for ($counter = 51; $counter <= 1000; $counter++)
[/code]

On the other hand, if $counter is just loop-counter, you'd might need to rethink a little bit.  What are you using to parse the rss?  Using a library such as [url=http://magpierss.sourceforge.net/]MagpieRSS[/url] would probably make this quite trivial.
Link to comment
https://forums.phpfreaks.com/topic/35486-rss-feeds/#findComment-167914
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.