GavickPro / News-Show-Pro-GK5

Advanced Joomla! content module.
28 stars 37 forks source link

How could I show random Rss news? #315

Closed dididira closed 8 years ago

dididira commented 8 years ago

Hello, I was wondering if there is a way to show random rss news? I need to show random articles from the given url...anyone have any ideea? Thank you Diana

dziudek commented 8 years ago

Hello,

Please try to add:

shuffle($content);

Before the following line: https://github.com/GavickPro/News-Show-Pro-GK5/blob/master/mod_news_pro_gk5/data_sources/rss/model.php#L55

dididira commented 8 years ago

Thank you, I think is working fine but for some reason is showing the same products, in different order on different pages but more or less the same 6-7 items....I have disabled cache so I don't know what could be the issue.

Is there a way to stylish a little the blocks? they are quite poor comparing with the other sources and layouts... Rss source has no style. Maybe I could add a img-polaroid class or style to a block? just to have some style on it...

Apreciate your time

dziudek commented 8 years ago

Instead of the previous change you can try to add:

shuffle($items);

before: https://github.com/GavickPro/News-Show-Pro-GK5/blob/master/mod_news_pro_gk5/data_sources/rss/model.php#L59

Regarding the CSS changes - it is a custom work beyond of our technical support here.

dididira commented 8 years ago

Thank you again for you time If I put like this:

// Method to get articles in standard mode static function getArticles($items, $config, $amount) {
shuffle($items); $content = array(); // for($i = $config['offset']; $i < $amount + $config['offset']; $i++) { if(isset($items[$i])) { array_push($content, $items[$i]); } } // the content array return $content; } }

// EOF

I HAVE THIS ERROR MESSAGE ON THE FRONT: Warning: shuffle() expects parameter 1 to be array, null given in /var/www/vhosts/ip-50xxxxxxxxx/modules/mod_news_pro_gk5/data_sources/rss/model.php on line 63 Error: No articles to display

dziudek commented 8 years ago

In this case I have no other ideas how to solve this issue in a simple modification way :/