Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> NukePie/SimplePie
Author Message
jakec
Site Admin


Joined: Feb 06, 2006
Posts: 3048
Location: United Kingdom

PostPosted: Fri Mar 14, 2008 6:57 am Reply with quote

Is it possible to limit the number of articles shown in a block.

The feed I am currently showing has about 20 articles in it, but I would like to limit it to the first 5 only.

Any help would be greatly appreciated.


Jakec
 
View user's profile Send private message
kguske
Site Admin


Joined: Jun 04, 2004
Posts: 6383

PostPosted: Fri Mar 14, 2008 9:22 am Reply with quote

Already requested, but this would require changes to block administration. Don't expect that anytime soon. Smile

_________________
I google, therefore I exist...
Only registered users can see links on this board! Get registered or login!
 
View user's profile Send private message
fkelly
Former Moderator in Good Standing


Joined: Aug 30, 2005
Posts: 3312
Location: near Albany NY

PostPosted: Fri Mar 14, 2008 10:18 am Reply with quote

If you are comfortable modding mainfile you can make the following modification down in the headlines function:

Code:
       $start = 0;

       $end = 10;
      foreach($feed->get_items($start,$end) as $item) {


This is around line 1255 in the 2.20.01 distribution. The $end variable will be the maximum number of items read for ALL your feed blocks. This is just a temporary hack until we can modify blocks.php to allow for a separate maximum number of items to be specified for each block as Kguske says.
 
View user's profile Send private message Visit poster's website
jakec
PostPosted: Fri Mar 14, 2008 10:56 am Reply with quote

Thanks, a simple hack will do, I don't want more than 5 feeds in any of the blocks so that is OK. Very Happy
 
jakec
PostPosted: Fri Mar 14, 2008 1:26 pm Reply with quote

Cheers that worked a treat. Very Happy
 
CodyG
Life Cycles Becoming CPU Cycles


Joined: Jan 02, 2003
Posts: 712
Location: Vancouver Island

PostPosted: Wed Jun 03, 2009 11:48 am Reply with quote

Is there an update to this issue in rn 2.3? I can't find $end in mainfile.php and would like to limit the number of feeds.

_________________
"We want to see if life is ubiquitous." D.Goldin 
View user's profile Send private message
jakec
PostPosted: Wed Jun 03, 2009 11:51 am Reply with quote

You shouldn't need to do this anymore. In the blocks editer there is an option called 'Maximum RSS items' if you set this to 5, 10, or whatever this should limit the number of items in the feed.

I hope this helps.
 
CodyG
PostPosted: Wed Jun 03, 2009 11:56 am Reply with quote

Oh nevermind. I found max_rss_items in nuke-blocks table. Maybe one day the variable will be in Add a Block.
 
fkelly
PostPosted: Wed Jun 03, 2009 1:29 pm Reply with quote

Not sure if posts are overlapping here timewise but as Jakec points out, your wishes have already been met CodyG. In add a block ... in other words admin ... blocks there is a field for maximum RSS items ... parenthetically it says "only for headlines". Just put your limit in there. ♠
 
CodyG
PostPosted: Wed Jun 03, 2009 7:42 pm Reply with quote

hmmm.... I thought I'd already posted another reply. Oh well, next time I'm going to have another coffee before posting.

Thanks for your help.

RavensScripts
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> NukePie/SimplePie

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©