Compare commits

...
Sign in to create a new pull request.

3 commits

Author SHA1 Message Date
Zankaria
026a70988c overboards: remove obsolete code 2024-10-20 14:01:30 +02:00
Zankaria
52dd8960a9 overboards: parametize post form inclusion 2024-10-20 14:01:30 +02:00
Zankaria
a88a2e647e overboards: minor format 2024-10-20 14:01:30 +02:00

View file

@ -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,35 +201,18 @@
$html .= '<script>var ukko_overflow = ' . json_encode($overflow) . '</script>';
$html .= '<script type="text/javascript" src="/'.$overboard['uri'].'/overboard.js?=' . $config['resource_version'] . '"></script>';
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))),
),
'no_post_form' => true,
'subtitle' => str_replace('%s', $overboard['thread_limit'], strval(min($overboard['subtitle'], $total_count))),
],
'no_post_form' => !$config['overboard_post_form'],
'body' => $html,
'mod' => $mod,
'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;
}
}