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 | |
| 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')
| -rw-r--r-- | app/views/helpers/configure/query.phtml | 6 | ||||
| -rw-r--r-- | app/views/index/rss.phtml | 20 |
2 files changed, 20 insertions, 6 deletions
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 @@ <?php if ($this->query->sharedUrlRss() !== ''): ?> <ul> <li><a href="<?= $this->query->sharedUrlHtml() ?>"><?= _i('link') ?> <?= _t('conf.query.share.html') ?></a></li> - <li><a href="<?= $this->query->sharedUrlRss() ?>"><?= _i('link') ?> <?= _t('conf.query.share.rss') ?></a></li> <li><a href="<?= $this->query->sharedUrlGreader() ?>"><?= _i('link') ?> <?= _t('conf.query.share.greader') ?></a></li> + <li><a href="<?= $this->query->sharedUrlRss() ?>"><?= _i('link') ?> <?= _t('conf.query.share.rss') ?></a></li> </ul> + <label class="checkbox" for="publishLabelsInsteadOfTags"> + <input type="checkbox" name="query[publishLabelsInsteadOfTags]" id="publishLabelsInsteadOfTags" value="1" <?= $this->query->publishLabelsInsteadOfTags() ? 'checked="checked"' : ''?> /> + <?= _t('conf.query.filter.publish_labels_instead_of_tags') ?> + </label> <?php endif; ?> </div> <div class="group-controls"> 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 |
