Moodle plugins directory: RSS Plus | Moodle.org
RSS Plus
Blocks ::: block_rss_plus
Maintained by Shaun Daubney
A slightly more visually appealing RSS News Feed block for Moodle 2.0+
Latest release:
15 sites
11 downloads
12 fans
Current versions available: 4
More visually appealing RSS News Feed block for Moodle. Currently works best with BBC News feeds as it displays the pictures, but will work with any RSS.
Need help to get it to pull through other media content and images from other feed providers. If interested in helping me with this project, please get in touch.
Looks best when used with Aardvark theme.
Contributors
Shaun Daubney (Lead maintainer)
Please login to view contributors details and/or to contact them
Feedback + suggestions are welcome.
This will let you edit the title for each RSS Plus block independently. Three files need to be edited, make backups first!
/blocks/rss_plus/lang/en/block_rss_plus.php
* Add the following line to the language file, if your language is not en then change accordingly.
$string['blocktitle'] = 'RSS feed title';
/blocks/rss_plus/block_rss_plus.php
* Replace the specialization function to use a feed title if one has been defined, otherwise use the default
---- Original code ----
function specialization() {
$this->title = get_string('remotenewsfeed', 'block_rss_plus');
}
---- Modified code ----
function specialization() {
if (!empty($this->config->title)) {
$this->title = $this->config->title;
} else {
$this->title = get_string('remotenewsfeed', 'block_rss_plus');
}
}
/blocks/rss_plus/edit_form.php
* Add three lines of code so that a title can be added for each RSS plus block
* This is a snippet of the code so that you put the lines in the correct place
---- Original code ----
class block_rss_plus_edit_form extends block_edit_form {
protected function specific_definition($mform) {
global $CFG, $DB, $USER;
// Fields for editing block contents.
$mform->addElement('header', 'configheader', get_string('blocksettings', 'block'));
***** put the new code here *****
$mform->addElement('text', 'config_shownumentries', get_string('shownumentrieslabel', 'block_rss_plus'), array('size' => 5));
---- Afterwards your code should look like this ----
class block_rss_plus_edit_form extends block_edit_form {
protected function specific_definition($mform) {
global $CFG, $DB, $USER;
// Fields for editing block contents.
$mform->addElement('header', 'configheader', get_string('blocksettings', 'block'));
$mform->addElement('text', 'config_title', get_string('blocktitle', 'block_rss_plus'));
$mform->setDefault('config_title', 'Remote RSS feed');
$mform->setType('config_title', PARAM_MULTILANG);
$mform->addElement('text', 'config_shownumentries', get_string('shownumentrieslabel', 'block_rss_plus'), array('size' => 5));
Obviously backup the original files first and try it on a dev server. You may need to purge the cache, but now you can customise the title to your hearts content
Shaun - this is a fantastic block, thanks very much for contributing it :D
George
Thanks a million for this! I can edit the titles now so this rss block surpasses the default in terms of appearance.
For some reason though, I cannot get it to pull images from RSS feeds outside of BBC feeds...I've even tried image feeds that provide small images but nothing.... Do you have any idea why it would only be successfully showing images for BBC feeds?
I have been looking for something like this as our new site is using your base theme. I have had a close look at the RSS code on the Stuff (Dominion Post Wellington NZ) site and they have thumbnail images within each RSS post. Will your RSS Plus block work with this? Here is the link: http://www.stuff.co.nz/rss/
Hi Mark,
It doesn't work with it (with images) straight off the shelf, although it works without the images. It WILL work with changing just 1 line in the code though.
Line 249 of block_rss_plus.php
CHANGE
foreach ((array) $enclosure->get_thumbnail(1) as $thumbnail)
TO
foreach ((array) $enclosure->get_link() as $thumbnail)
Then it works.
Can you please change line 307 of block_rss_plus.php from this:
@set_time_limit(60);
To this:
php_time_limit::raise(60);
php_time_limit::raise will not alter the time limit or max execution time if in CLI mode (which cron always is). As it is now, RSS Plus' cron method leaves my php_max_execution time at 60 for all other jobs.
Thanks,
Brendan
Just done this and uploading it now. Hope it works
Shaun