Your Moodle version

Blocks: RSS Plus

block_rss_plus
Maintained by Picture of Shaun Daubney Shaun Daubney
A slightly more visually appealing RSS News Feed block for Moodle 2.0+
Moodle 2.0, 2.1, 2.2, 2.3, 2.4, 2.5

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.

Screenshots

Screenshot

Contributors

Picture of Shaun Daubney
Shaun Daubney (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Picture of Darren Sutton
    Thu, Apr 26, 2012, 10:29 AM
    Is it possible to change the title of this block and if so how would I go about doing it?
  • Picture of George Prout
    Thu, Aug 2, 2012, 9:46 PM
    Darren, I had the same question and here is my solution - a little late but I only discovered this block a couple of days ago smile
    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 smile

    Shaun - this is a fantastic block, thanks very much for contributing it :D


    George
  • Mt. Fuji
    Sun, Mar 31, 2013, 8:01 PM
    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?
  • Picture of Shaun Daubney
    Fri, Aug 2, 2013, 5:37 PM
    At the moment it pulls through the thumbnails associated with the RSS feed which is only really supported by BBC feeds. I don't know how to make it pull through images from content.
  • Picture of Mark Callagher
    Sun, Dec 22, 2013, 5:31 PM
    Hi Shaun,
    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/
  • Picture of Shaun Daubney
    Wed, Jan 8, 2014, 1:46 AM
    Hi Mark, I've just replied by email but here's a summary for everyone else too.

    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.
Please login to post comments