Events.xml Empty

Discussion in 'Subrion CMS Plugins Discussion' started by inmobus, Dec 9, 2016.

  1. inmobus

    inmobus New Member

    Good day, the reason for my post is to see if I can help with a problem I have with the events plugin, I need to load the rss events.xml file.

    I managed to modify this line that previously the button xml sent me to a blank page.

    // before
    $pageActions[] = array(
    'icon' => 'rss',
    'title' => '',
    'url' => IA_URL . 'events/rss/',
    'classes' => 'btn-warning'
    );

    //after
    $pageActions[] = array(
    'icon' => 'rss',
    'title' => '',
    'url' => IA_URL . 'events.xml',
    'classes' => 'btn-warning'
    );


    Now I have corrected it and it sends me to the xml file, but it does not load me the data of the registered events.
  2. Dayir_A.

    Dayir_A. Staff Member

    Hello @inmobus,

    Thank you for your report. RSS functionality used to work in older versions of Events plugin. I've created a ticket in our system and the functionality will be reviewed and fixed soon.
    https://github.com/intelliants/subrion-plugin-events/issues/9

    But now, you can apply hotfix. Just paste the following code in the end of file: /plugins/events/index.php

    PHP:
    if (iaView::REQUEST_XML == $iaView->getRequestType())
    {
        $output = array(
            'title' => $iaCore->get('site') . ' :: ' . $iaView->title(),
            'description' => '',
            'url' => IA_URL . 'blog',
            'item' => array()
        );

        $events = $iaEvent->get(array(), 0, 20, false, false);

        foreach ($events as $entry)
        {
            $output['item'][] = array(
                'title' => $entry['title'],
                'link' => IA_URL . 'event/' . iaSanitize::alias($entry['title']) . '-' . $entry['id'],
                'description' => iaSanitize::tags($entry['description'])
            );
        }

        $iaView->assign('channel', $output);
    }
    Please let us know how it goes for you.

    Thanks.
    Andrew_G. likes this.
  3. SmaRTeY

    SmaRTeY New Member

    Hi Dayir_A,

    I created a fix in github + Pull request, your code is almost okay.
    Both Blog RSS and Events RSS were not W3C validated, I fixed this (I think). Your output above is pointing to 'blog' where that should be 'events'.
    I also changed the description as well in such a way that the evnts are way more readable ie. now the description looks like this (in IE11) see attached image. Last but not least I made the event body Multi language which was also not done yet. There are still some improvements to go but it's getting there! ;)

    For those who can't wait, here's all the changed files:
    https://github.com/intelliants/subrion-plugin-events/pull/10/files

    Regards,
    Eric

    rss-feed.jpg
    Last edited: Jan 12, 2017

Share This Page