From 197cd5028cf568356608858b0596100ea687642c Mon Sep 17 00:00:00 2001 From: Benjamin Southall Date: Sat, 10 Dec 2016 18:33:52 +0900 Subject: [PATCH] Adding board name to title of catalog theme --- templates/themes/catalog/catalog.html | 3 ++- templates/themes/catalog/theme.php | 15 +++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/templates/themes/catalog/catalog.html b/templates/themes/catalog/catalog.html index e556b4a9..ac19a90e 100644 --- a/templates/themes/catalog/catalog.html +++ b/templates/themes/catalog/catalog.html @@ -7,6 +7,7 @@ var active_page = "catalog" , board_name = "{{ board }}"; + {{ settings.title }} ( /{{ board }}/ ) {% include 'header.html' %} @@ -41,7 +42,7 @@ - +

{% for post in recent_posts %} diff --git a/templates/themes/catalog/theme.php b/templates/themes/catalog/theme.php index 24cdcbb8..3ef974c3 100644 --- a/templates/themes/catalog/theme.php +++ b/templates/themes/catalog/theme.php @@ -15,7 +15,7 @@ // - post-thread (a thread has been made) if ($action === 'all') { foreach ($boards as $board) { - $b = new Catalog(); + $b = new Catalog($settings); $action = generation_strategy("sb_catalog", array($board)); if ($action == 'delete') { @@ -27,7 +27,7 @@ } } } elseif ($action == 'post-thread' || ($settings['update_on_posts'] && $action == 'post') || ($settings['update_on_posts'] && $action == 'post-delete') && in_array($board, $boards)) { - $b = new Catalog(); + $b = new Catalog($settings); $action = generation_strategy("sb_catalog", array($board)); if ($action == 'delete') { @@ -148,10 +148,13 @@ /** * Build and save the HTML of the catalog for the given board */ - public function build($board_name) { - if (!openBoard($board_name)) { - error(sprintf(_("Board %s doesn't exist"), $post['board'])); - } + public function build($settings, $board_name) { + global $config, $board; + if ($board['uri'] != $board_name) { + if (!openBoard($board_name)) { + error(sprintf(_("Board %s doesn't exist"), $board_name)); + } + } if (array_key_exists($board_name, $this->threadsCache)) { $threads = $this->threadsCache[$board_name];