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.

Screenshots

Screenshot #0

Contributors

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

Comments RSS

Comments

  • Darren Sutton
    Thu, 26 Apr 2012, 10:29 AM
    Is it possible to change the title of this block and if so how would I go about doing it?
  • George Prout
    Thu, 2 Aug 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, 31 Mar 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?
  • Shaun Daubney
    Fri, 2 Aug 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.
  • Mark Callagher
    Sun, 22 Dec 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/
  • Shaun Daubney
    Wed, 8 Jan 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.
  • Brendan Anderson
    Fri, 29 May 2015, 5:18 AM
    Sean,

    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



  • Shaun Daubney
    Mon, 1 June 2015, 4:58 PM
    Hi Brendan,

    Just done this and uploading it now. Hope it works smile

    Shaun
Please login to post comments