Low Fat CMS

288 views
Skip to first unread message

v.

unread,
Apr 14, 2021, 1:46:19 PM4/14/21
to Fat-Free Framework

I have decided to publish my CMS on Github. Behold, the Low Fat CMS: https://github.com/fatfreelogin/lowfatcms !


Questions, remarks, compliments and insults are welcome.

Dennis Tobar

unread,
Apr 14, 2021, 1:57:49 PM4/14/21
to v. via Fat-Free Framework
Hi,

Thanks for sharing :)

Some comments:

* Try to document your functions (ie: PageController::allnews) I know, it's a controller, but an annotation to route will become easier to maintain :)
* Tabs / spaces... classic discussion. Try to use some automatic tool to use PSR-12 or similar (I love ECS
* Try to use composer.json to update the lib folder (see fat-free core in Packagist)
* In some configurations, I prefer to expose a public folder instead of all folders, but I can't remember how I do this :)

If you want, I could open some issues to figure out who to improve some points (¡Viva OSS projects!)

Regards,

On Wed, Apr 14, 2021 at 1:46 PM v. via Fat-Free Framework <f3-fra...@googlegroups.com> wrote:

I have decided to publish my CMS on Github. Behold, the Low Fat CMS: https://github.com/fatfreelogin/lowfatcms !


Questions, remarks, compliments and insults are welcome.

--
-- You've received this message because you are subscribed to the Google Groups group. To post to this group, send an email to f3-fra...@googlegroups.com. To unsubscribe from this group, send an email to f3-framework...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/f3-framework?hl=en
---
You received this message because you are subscribed to the Google Groups "Fat-Free Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to f3-framework...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/f3-framework/1e3ef11c-a03f-49ef-969b-dfcc54ae8b25n%40googlegroups.com.


--
Dennis Tobar Calderón
Ingeniero en Informática UTEM

v.

unread,
Apr 15, 2021, 8:40:24 AM4/15/21
to Fat-Free Framework
Good remarks, I have added some more comments to the code, also cleaned up some obsolete files (should not have been published... I deleted the repo).
I think the tabs are now more or less consistent.

Dennis Tobar

unread,
Apr 15, 2021, 8:54:21 AM4/15/21
to v. via Fat-Free Framework
Nice to see changes.

Can I open some issues?, just to help and leave emailing to all list members :)

v.

unread,
Apr 15, 2021, 9:01:02 AM4/15/21
to Fat-Free Framework
Sure, can't promise I will do anything with them though :)

Chris Moody

unread,
May 27, 2021, 9:48:58 PM5/27/21
to f3-fra...@googlegroups.com

Hi, I was looking at your CMS and decided to modify it for a project I've been meaning to start. I tried to push my changes to your GitHub, but wasn't able to make a branch of it. (totally possible its just my lack of understanding on using GitHub).

Anyways, one of the changes I tried to implement was an RSS feed. Which has been returning weird errors I can't figure out. Would love it if someone could check it out. You can find it here: https://github.com/PlayBoxTech/podioblog

Thanks,

Chris

On 4/14/2021 12:46 PM, v. via Fat-Free Framework wrote:

I have decided to publish my CMS on Github. Behold, the Low Fat CMS: https://github.com/fatfreelogin/lowfatcms !


Questions, remarks, compliments and insults are welcome.

v.

unread,
May 28, 2021, 6:02:03 AM5/28/21
to Fat-Free Framework
what are the errors and which code is involved?

Chris Moody

unread,
May 28, 2021, 7:20:52 AM5/28/21
to v. via Fat-Free Framework

The error I am getting is:

Error

Unallowed method.

Array ( [status] => Method Not Allowed [code] => 405 [text] => HTTP 405 (GET /feed) [trace] => [lib/base.php:1938] Base->error() [lib/base.php:1754] Base->call() [index.php:25] Base->run() [level] => 0 ) 1

The route I have added is:

GET|HEAD /feed=SitemapController->rss 

