From b7bd18148e65bbdd6be442036a295eb43ca1501e Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Tue, 14 Oct 2025 15:43:43 +0200 Subject: Option to show user labels instead of tags in RSS share (#8112) * Option to show user labels instead of tags in RSS share fix https://github.com/FreshRSS/FreshRSS/discussions/8108#discussioncomment-14668813 image --- app/views/helpers/configure/query.phtml | 6 +++++- app/views/index/rss.phtml | 20 +++++++++++++++----- 2 files changed, 20 insertions(+), 6 deletions(-) (limited to 'app/views') diff --git a/app/views/helpers/configure/query.phtml b/app/views/helpers/configure/query.phtml index 9336772bb..e97ceeeed 100644 --- a/app/views/helpers/configure/query.phtml +++ b/app/views/helpers/configure/query.phtml @@ -46,9 +46,13 @@ query->sharedUrlRss() !== ''): ?> +
diff --git a/app/views/index/rss.phtml b/app/views/index/rss.phtml index 3d531c554..bcd71fa90 100644 --- a/app/views/index/rss.phtml +++ b/app/views/index/rss.phtml @@ -39,14 +39,24 @@ foreach ($this->entries as $item) { echo "\t\t\t", '', $author, '', "\n"; } } - $categories = $item->tags(); - if (is_array($categories)) { - foreach ($categories as $category) { - echo "\t\t\t", '', $category, '', "\n"; + + if ($this->publishLabelsInsteadOfTags) { + $categories = $this->entryIdsTagNames['e_' . $item->id()] ?? []; + if (is_array($categories)) { + foreach ($categories as $category) { + echo "\t\t\t", '', $category, '', "\n"; + } + } + } else { + $categories = $item->tags(); + if (is_array($categories)) { + foreach ($categories as $category) { + echo "\t\t\t", '', $category, '', "\n"; + } } } - $enclosures = iterator_to_array($item->enclosures(false)); // TODO: Optimise: avoid iterator_to_array if possible + $enclosures = iterator_to_array($item->enclosures(false), preserve_keys: false); // TODO: Optimise: avoid iterator_to_array if possible $thumbnail = $item->thumbnail(false); if (!empty($thumbnail['url'])) { // https://www.rssboard.org/media-rss#media-thumbnails -- cgit v1.2.3