diff options
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 |
