Please fix output from Flatpress RSS

This is the right place to report general bugs, make suggestions or ask for help.
Post Reply
Lubomír Ludvík
Posts: 82
Joined: Wed Feb 20, 2019 7:44 pm
Location: Rouchovany
Contact:

Please fix output from Flatpress RSS

Post by Lubomír Ludvík » Wed Dec 18, 2024 7:36 am

Please fix output from flatpress RSS
- briefer description to tag <description>
- add picture to tag <image>...</image>

Try Widget Preview: https://www.rssfeedwidget.com/
https://www.flatpress.org/feed/rss2/ - has big description with picture
http://feeds.bbci.co.uk/news/england/rss.xml - look good
http://wordpress.org/news/feed/ - look good
rss.png
rss.png (66.17 KiB) Viewed 112753 times

User avatar
fraenkiman
FlatPress Coder
Posts: 520
Joined: Thu Feb 03, 2022 7:25 pm
Location: Berlin, Germany
Contact:

Re: Please fix output from Flatpress RSS

Post by fraenkiman » Thu Dec 19, 2024 10:30 pm

Hello Lubomír

to shorten the description, edit the file rss.tpl in the directory /fp-interface/sharedtpls. (Template on GitHub)

Look for the <description> tag there. Replace

Code: Select all

{$content|tag:the_content}
with

Code: Select all

{$content|tag:the_content|truncate:256}
This would shorten the description to 256 characters, for example.

Alternatively, you can also use the [more] BBcode tag and place an image of your choice before the [more] tag. It will look something like this:
rss01.png
rss01.png (78.36 KiB) Viewed 112738 times
An image in the <image> tag is not so easy to realize, because you can include several images in a post, or even entire galleries or no image. These aspects would have to be taken into account during implementation. I'll take a look at it when I get the chance. I have created #505 for this. If you already have an implementation suggestion, I look forward to a pull request.

With best regards
Frank

User avatar
fraenkiman
FlatPress Coder
Posts: 520
Joined: Thu Feb 03, 2022 7:25 pm
Location: Berlin, Germany
Contact:

Re: Please fix output from Flatpress RSS

Post by fraenkiman » Thu Dec 19, 2024 11:02 pm

Post text without image can be reached with

Code: Select all

{$content|tag:the_content|strip_tags|strip|truncate:256:“...”:true|escape}

User avatar
fraenkiman
FlatPress Coder
Posts: 520
Joined: Thu Feb 03, 2022 7:25 pm
Location: Berlin, Germany
Contact:

Re: Please fix output from Flatpress RSS

Post by fraenkiman » Sun Dec 22, 2024 1:16 am

Hello everyone.

Mini-spoiler:

The PhotoSwipe plugin version 2.0.1 is now available for FlatPress 1.3 and 1.3.1. The update fixes the problem that the 6 overlay buttons were displayed in the RSS feed in an unsightly way.
Screenshot 2024-12-22 010814.png
Screenshot 2024-12-22 010814.png (85.3 KiB) Viewed 112708 times
The good case
Screenshot 2024-12-22 014008.png
Screenshot 2024-12-22 014008.png (90.81 KiB) Viewed 112708 times

Update on the topic: Plain text in the RSS feed

Code: Select all

{$content|tag:the_content|strip_tags|strip|truncate:1024:"...":true|escape}
But I like the HTML output better.

Have a merry Christmas.
With best regards
Frank

Lubomír Ludvík
Posts: 82
Joined: Wed Feb 20, 2019 7:44 pm
Location: Rouchovany
Contact:

Re: Please fix output from Flatpress RSS

Post by Lubomír Ludvík » Sun Dec 22, 2024 7:49 am

The PhotoSwipe plugin version 2.0.1 no works, get HTTP ERROR 500 on PHP Version 8.2.26

Code: Select all

[22-Dec-2024 07:47:00 UTC] PHP Fatal error:  Uncaught Error: Undefined constant "RANDOM_HEX" in /home/eywjamcd/flatpress.cz/fp-plugins/photoswipe/photoswipefunctions.class.php:222
Stack trace:
#0 /home/eywjamcd/flatpress.cz/fp-includes/core/core.wp-plugin-interface.php(134): PhotoSwipeFunctions::echoScriptTags('')
#1 /home/eywjamcd/flatpress.cz/fp-includes/core/core.theme.php(303): do_action('wp_head')
#2 /home/eywjamcd/flatpress.cz/fp-content/cache/e93fccb09cf8b04111b9595da102f3f4^21e22cdf11647423625b7c388c19562289f32c8a_0.file.header.tpl.php(33): theme_smarty_function_action(Array, Object(Smarty_Internal_Template))
#3 /home/eywjamcd/flatpress.cz/fp-includes/smarty-4.3.1/libs/sysplugins/smarty_template_resource_base.php(123): content_673ef5718346c1_50717738(Object(Smarty_Internal_Template))
Last edited by Lubomír Ludvík on Sun Dec 22, 2024 8:00 am, edited 2 times in total.

Lubomír Ludvík
Posts: 82
Joined: Wed Feb 20, 2019 7:44 pm
Location: Rouchovany
Contact:

Re: Please fix output from Flatpress RSS

Post by Lubomír Ludvík » Sun Dec 22, 2024 7:53 am

Thank you, strip_tags works in /fp-interface/sharedtpls/rss.tpl

Code: Select all

a) {$content|tag:the_content|truncate:256}
b) {$content|tag:the_content|strip_tags|strip|truncate:256:"...":true|escape}
rss_tag.png
rss_tag.png (54.79 KiB) Viewed 112694 times

User avatar
fraenkiman
FlatPress Coder
Posts: 520
Joined: Thu Feb 03, 2022 7:25 pm
Location: Berlin, Germany
Contact:

Re: Please fix output from Flatpress RSS

Post by fraenkiman » Sun Dec 22, 2024 12:02 pm

Hello Lubomír,

Error from the post:
Oops, I must have forgotten that under FlatPress 1.3/ 1.3.1 there were no nonce values for inline scripts to mark Java scripts as safe.
I have cleaned up the PhotoSwipe plugin accordingly and uploaded it again.

Thanks for testing.
With best regards
Frank

Lubomír Ludvík
Posts: 82
Joined: Wed Feb 20, 2019 7:44 pm
Location: Rouchovany
Contact:

Re: Please fix output from Flatpress RSS

Post by Lubomír Ludvík » Sun Dec 22, 2024 4:38 pm

fraenkiman wrote: Sun Dec 22, 2024 12:02 pm I have cleaned up the PhotoSwipe plugin accordingly and uploaded it again.
I tested it, it's ok.

User avatar
fraenkiman
FlatPress Coder
Posts: 520
Joined: Thu Feb 03, 2022 7:25 pm
Location: Berlin, Germany
Contact:

Re: Please fix output from Flatpress RSS

Post by fraenkiman » Sun Dec 29, 2024 9:10 pm

Hello everyone,

since we are already on the subject: There is an update 1.1.0 available for the LastComments plugin.

I found an old unfinished function in the PHP code and fixed it. The plugin now also outputs an RSS and Atom feed.
LastComments1_1_0.png
LastComments1_1_0.png (31.99 KiB) Viewed 112229 times
Happy new year.
Frank

User avatar
Arvid
FlatPress Coder
Posts: 630
Joined: Sat Jan 26, 2019 7:40 pm
Contact:

Re: Please fix output from Flatpress RSS

Post by Arvid » Sun Jan 12, 2025 12:22 pm

Very nice - thank you both for reporting, fixing and testing!

Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests