Thread: [Magpierss-general] MagpieRSS does not fetches the all posts - fetches only one post - the latest
Status: Beta
Brought to you by:
kellan
From: Gjergji K. <gko...@ya...> - 2011-01-05 00:18:05
|
I have this situation: local computer /localhost (XAMPP) MagpieRSS works just fine hosting server MagpieRSS fetches only one post - the latest. below I'm posting the code? -------------------------------------- <?php // number of posts to fetch $nop=0; define('MAGPIE_INPUT_ENCODING', 'UTF-8'); define('MAGPIE_OUTPUT_ENCODING', 'UTF-8'); require_once 'magpierss/rss_fetch.inc'; $url = 'http://gjergjikokushta.com/feed/'; $rss = fetch_rss($url); echo "<h3>", "Artikuj nga blogu personal: ", $rss->channel['title'], "</h3>", "<br>\n"; $num_items = 5; $rss = fetch_rss($url); $items = array_slice($rss->items, 0, $num_items); foreach ( $items as $item ) { $title = $item[title]; $url = $item[link]; echo "<li><a href=$url target='_blank'>$title</a></li>\n"; } ?> -------------------------------------- Q.1 - Does MagpieRSS have a default number of post to fetch? In my local computer it will fetch the last 10 - what if I want to show them all? Q.2 - are there any php.ini setting for MagpieRSS to work correctly? hopping on a solution Gjergji |
From: Marc G. <mar...@gm...> - 2011-01-07 21:45:01
|
> Q.1 - Does MagpieRSS have a default number of post to fetch? In my local > computer it will fetch the last 10 - what if I want to show them all? It looks to me like your RSS feed is only returning 10 posts. Regarding the different results on different servers, I can't imagine why it's doing this. Perhaps try turning the cache off and var_dump'ing the contents of $rss to see if the problem is in magpie or in your code. Marc |
From: Gjergji K. <gko...@ya...> - 2011-01-08 13:55:30
|
> Q.1 - Does MagpieRSS have a default number of post to fetch? In my local > computer it will fetch the last 10 - what if I want to show them all? It looks to me like your RSS feed is only returning 10 posts. Regarding the different results on different servers, I can't imagine why it's doing this. Perhaps try turning the cache off and var_dump'ing the contents of $rss to see if the problem is in magpie or in your code. Marc -------- Problem solved - even though I could not identify the problem, I re-uploaded the whole website into a new folder. It worked! So I guess there was one or some files not well uploaded causing this bug. My wonder is why it first worked and after posting a new artcle in the blog site.. it did not work right.. anyway - now it's working. Thanks a lot Marc for your time and advice. Gjegji |