Welcome to Geeklog, Anonymous Thursday, November 28 2024 @ 12:36 am EST

Geeklog Forums

Limiting rss stories in portal block

Page navigation


drali

Anonymous
Text Formatted Code
$RDFheadlines = array_splice($RDFheadlines, 0, -5);
 


okay, using that...i think i got it to grab the right headlines.

BUT...it works oddly on some feeds (i think depending on how they are published)

for some feeds..there are still many more entries...and on some feeds...wired news for instance....there are only 2 that now show up on my block.

dah...slowly, slowly.
 Quote

drali

Anonymous
Text Formatted Code


        if( !$rdferror )
        {
            $RDFheadlines = array_slice($RDFheadlines,0,5);
            $blockcontent = COM_makeList( $RDFheadlines );
            $blockcontent = preg_replace( "/(\015\012)|(\015)|(\012)/", '',
                                          $blockcontent );
            $result = DB_change( $_TABLES['blocks'], 'content', $blockcontent,
                                 'bid', $bid);
 


OKAY

i think i finally have it.

instead of array SPLICE
use array SLICE

(no P)

that seems to work perfectly now.

(well, until i find out i'm missing somethign again.)

i hope this helps SOMEONE in the future.
 Quote

Status: offline

1000ideen

Forum User
Full Member
Registered: 08/04/03
Posts: 1298
If I change this from 0 to 3 I'm receiving an error

Text Formatted Code
$maxheadlines = 0; // set to something > 0 to limit max. number of headlines

 


Parse error: parse error in /srv/www/htdocs/web393/html/lib-common.php on line 3712

Warning: main(lib-story.php): failed to open stream: No such file or directory in /srv/www/htdocs/web393/html/index.php on line 38

Fatal error: main(): Failed opening required 'lib-story.php' (include_path='.:/usr/share/php') in /srv/www/htdocs/web393/html/index.php on line 38

Then I tried drali's code and it worked. Is this still a bug in 1.3.11sr2 ? You had been talking about 1.3.10 before.

Basically I think that there should be an editable limit in lines displayed in a block. This is also desireable for some more variables. These

$_CONF['newstoriesinterval'] $_CONF['newcommentsinterval'] $_CONF['newlinksinterval'] should rather have a limit in lines displayed than days, hours etc. This may be true for some more things like events etc.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by 1000ideen: Parse error: parse error in /srv/www/htdocs/web393/html/lib-common.php on line 3712

Check that line then ...


Quote by 1000ideen: Basically I think that there should be an editable limit in lines displayed in a block.

Already in CVS and will be in 1.3.12.

bye, Dirk
 Quote

Status: offline

johnjr

Forum User
Chatty
Registered: 02/08/04
Posts: 68
I've got

Text Formatted Code
$maxheadlines = 10; // set to something > 0 to limit max. number of headlines
 


but, I'm still getting more than 10 'headlines' from RSS feeds (in particular from the National Weather Service - 58 'headlines').

Any ideas as to why this isn't limiting the feeds to 10?

John
 Quote

Status: offline

1000ideen

Forum User
Full Member
Registered: 08/04/03
Posts: 1298
I can`t tell you why but if you want to limit the length then use drali`s code above. It works with me.
 Quote

Status: offline

johnjr

Forum User
Chatty
Registered: 02/08/04
Posts: 68
If I have to hack the code to make it work, I will. But, I would much rather use the functions that are already built into the code.

Dirk, got a good answer for me, as to why this setting doesn't work?

John
 Quote

Page navigation

All times are EST. The time is now 12:36 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content