PHP Web Host - Quality Web Hosting For All PHP Applications Sign up for PayPal and start accepting credit card payments instantly
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
jakec
Site Admin


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

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

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: 6044

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

Already requested, but this would require changes to block administration. Don't expect that anytime soon. Smile
View user's profile Send private message
fkelly
Moderator


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

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

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
Site Admin


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

PostPosted: Fri Mar 14, 2008 10:56 am Reply with quote Back to top

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
View user's profile Send private message
jakec
Site Admin


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

PostPosted: Fri Mar 14, 2008 1:26 pm Reply with quote Back to top

Cheers that worked a treat. Very Happy
View user's profile Send private message
CodyG
Life Cycles Becoming CPU Cycles


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

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

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.
View user's profile Send private message
jakec
Site Admin


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

PostPosted: Wed Jun 03, 2009 11:51 am Reply with quote Back to top

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.
View user's profile Send private message
CodyG
Life Cycles Becoming CPU Cycles


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

PostPosted: Wed Jun 03, 2009 11:56 am Reply with quote Back to top

Oh nevermind. I found max_rss_items in nuke-blocks table. Maybe one day the variable will be in Add a Block.
View user's profile Send private message
fkelly
Moderator


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

PostPosted: Wed Jun 03, 2009 1:29 pm Reply with quote Back to top

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. ♠
View user's profile Send private message Visit poster's website
CodyG
Life Cycles Becoming CPU Cycles


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

PostPosted: Wed Jun 03, 2009 7:42 pm Reply with quote Back to top

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
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

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
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum