1 (edited by MBTY 2014-08-24 11:41:00)

Topic: RSS plugin

Anyone have RSS plugin for Morfy?

2 (edited by MBTY 2014-08-26 19:01:21)

Re: RSS plugin

Also, look what i constructed:
http://dwwb.ru
1) Blocks with random color
2) Tags in Title are clickable
3) Cackle comments widget added
4) Nice sitemap.
5)  /content/blog replaced to /content everywhere in morfy.  - Nice URL without "/blog/"
6) Nice 404 page
It was very hard for me. My html/php knowledge are very poor. Please help me to create RSS button.

3 2014-08-27 19:13:35 (edited by MBTY 2014-08-27 19:22:11)

Re: RSS plugin

I made it!!!!

Instructions:
plugins/rss/rss.php

<?php
if (Morfy::factory()->getUrl() == 'RSS') {
    Morfy::factory()->addAction('before_render', function() {
echo '<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>YOUR TITLE</title>
<link>HTTP://YOUR_SITE.COM/</link>
<description>YOUR DESCRIPTION</description>
<language>YOUR LANGUAGE: ru, en, etc.</language>
';
$pages = Morfy::factory()->getPages(CONTENT_PATH, 'date', 'DESC', array('404'));
foreach($pages as $page) {
echo ('    <item>
        <title>'.htmlspecialchars($page['title'], ENT_QUOTES).'</title>
        <link>'.$page['url'].'</link>
        <guid>'.$page['url'].'</guid>
        <description>'.htmlspecialchars($page['content_short'], ENT_QUOTES).'</description>
        <pubDate>'.date('D, d M Y H:i:s', strtotime($page['date'])).' +0400</pubDate>
    </item>
');
}
echo '</channel>
</rss>';
        exit();
    });
} ?>

About:   "<pubDate>'.date('D, d M Y H:i:s', strtotime($page['date'])).' +0400</pubDate>". "+0400" - Your site`s timezone
/config.php

'plugins' => array(
            'pagination',
            'tags',
            'rss',
        ),

Wasn`t work until:
/libraries/Morfy/Morfy.php

DELETE line 390:             header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found');

Any ideas why need to delete this line in Morfy.php ?

Re: RSS plugin

Please read: https://github.com/Awilum/morfy-cms/issues/9

XSS Testing <script>alert('HIYAA!!!');</script>

tovic's Website