The code I added to SitemapController is:

    public function rss()
    {
        $f3=Base::instance();
        $db=new DB\SQL(
            $f3->get('db_dns') . $f3->get('db_name'),
            $f3->get('db_user'),
            $f3->get('db_pass')
        );
        //$page = new Page($db,$f3->get("table_prefix"));
        //$sitemapurls=$page->rss();
       
        $sql="select longtitle, description,created_at, alias FROM ".$table_prefix."site_content WHERE published=1 AND type='document'";
        $sitemapurls=$db->exec($sql);
        $f3->set('urls',$sitemapurls);
       
        header('Content-Type: text/xml; charset=UTF-8');
        $view=\View::instance();
        echo '<?xml version="1.0" encoding="UTF-8"?>'."\r\n";
        echo Template::instance()->render('/sitemap/site.rss', 'application/htm');
        die;
    }

v.

unread,
May 28, 2021, 8:23:31 AM5/28/21
to Fat-Free Framework
looking at your code it appears that the route has not been added.
The github routes file https://github.com/PlayBoxTech/podioblog/blob/main/config/routes.ini shows that the route is commented out.


; rss feed
;GET|HEAD /feed=SitemapController->rss

Chris Moody

unread,
May 28, 2021, 8:49:49 AM5/28/21
to v. via Fat-Free Framework

Yes, I commented it out on github as its not working. You can see the error however if you visit https://podblog.playbox.tech/feed

v.

unread,
May 28, 2021, 9:33:33 AM5/28/21
to Fat-Free Framework
This seems to work:

routes:
GET|HEAD /feed.xml=SitemapController->rss

controllers/SitemapController :
    public function rss()
    {
        $f3=Base::instance();
        $db=new DB\SQL(
            $f3->get('db_dns') . $f3->get('db_name'),
            $f3->get('db_user'),
            $f3->get('db_pass')
        );
        $page = new Page($db,$f3->get("table_prefix"));
        $sitemapurls=$page->rsspages();

       
        $f3->set('urls',$sitemapurls);
        header('Content-Type: text/xml; charset=UTF-8');
        $view=\View::instance();
        echo '<?xml version="1.0" encoding="UTF-8"?>'."\r\n";
        echo Template::instance()->render('/sitemap/site.xml', 'application/xml');
        die;
    }    

views/sitemap/site.xml:
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" >
    >
    <channel>
        <title>{{ @company }}</title>
        <link>{{ @site }}</link>
        <repeat group="{{ @urls }}" value="{{ @url }}">
            <item>
                <title>{{ @url->longtitle }}</title>
                <link>{{ @base_url . @url->alias }}.html</link>
                <description>{{ @url->description }}</description>
            </item>
        </repeat>
    </channel>
</rss>

Chris Moody

unread,
May 28, 2021, 5:17:30 PM5/28/21
to v. via Fat-Free Framework

Still can't seem  to get rid of the issue. Perhaps my issue is with what is in models/Page.php ?

In the Slack server, it was suggested the issue is that a namespace isn't being found.

v.

unread,
May 30, 2021, 8:42:10 AM5/30/21
to Fat-Free Framework
The 405 error usually means that the route is not defined or the function is not found
Put echo "ok";die; in the first line of the rss function: is the output "ok" when you visit the page?
if so try moving this echo ;die; statement down a few lines to find the exact location of the error.

v.

unread,
Jun 1, 2021, 11:23:30 AM6/1/21
to Fat-Free Framework
I published a new release with an added RSS feed (page rss.xml) and PHP 8 compatibility.
Also crushed some bugs and cleaned some code.
Please check if this one solves your issue.

Chris Moody

unread,
Jun 1, 2021, 12:34:48 PM6/1/21
to v. via Fat-Free Framework

I'll try it out. Do you also accept others adding to the code base?

v.

unread,
Jun 2, 2021, 3:12:58 AM6/2/21
to Fat-Free Framework
I haven't really considered this, I just released it as is.
If you have some genious code to add I'd be more than happy to include it (;)), you can also fork the script of course
Reply all
Reply to author
Forward
0 new messages