Jump to content

RSS lists 25 topics instead of 5 after 4.0.0 upgrade


AL B

Recommended Posts

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?

Posted

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.. 

Posted

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.

Posted

​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... 

Posted

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 members

    • No registered users viewing this page.
×
×
  • Create New...