diff options
| author | 2025-10-14 15:43:43 +0200 | |
|---|---|---|
| committer | 2025-10-14 15:43:43 +0200 | |
| commit | b7bd18148e65bbdd6be442036a295eb43ca1501e (patch) | |
| tree | 4fba0694a3c45f015f2ed83ebd2356d169241f79 /app/views/index | |
| parent | faaa770bc0b396d6e842fe816012661f07eac395 (diff) | |
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
<img width="711" height="182" alt="image" src="https://github.com/user-attachments/assets/8effb2cd-fffb-4f00-b628-54e963e8b2dc" />
Diffstat (limited to 'app/views/index')
| -rw-r--r-- | app/views/index/rss.phtml | 20 |
1 files changed, 15 insertions, 5 deletions
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", '<dc:creator>', $author, '</dc:creator>', "\n"; } } - $categories = $item->tags(); - if (is_array($categories)) { - foreach ($categories as $category) { - echo "\t\t\t", '<category>', $category, '</category>', "\n"; + + if ($this->publishLabelsInsteadOfTags) { + $categories = $this->entryIdsTagNames['e_' . $item->id()] ?? []; + if (is_array($categories)) { + foreach ($categories as $category) { + echo "\t\t\t", '<category>', $category, '</category>', "\n"; + } + } + } else { + $categories = $item->tags(); + if (is_array($categories)) { + foreach ($categories as $category) { + echo "\t\t\t", '<category>', $category, '</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 |
