From a88a2e647e3c95cbbcdfd7835afa19ae09d1516a Mon Sep 17 00:00:00 2001 From: Zankaria Date: Sun, 20 Oct 2024 11:48:05 +0200 Subject: [PATCH 1/3] overboards: minor format --- templates/themes/overboards/theme.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/templates/themes/overboards/theme.php b/templates/themes/overboards/theme.php index 409062d6..9e68cb17 100644 --- a/templates/themes/overboards/theme.php +++ b/templates/themes/overboards/theme.php @@ -29,7 +29,7 @@ // Copy the generated board HTML to its place file_write($overboard['uri'] . '/index.html', $overboards->build($overboard)); file_write($overboard['uri'] . '/overboard.js', - Element('themes/overboards/overboard.js', array())); + Element('themes/overboards/overboard.js', [])); } } } @@ -157,7 +157,7 @@ global $config; $html = ''; - $overflow = array(); + $overflow = []; // Fetch threads from all boards and chomp the first 'n' posts, depending // on the setting @@ -166,7 +166,7 @@ // Top threads displayed on load $top_threads = array_splice($threads, 0, $overboard['thread_limit']); // Number of processed threads by board - $counts = array(); + $counts = []; // Output threads up to the specified limit foreach ($top_threads as $post) { @@ -201,20 +201,19 @@ $html .= ''; $html .= ''; - return Element('index.html', array( + return Element('index.html', [ 'config' => $config, - 'board' => array( + 'board' => [ 'dir' => $overboard['uri'] . "/", 'url' => $overboard['uri'], 'title' => $overboard['title'], - 'subtitle' => str_replace('%s', $overboard['thread_limit'], - strval(min($overboard['subtitle'], $total_count))), - ), + 'subtitle' => str_replace('%s', $overboard['thread_limit'], strval(min($overboard['subtitle'], $total_count))), + ], 'no_post_form' => true, 'body' => $html, 'mod' => $mod, 'boardlist' => createBoardlist($mod), - )); + ]); } }; From 52dd8960a9c212991a90ccaef7b5724acc51272a Mon Sep 17 00:00:00 2001 From: Zankaria Date: Sun, 20 Oct 2024 11:52:21 +0200 Subject: [PATCH 2/3] overboards: parametize post form inclusion --- templates/themes/overboards/theme.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/themes/overboards/theme.php b/templates/themes/overboards/theme.php index 9e68cb17..49ddd412 100644 --- a/templates/themes/overboards/theme.php +++ b/templates/themes/overboards/theme.php @@ -209,7 +209,7 @@ 'title' => $overboard['title'], 'subtitle' => str_replace('%s', $overboard['thread_limit'], strval(min($overboard['subtitle'], $total_count))), ], - 'no_post_form' => true, + 'no_post_form' => !$config['overboard_post_form'], 'body' => $html, 'mod' => $mod, 'boardlist' => createBoardlist($mod), From 026a70988ca095ee3156edd79b4e6294f86cf37c Mon Sep 17 00:00:00 2001 From: Zankaria Date: Sun, 20 Oct 2024 11:52:52 +0200 Subject: [PATCH 3/3] overboards: remove obsolete code --- templates/themes/overboards/theme.php | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/templates/themes/overboards/theme.php b/templates/themes/overboards/theme.php index 49ddd412..2a081052 100644 --- a/templates/themes/overboards/theme.php +++ b/templates/themes/overboards/theme.php @@ -215,20 +215,4 @@ 'boardlist' => createBoardlist($mod), ]); } - }; - - if (!function_exists('array_column')) { - /** - * Pick out values from subarrays by given key - */ - function array_column($array, $key) { - $result = []; - foreach ($array as $val) { - $result[] = $val[$key]; - } - return $result; - } - } - -