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/Controllers/configureController.php | 5 ++++- app/Models/UserQuery.php | 20 ++++++++++++++++++-- app/Models/View.php | 3 ++- app/i18n/cs/conf.php | 1 + app/i18n/de/conf.php | 1 + app/i18n/el/conf.php | 1 + app/i18n/en-US/conf.php | 1 + app/i18n/en/conf.php | 1 + app/i18n/es/conf.php | 1 + app/i18n/fa/conf.php | 1 + app/i18n/fi/conf.php | 1 + app/i18n/fr/conf.php | 1 + app/i18n/he/conf.php | 1 + app/i18n/hu/conf.php | 1 + app/i18n/id/conf.php | 1 + app/i18n/it/conf.php | 1 + app/i18n/ja/conf.php | 1 + app/i18n/ko/conf.php | 1 + app/i18n/lv/conf.php | 1 + app/i18n/nl/conf.php | 1 + app/i18n/oc/conf.php | 1 + app/i18n/pl/conf.php | 1 + app/i18n/pt-BR/conf.php | 1 + app/i18n/pt-PT/conf.php | 1 + app/i18n/ru/conf.php | 1 + app/i18n/sk/conf.php | 1 + app/i18n/tr/conf.php | 1 + app/i18n/uk/conf.php | 1 + app/i18n/zh-CN/conf.php | 1 + app/i18n/zh-TW/conf.php | 1 + app/views/helpers/configure/query.phtml | 6 +++++- app/views/index/rss.phtml | 20 +++++++++++++++----- 32 files changed, 71 insertions(+), 10 deletions(-) (limited to 'app') diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index aedb7a2e6..427fcb584 100644 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -458,6 +458,9 @@ class FreshRSS_configure_Controller extends FreshRSS_ActionController { if (!empty($params['shareRss']) && ctype_digit($params['shareRss'])) { $queryParams['shareRss'] = (bool)$params['shareRss']; } + if (!empty($params['publishLabelsInsteadOfTags']) && ctype_digit($params['publishLabelsInsteadOfTags'])) { + $queryParams['publishLabelsInsteadOfTags'] = (bool)$params['publishLabelsInsteadOfTags']; + } $queries = FreshRSS_Context::userConf()->queries; $queries[$id] = (new FreshRSS_UserQuery($queryParams, FreshRSS_Context::categories(), FreshRSS_Context::labels()))->toArray(); @@ -518,7 +521,7 @@ class FreshRSS_configure_Controller extends FreshRSS_ActionController { $params = array_filter($_GET, 'is_string', ARRAY_FILTER_USE_KEY); unset($params['name']); unset($params['rid']); - /** @var array{get?:string,name?:string,order?:string,search?:string,state?:int,url?:string,token?:string,shareRss?:bool,shareOpml?:bool,description?:string,imageUrl?:string} $params */ + /** @var array{get?:string,name?:string,order?:string,search?:string,state?:int,url?:string,token?:string,shareRss?:bool,shareOpml?:bool,publishLabelsInsteadOfTags?:bool,description?:string,imageUrl?:string} $params */ $params['url'] = Minz_Url::display(['params' => $params]); $params['name'] = _t('conf.query.number', count($queries) + 1); $queries[] = (new FreshRSS_UserQuery($params, FreshRSS_Context::categories(), FreshRSS_Context::labels()))->toArray(); diff --git a/app/Models/UserQuery.php b/app/Models/UserQuery.php index 077ae0b90..26264fa24 100644 --- a/app/Models/UserQuery.php +++ b/app/Models/UserQuery.php @@ -21,6 +21,7 @@ class FreshRSS_UserQuery { private string $token = ''; private bool $shareRss = false; private bool $shareOpml = false; + private bool $publishLabelsInsteadOfTags = false; /** @var array $categories where the key is the category ID */ private array $categories; /** @var array $labels where the key is the label ID */ @@ -43,7 +44,7 @@ class FreshRSS_UserQuery { /** * @param array{get?:string,name?:string,order?:string,search?:string,state?:int,url?:string,token?:string, - * shareRss?:bool,shareOpml?:bool,description?:string,imageUrl?:string} $query + * shareRss?:bool,shareOpml?:bool,publishLabelsInsteadOfTags?:bool,description?:string,imageUrl?:string} $query * @param array $categories * @param array $labels */ @@ -75,6 +76,7 @@ class FreshRSS_UserQuery { unset($link['name']); unset($link['shareOpml']); unset($link['shareRss']); + unset($link['publishLabelsInsteadOfTags']); $this->url = Minz_Url::display(['params' => $link]); } } else { @@ -92,6 +94,9 @@ class FreshRSS_UserQuery { if (isset($query['shareOpml'])) { $this->shareOpml = $query['shareOpml']; } + if (isset($query['publishLabelsInsteadOfTags'])) { + $this->publishLabelsInsteadOfTags = (bool)$query['publishLabelsInsteadOfTags']; + } if (isset($query['description'])) { $this->description = $query['description']; } @@ -109,7 +114,9 @@ class FreshRSS_UserQuery { /** * Convert the current object to an array. * - * @return array{'get'?:string,'name'?:string,'order'?:string,'search'?:string,'state'?:int,'url'?:string,'token'?:string} + * @return array{get?:string,name?:string,order?:string,search?:string, + * state?:int,url?:string,token?:string,shareRss?:bool,shareOpml?:bool, + * publishLabelsInsteadOfTags?:bool,description?:string,imageUrl?:string} */ public function toArray(): array { return array_filter([ @@ -122,6 +129,7 @@ class FreshRSS_UserQuery { 'token' => $this->token, 'shareRss' => $this->shareRss, 'shareOpml' => $this->shareOpml, + 'publishLabelsInsteadOfTags' => $this->publishLabelsInsteadOfTags, 'description' => $this->description, 'imageUrl' => $this->imageUrl, ], fn($v): bool => $v !== '' && $v !== 0 && $v !== false); @@ -279,6 +287,14 @@ class FreshRSS_UserQuery { return $this->shareOpml; } + public function setPublishLabelsInsteadOfTags(bool $publishLabelsInsteadOfTags): void { + $this->publishLabelsInsteadOfTags = $publishLabelsInsteadOfTags; + } + + public function publishLabelsInsteadOfTags(): bool { + return $this->publishLabelsInsteadOfTags; + } + protected function sharedUrl(bool $xmlEscaped = true): string { $currentUser = Minz_User::name() ?? ''; return Minz_Url::display("/api/query.php?user={$currentUser}&t={$this->token}", $xmlEscaped ? 'html' : '', true); diff --git a/app/Models/View.php b/app/Models/View.php index 11ca3a105..104afb3c0 100644 --- a/app/Models/View.php +++ b/app/Models/View.php @@ -78,7 +78,7 @@ class FreshRSS_View extends Minz_View { // Export / Import public string $content; /** @var array> */ - public array $entryIdsTagNames; + public array $entryIdsTagNames = []; public string $list_title; public int $queryId; public string $type; @@ -111,6 +111,7 @@ class FreshRSS_View extends Minz_View { public bool $internal_rendering = false; public string $description = ''; public string $image_url = ''; + public bool $publishLabelsInsteadOfTags = false; // Content preview public string $fatalError; diff --git a/app/i18n/cs/conf.php b/app/i18n/cs/conf.php index 75412206a..9662e0108 100644 --- a/app/i18n/cs/conf.php +++ b/app/i18n/cs/conf.php @@ -152,6 +152,7 @@ return array( 'categories' => 'Zobrazit podle kategorie', 'feeds' => 'Zobrazit podle kanálu', 'order' => 'Seřadit podle data', + 'publish_labels_instead_of_tags' => 'Replace feed tags by user labels in the shared RSS', // TODO 'search' => 'Výraz', 'shareOpml' => 'Povolit sdílení příslušných kategorií a kanálů pomocí OPML', 'shareRss' => 'Povolit sdílení pomocí HTML & RSS', diff --git a/app/i18n/de/conf.php b/app/i18n/de/conf.php index 7f6f4f5f9..9c3e22f75 100644 --- a/app/i18n/de/conf.php +++ b/app/i18n/de/conf.php @@ -152,6 +152,7 @@ return array( 'categories' => 'Nach Kategorie filtern', 'feeds' => 'Nach Feed filtern', 'order' => 'Nach Datum sortieren', + 'publish_labels_instead_of_tags' => 'Replace feed tags by user labels in the shared RSS', // TODO 'search' => 'Suchbegriff', 'shareOpml' => 'Teilen via OPML mit zugehörigen Kategorien und Feeds aktivieren', 'shareRss' => 'Teilen via HTML & RSS aktivieren', diff --git a/app/i18n/el/conf.php b/app/i18n/el/conf.php index 9936f18a7..d254c1853 100644 --- a/app/i18n/el/conf.php +++ b/app/i18n/el/conf.php @@ -152,6 +152,7 @@ return array( 'categories' => 'Display by category', // TODO 'feeds' => 'Display by feed', // TODO 'order' => 'Sort by date', // TODO + 'publish_labels_instead_of_tags' => 'Replace feed tags by user labels in the shared RSS', // TODO 'search' => 'Expression', // TODO 'shareOpml' => 'Enable sharing by OPML of corresponding categories and feeds', // TODO 'shareRss' => 'Enable sharing by HTML & RSS', // TODO diff --git a/app/i18n/en-US/conf.php b/app/i18n/en-US/conf.php index d64e93ca1..34d93b7d0 100644 --- a/app/i18n/en-US/conf.php +++ b/app/i18n/en-US/conf.php @@ -152,6 +152,7 @@ return array( 'categories' => 'Display by category', // IGNORE 'feeds' => 'Display by feed', // IGNORE 'order' => 'Sort by date', // IGNORE + 'publish_labels_instead_of_tags' => 'Replace feed tags by user labels in the shared RSS', // IGNORE 'search' => 'Expression', // IGNORE 'shareOpml' => 'Enable sharing by OPML of corresponding categories and feeds', // IGNORE 'shareRss' => 'Enable sharing by HTML & RSS', // IGNORE diff --git a/app/i18n/en/conf.php b/app/i18n/en/conf.php index 025cb4f8f..0b69aede1 100644 --- a/app/i18n/en/conf.php +++ b/app/i18n/en/conf.php @@ -152,6 +152,7 @@ return array( 'categories' => 'Display by category', 'feeds' => 'Display by feed', 'order' => 'Sort by date', + 'publish_labels_instead_of_tags' => 'Replace feed tags by user labels in the shared RSS', 'search' => 'Expression', 'shareOpml' => 'Enable sharing by OPML of corresponding categories and feeds', 'shareRss' => 'Enable sharing by HTML & RSS', diff --git a/app/i18n/es/conf.php b/app/i18n/es/conf.php index 7548a0a38..6655852e6 100644 --- a/app/i18n/es/conf.php +++ b/app/i18n/es/conf.php @@ -152,6 +152,7 @@ return array( 'categories' => 'Mostrar por categoría', 'feeds' => 'Mostrar por fuente', 'order' => 'Ordenar por fecha', + 'publish_labels_instead_of_tags' => 'Replace feed tags by user labels in the shared RSS', // TODO 'search' => 'Expresión', 'shareOpml' => 'Permitir que OPML comparta las categorías y fuentes correspondientes', 'shareRss' => 'Permite compartir por HTML & RSS', diff --git a/app/i18n/fa/conf.php b/app/i18n/fa/conf.php index 96dae6faa..9bf8b7501 100644 --- a/app/i18n/fa/conf.php +++ b/app/i18n/fa/conf.php @@ -152,6 +152,7 @@ return array( 'categories' => ' نمایش بر اساس دسته بندی', 'feeds' => ' نمایش با فید', 'order' => ' مرتب سازی بر اساس تاریخ', + 'publish_labels_instead_of_tags' => 'Replace feed tags by user labels in the shared RSS', // TODO 'search' => ' بیان', 'shareOpml' => 'فعال‌سازی اشتراک‌گذاری دسته‌ها و فیدهای مربوطه با OPML', 'shareRss' => 'اشتراک‌گذاری RSS', diff --git a/app/i18n/fi/conf.php b/app/i18n/fi/conf.php index 40f2be3a7..196137e76 100644 --- a/app/i18n/fi/conf.php +++ b/app/i18n/fi/conf.php @@ -152,6 +152,7 @@ return array( 'categories' => 'Näytä luokan mukaan', 'feeds' => 'Näytä syötteen mukaan', 'order' => 'Lajittele päivämäärän mukaan', + 'publish_labels_instead_of_tags' => 'Replace feed tags by user labels in the shared RSS', // TODO 'search' => 'Lauseke', 'shareOpml' => 'Jaa kyselyä vastaavat luokat ja syötteet OPML-muodossa', 'shareRss' => 'Jaa HTML & RSS -muodossa', diff --git a/app/i18n/fr/conf.php b/app/i18n/fr/conf.php index 432db40c3..befd951f0 100644 --- a/app/i18n/fr/conf.php +++ b/app/i18n/fr/conf.php @@ -152,6 +152,7 @@ return array( 'categories' => 'Afficher par catégorie', 'feeds' => 'Afficher par flux', 'order' => 'Tri par date', + 'publish_labels_instead_of_tags' => 'Remplacer les tags des flux par les étiquettes d’utilisateur dans le RSS partagé', 'search' => 'Expression', // IGNORE 'shareOpml' => 'Active le partage par OPML des catégories et flux correspondants', 'shareRss' => 'Active le partage par HTML & RSS', diff --git a/app/i18n/he/conf.php b/app/i18n/he/conf.php index c67888256..65014e92c 100644 --- a/app/i18n/he/conf.php +++ b/app/i18n/he/conf.php @@ -152,6 +152,7 @@ return array( 'categories' => 'Display by category', // TODO 'feeds' => 'Display by feed', // TODO 'order' => 'Sort by date', // TODO + 'publish_labels_instead_of_tags' => 'Replace feed tags by user labels in the shared RSS', // TODO 'search' => 'Expression', // TODO 'shareOpml' => 'Enable sharing by OPML of corresponding categories and feeds', // TODO 'shareRss' => 'Enable sharing by HTML & RSS', // TODO diff --git a/app/i18n/hu/conf.php b/app/i18n/hu/conf.php index ee37e7c44..f99590288 100644 --- a/app/i18n/hu/conf.php +++ b/app/i18n/hu/conf.php @@ -152,6 +152,7 @@ return array( 'categories' => 'Rendezés kategória szerint', 'feeds' => 'Rendezés hírforrás szerint', 'order' => 'Rendezés dátum szerint', + 'publish_labels_instead_of_tags' => 'Replace feed tags by user labels in the shared RSS', // TODO 'search' => 'Kifejezés', 'shareOpml' => 'Engedélyezze a megfelelő kategóriák és hírcsatornák OPML-alapú megosztását', 'shareRss' => 'Engedélyezze a HTML & RSS megosztást', diff --git a/app/i18n/id/conf.php b/app/i18n/id/conf.php index 64e1bc7c3..26f3fc5fa 100644 --- a/app/i18n/id/conf.php +++ b/app/i18n/id/conf.php @@ -152,6 +152,7 @@ return array( 'categories' => 'Tampilkan berdasarkan kategori', 'feeds' => 'Tampilkan berdasarkan umpan', 'order' => 'Urutkan berdasarkan tanggal', + 'publish_labels_instead_of_tags' => 'Replace feed tags by user labels in the shared RSS', // TODO 'search' => 'Ekspresi Pencarian', 'shareOpml' => 'Aktifkan berbagi melalui OPML dari kategori dan umpan terkait', 'shareRss' => 'Aktifkan berbagi melalui HTML & RSS', diff --git a/app/i18n/it/conf.php b/app/i18n/it/conf.php index 9b8f38c30..2327db4f6 100644 --- a/app/i18n/it/conf.php +++ b/app/i18n/it/conf.php @@ -152,6 +152,7 @@ return array( 'categories' => 'Mostra per categoria', 'feeds' => 'Mostra per feed', 'order' => 'Ordina per data', + 'publish_labels_instead_of_tags' => 'Replace feed tags by user labels in the shared RSS', // TODO 'search' => 'Espressione', 'shareOpml' => 'Abilita la condivisione di OPML di categorie e feed corrispondenti', 'shareRss' => 'Abilita la condivisione di HTML & RSS', diff --git a/app/i18n/ja/conf.php b/app/i18n/ja/conf.php index db04ea4f9..bf1b58413 100644 --- a/app/i18n/ja/conf.php +++ b/app/i18n/ja/conf.php @@ -152,6 +152,7 @@ return array( 'categories' => 'カテゴリごとに表示する', 'feeds' => 'フィードごとに表示する', 'order' => '日付ごとにソートする', + 'publish_labels_instead_of_tags' => 'Replace feed tags by user labels in the shared RSS', // TODO 'search' => '式', 'shareOpml' => 'カテゴリとフィードのOPMLによる共有を有効にする', 'shareRss' => 'HTMLとRSSによる共有を有効にする', diff --git a/app/i18n/ko/conf.php b/app/i18n/ko/conf.php index b659190d2..82da8dd53 100644 --- a/app/i18n/ko/conf.php +++ b/app/i18n/ko/conf.php @@ -152,6 +152,7 @@ return array( 'categories' => '카테고리별로 표시', 'feeds' => '피드별로 표시', 'order' => '날짜순으로 정렬', + 'publish_labels_instead_of_tags' => 'Replace feed tags by user labels in the shared RSS', // TODO 'search' => '정규 표현식', 'shareOpml' => '해당 카테고리와 피드에 대한 OPML 공유 활성화', 'shareRss' => 'HTML 및 RSS 공유 활성화', diff --git a/app/i18n/lv/conf.php b/app/i18n/lv/conf.php index 6375860e4..929826f3f 100644 --- a/app/i18n/lv/conf.php +++ b/app/i18n/lv/conf.php @@ -152,6 +152,7 @@ return array( 'categories' => 'Rādīt pēc kategorijas', 'feeds' => 'Rādīt pēc barotnes', 'order' => 'Kārtot pēc datuma', + 'publish_labels_instead_of_tags' => 'Replace feed tags by user labels in the shared RSS', // TODO 'search' => 'Izteiksme', 'shareOpml' => 'Enable sharing by OPML of corresponding categories and feeds', // TODO 'shareRss' => 'Enable sharing by HTML & RSS', // TODO diff --git a/app/i18n/nl/conf.php b/app/i18n/nl/conf.php index d3cd21cd2..47690b475 100644 --- a/app/i18n/nl/conf.php +++ b/app/i18n/nl/conf.php @@ -152,6 +152,7 @@ return array( 'categories' => 'Weergeven op categorie', 'feeds' => 'Weergeven op feed', 'order' => 'Sorteren op datum', + 'publish_labels_instead_of_tags' => 'Replace feed tags by user labels in the shared RSS', // TODO 'search' => 'Expressie', 'shareOpml' => 'Via OPML delen van bijbehorende categorieën en feeds aanzetten', 'shareRss' => 'Via HTML & RSS delen aanzetten', diff --git a/app/i18n/oc/conf.php b/app/i18n/oc/conf.php index f8c5ecb44..6d02a97c9 100644 --- a/app/i18n/oc/conf.php +++ b/app/i18n/oc/conf.php @@ -152,6 +152,7 @@ return array( 'categories' => 'Afichatge per categoria', 'feeds' => 'Afichatge per flux', 'order' => 'Triar per data', + 'publish_labels_instead_of_tags' => 'Replace feed tags by user labels in the shared RSS', // TODO 'search' => 'Expression', // IGNORE 'shareOpml' => 'Enable sharing by OPML of corresponding categories and feeds', // TODO 'shareRss' => 'Enable sharing by HTML & RSS', // TODO diff --git a/app/i18n/pl/conf.php b/app/i18n/pl/conf.php index 41a6e9808..69f158ee7 100644 --- a/app/i18n/pl/conf.php +++ b/app/i18n/pl/conf.php @@ -152,6 +152,7 @@ return array( 'categories' => 'Według kategorii', 'feeds' => 'Według kanału', 'order' => 'Sortowanie wg daty', + 'publish_labels_instead_of_tags' => 'Replace feed tags by user labels in the shared RSS', // TODO 'search' => 'Wyrażenie', 'shareOpml' => 'Włącz udostępnianie OPML-ów zawierających kategorie i kanały', 'shareRss' => 'Włącz udostępnianie przez HTML i RSS', diff --git a/app/i18n/pt-BR/conf.php b/app/i18n/pt-BR/conf.php index 9f2daba08..39d6ec077 100644 --- a/app/i18n/pt-BR/conf.php +++ b/app/i18n/pt-BR/conf.php @@ -152,6 +152,7 @@ return array( 'categories' => 'Exibir por categoria', 'feeds' => 'Exibir por feed', 'order' => 'Ordenar por data', + 'publish_labels_instead_of_tags' => 'Replace feed tags by user labels in the shared RSS', // TODO 'search' => 'Expressão', 'shareOpml' => 'Habilita o compartilhamento por OPML de categorias e feeds correspondentes', 'shareRss' => 'Habilita o compartilhamento por HTML & RSS', diff --git a/app/i18n/pt-PT/conf.php b/app/i18n/pt-PT/conf.php index 5977c0b97..c7a310156 100644 --- a/app/i18n/pt-PT/conf.php +++ b/app/i18n/pt-PT/conf.php @@ -152,6 +152,7 @@ return array( 'categories' => 'Mostrar por categoria', 'feeds' => 'Mostrar por feed', 'order' => 'Ordenar por data', + 'publish_labels_instead_of_tags' => 'Replace feed tags by user labels in the shared RSS', // TODO 'search' => 'Expressão', 'shareOpml' => 'Activa a partilha por OPML de categorias e feeds correspondentes', 'shareRss' => 'Activa o partilha por HTML & RSS', diff --git a/app/i18n/ru/conf.php b/app/i18n/ru/conf.php index 8f1eedc7f..31ed9b3cb 100644 --- a/app/i18n/ru/conf.php +++ b/app/i18n/ru/conf.php @@ -152,6 +152,7 @@ return array( 'categories' => 'Отображение по категории', 'feeds' => 'Отображение по ленте', 'order' => 'Сортировать по дате', + 'publish_labels_instead_of_tags' => 'Replace feed tags by user labels in the shared RSS', // TODO 'search' => 'Выражение', 'shareOpml' => 'Включить общий доступ с помощью OPML к соответствующим категориям и лентам', 'shareRss' => 'Включить общий доступ с помощью HTML & RSS', diff --git a/app/i18n/sk/conf.php b/app/i18n/sk/conf.php index 604f2f9ad..d848d8f0d 100644 --- a/app/i18n/sk/conf.php +++ b/app/i18n/sk/conf.php @@ -152,6 +152,7 @@ return array( 'categories' => 'Zobraziť podľa kategórie', 'feeds' => 'Zobraziť podľa kanála', 'order' => 'Zobraziť podľa dátumu', + 'publish_labels_instead_of_tags' => 'Replace feed tags by user labels in the shared RSS', // TODO 'search' => 'Výraz', 'shareOpml' => 'Povoliť zdieľanie prostredníctvom OPML zodpovedajúdich kategórií a kanálov', 'shareRss' => 'Povoliť zdieľanie prostredníctvom HTML & RSS', diff --git a/app/i18n/tr/conf.php b/app/i18n/tr/conf.php index 32c8060c5..7c1fae419 100644 --- a/app/i18n/tr/conf.php +++ b/app/i18n/tr/conf.php @@ -152,6 +152,7 @@ return array( 'categories' => 'Kategoriye göre göster', 'feeds' => 'Beslemeye göre göster', 'order' => 'Tarihe göre sırala', + 'publish_labels_instead_of_tags' => 'Replace feed tags by user labels in the shared RSS', // TODO 'search' => 'İfade', 'shareOpml' => 'İlgili kategori ve beslemelerin OPML ile paylaşımını etkinleştir', 'shareRss' => 'HTML ve RSS ile paylaşımı etkinleştir', diff --git a/app/i18n/uk/conf.php b/app/i18n/uk/conf.php index e3e9a8fae..9a46c2e15 100644 --- a/app/i18n/uk/conf.php +++ b/app/i18n/uk/conf.php @@ -152,6 +152,7 @@ return array( 'categories' => 'Показати категорію', 'feeds' => 'Показати стрічку', 'order' => 'Впорядкувати за датою', + 'publish_labels_instead_of_tags' => 'Replace feed tags by user labels in the shared RSS', // TODO 'search' => 'Вираз', 'shareOpml' => 'Увімкнути OPML-поширення відповідних категорій і стрічок', 'shareRss' => 'Увімкнути поширення в форматі HTML і RSS', diff --git a/app/i18n/zh-CN/conf.php b/app/i18n/zh-CN/conf.php index 1ee9bf404..6b188e5ff 100644 --- a/app/i18n/zh-CN/conf.php +++ b/app/i18n/zh-CN/conf.php @@ -152,6 +152,7 @@ return array( 'categories' => '按分类显示', 'feeds' => '按订阅源显示', 'order' => '按日期排序', + 'publish_labels_instead_of_tags' => 'Replace feed tags by user labels in the shared RSS', // TODO 'search' => '表达式', 'shareOpml' => '启用相应类别和 feed 的 OPML 分享', 'shareRss' => '启用 HTML 和 RSS 分享', diff --git a/app/i18n/zh-TW/conf.php b/app/i18n/zh-TW/conf.php index ac83b7c1f..6057f46b0 100644 --- a/app/i18n/zh-TW/conf.php +++ b/app/i18n/zh-TW/conf.php @@ -152,6 +152,7 @@ return array( 'categories' => '按分類顯示', 'feeds' => '按訂閱源顯示', 'order' => '按日期排序', + 'publish_labels_instead_of_tags' => 'Replace feed tags by user labels in the shared RSS', // TODO 'search' => '表達式', 'shareOpml' => '啟用透過對應類別和源的OPML分享', 'shareRss' => '啟用透過HTML分享 & RSS', 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