AL B Posted April 9, 2015 Posted April 9, 2015 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?
opentype Posted April 9, 2015 Posted April 9, 2015 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.)
AL B Posted April 9, 2015 Author Posted April 9, 2015 RSS feeds generated by the forums. https://forums.cubecart.com/forum/1-news-announcements.xml
AL B Posted April 9, 2015 Author Posted April 9, 2015 .. I'll have to hack the code if I can find the DB query.
opentype Posted April 9, 2015 Posted April 9, 2015 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.
AL B Posted April 9, 2015 Author Posted April 9, 2015 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..
Adriano Faria Posted April 9, 2015 Posted April 9, 2015 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.
AL B Posted April 9, 2015 Author Posted April 9, 2015 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.phpI 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...
AL B Posted April 9, 2015 Author Posted April 9, 2015 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.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.