Jump to content

RSS lists 25 topics instead of 5 after 4.0.0 upgrade

Featured Replies

Posted

Hi All,

I just upgraded from v3 to 4.0.0. All seems ok but the RSS feed used to list just 5 topics. Now it lists 25! I can't find where to change this.. does anyone know?

To change:

 

RSS feeds generated from your forums? Or imported RSS feeds into your forums?

(Whatever the answer. There are not settings for the amount of entries currently.)

  • Author

.. I'll have to hack the code if I can find the DB query.

Out of curiosity: why do you need a limit of 5? An RSS reader doesn’t really care about the number of entries, it just cares about what is new from those entries. 

  • Author

Because its been used in a PHP script to bring notifications into customers stores dashboards. The PHP code is hosted on thousands of stores globally and we don't have access to specify the number of entries. Since IPB 2 and IPB 3 its always been 5. IPB 4 is 25. Our customers stores now get a MASSIVE list of articles instead of just 5. I've hacked the code but I don't know how to clear the cache.. 

  • Author

Before and after screenshots attached... 

 

Screen Shot 2015-04-09 at 19.42.58.png

Screen Shot 2015-04-09 at 19.43.11.png

  On 4/9/2015 at 6:42 PM, AL B said:

Because its been used in a PHP script to bring notifications into customers stores dashboards. The PHP code is hosted on thousands of stores globally and we don't have access to specify the number of entries. Since IPB 2 and IPB 3 its always been 5. IPB 4 is 25. Our customers stores now get a MASSIVE list of articles instead of just 5. I've hacked the code but I don't know how to clear the cache.. 

​The "fix" is on my post above.

  • Author
  On 4/9/2015 at 6:45 PM, Adriano Faria said:

​The "fix" is on my post above.

​Thanks for this but its not very clear.

"​It uses the default for node items ($table), which is 25 . To change the number of items on FORUMS app RSS, open..."

I fixed it myself by opening applications/forums/modules/front/forums/forums.php

I changed:

				$table->where[]	= array( 'forums_topics.moved_to IS NULL' );
				foreach ( $table->getRows( array() ) as $topic )
				{
					
					if ( ! $topic->hidden() )
					{
						$document->addItem( $topic->title, $topic->url(), $topic->content(), \IPS\DateTime::ts( $topic->last_post ), $topic->tid );
					}
				}

To:

				$table->where[]	= array( 'forums_topics.moved_to IS NULL' );
				$i=1;
				foreach ( $table->getRows( array() ) as $topic )
				{
					
					if ( ! $topic->hidden() )
					{
						$document->addItem( $topic->title, $topic->url(), $topic->content(), \IPS\DateTime::ts( $topic->last_post ), $topic->tid );
					}
					if($i==5) break;
					$i++;
				}

Hacky.. but works... 

  • Author

Infact I just improved it with;

$table->where[]	= array( 'forums_topics.moved_to IS NULL' );
$table->limit = 5;
foreach ( $table->getRows( array() ) as $topic )
{
	if ( ! $topic->hidden() )
	{
		$document->addItem( $topic->title, $topic->url(), $topic->content(), \IPS\DateTime::ts( $topic->last_post ), $topic->tid );
	}
}

Thanks for the pointers. :)

Archived

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

Recently Browsing 0

  • No registered users viewing this page.