From 57cf30cf7f068b71dbacca33ccc49965de8e71d8 Mon Sep 17 00:00:00 2001 From: Appleman1234 Date: Wed, 12 Jan 2022 14:17:20 +1000 Subject: Make index.rss catalog rss use full url linking instead of relative links --- templates/themes/catalog/index.rss | 8 ++++---- templates/themes/catalog/info.php | 8 ++++++++ templates/themes/catalog/theme.php | 1 + 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/templates/themes/catalog/index.rss b/templates/themes/catalog/index.rss index e6576ffc..1d925398 100644 --- a/templates/themes/catalog/index.rss +++ b/templates/themes/catalog/index.rss @@ -2,15 +2,15 @@ /{{ board.uri }}/ - {{ board.title|e }} - {{ config.root }}{{ board.uri }}/ + {{ settings.base_url }}{{ config.root }}{{ board.uri }}/ Live feed of new threads on the board /{{ board.uri }}/ - {{ board.title|e }}. {% for post in recent_posts %} {% if post.subject %}{{ post.subject|e }}{% else %}{{ post.body_nomarkup[:256]|remove_modifiers|e }}{% endif %} - {{ config.root }}{{ board.uri }}/res/{{ post.id }}.html - {{ config.root }}{{ board.uri }}/res/{{ post.id }}.html - {{ config.root }}{{ board.uri }}/res/{{ post.id }}.html + {{ settings.base_url }}{{ config.root }}{{ board.uri }}/res/{{ post.id }}.html + {{ settings.base_url }}{{ config.root }}{{ board.uri }}/res/{{ post.id }}.html + {{ settings.base_url }}{{ config.root }}{{ board.uri }}/res/{{ post.id }}.html {{ post.pubdate }} {{ post.body }} ]]> diff --git a/templates/themes/catalog/info.php b/templates/themes/catalog/info.php index 0e7581f0..bc0e7eb5 100644 --- a/templates/themes/catalog/info.php +++ b/templates/themes/catalog/info.php @@ -84,6 +84,14 @@ 'comment' => 'Check this if you wish to show a nice tooltip with info about the thread on mouse over.' ); + $theme['config'][] = Array( + 'title' => 'Base URL', + 'name' => 'base_url', + 'type' => 'text', + 'default' => 'http://test.com', + 'comment' => '(eg. "http://test.com")' + ); + // Unique function name for building everything $theme['build_function'] = 'catalog_build'; diff --git a/templates/themes/catalog/theme.php b/templates/themes/catalog/theme.php index bc312fc0..1b55d56e 100644 --- a/templates/themes/catalog/theme.php +++ b/templates/themes/catalog/theme.php @@ -399,6 +399,7 @@ ))); file_write($config['dir']['home'] . $board_name . '/index.rss', Element('themes/catalog/index.rss', Array( + 'settings' => $this->settings, 'config' => $config, 'recent_posts' => $recent_posts, 'board' => $board -- cgit v1.3