forked from leftypol/leftypol
Compare commits
3 commits
config
...
33-overboa
Author | SHA1 | Date | |
---|---|---|---|
![]() |
026a70988c | ||
![]() |
52dd8960a9 | ||
![]() |
a88a2e647e |
1 changed files with 9 additions and 26 deletions
|
@ -29,7 +29,7 @@
|
||||||
// Copy the generated board HTML to its place
|
// Copy the generated board HTML to its place
|
||||||
file_write($overboard['uri'] . '/index.html', $overboards->build($overboard));
|
file_write($overboard['uri'] . '/index.html', $overboards->build($overboard));
|
||||||
file_write($overboard['uri'] . '/overboard.js',
|
file_write($overboard['uri'] . '/overboard.js',
|
||||||
Element('themes/overboards/overboard.js', array()));
|
Element('themes/overboards/overboard.js', []));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -157,7 +157,7 @@
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$html = '';
|
$html = '';
|
||||||
$overflow = array();
|
$overflow = [];
|
||||||
|
|
||||||
// Fetch threads from all boards and chomp the first 'n' posts, depending
|
// Fetch threads from all boards and chomp the first 'n' posts, depending
|
||||||
// on the setting
|
// on the setting
|
||||||
|
@ -166,7 +166,7 @@
|
||||||
// Top threads displayed on load
|
// Top threads displayed on load
|
||||||
$top_threads = array_splice($threads, 0, $overboard['thread_limit']);
|
$top_threads = array_splice($threads, 0, $overboard['thread_limit']);
|
||||||
// Number of processed threads by board
|
// Number of processed threads by board
|
||||||
$counts = array();
|
$counts = [];
|
||||||
|
|
||||||
// Output threads up to the specified limit
|
// Output threads up to the specified limit
|
||||||
foreach ($top_threads as $post) {
|
foreach ($top_threads as $post) {
|
||||||
|
@ -201,35 +201,18 @@
|
||||||
$html .= '<script>var ukko_overflow = ' . json_encode($overflow) . '</script>';
|
$html .= '<script>var ukko_overflow = ' . json_encode($overflow) . '</script>';
|
||||||
$html .= '<script type="text/javascript" src="/'.$overboard['uri'].'/overboard.js?=' . $config['resource_version'] . '"></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,
|
'config' => $config,
|
||||||
'board' => array(
|
'board' => [
|
||||||
'dir' => $overboard['uri'] . "/",
|
'dir' => $overboard['uri'] . "/",
|
||||||
'url' => $overboard['uri'],
|
'url' => $overboard['uri'],
|
||||||
'title' => $overboard['title'],
|
'title' => $overboard['title'],
|
||||||
'subtitle' => str_replace('%s', $overboard['thread_limit'],
|
'subtitle' => str_replace('%s', $overboard['thread_limit'], strval(min($overboard['subtitle'], $total_count))),
|
||||||
strval(min($overboard['subtitle'], $total_count))),
|
],
|
||||||
),
|
'no_post_form' => !$config['overboard_post_form'],
|
||||||
'no_post_form' => true,
|
|
||||||
'body' => $html,
|
'body' => $html,
|
||||||
'mod' => $mod,
|
'mod' => $mod,
|
||||||
'boardlist' => createBoardlist($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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue