Browse Source

Add overboard index support. Yet another ugly hack

pull/113/head
Zankaria 2 months ago
committed by Moffintosh
parent
commit
b742445f50
  1. 36
      inc/mod/pages.php

36
inc/mod/pages.php

@ -786,34 +786,18 @@ function mod_view_board($boardName, $page_no = 1) {
global $config, $mod;
if (!openBoard($boardName)){
if (in_array($boardName, array_keys($config['overboards']))){
$type = $config['overboards'][$boardName]['type'];
require_once("templates/themes/$type/theme.php");
global $mod;
$overboard = new $type();
$overboard->settings = array();
$overboard->settings['uri'] = $boardName;
$overboard->settings['title'] = $config['overboards'][$boardName]['title'];
$overboard->settings['subtitle'] = $config['overboards'][$boardName]['subtitle'];
$overboard->settings['thread_limit'] = $config['overboards'][$boardName]['thread_limit'];
if (array_key_exists('exclude',$config['overboards'][$boardName])) {
$overboard->settings['exclude'] = $config['overboards'][$boardName]['exclude'];
}
if (array_key_exists('include',$config['overboards'][$boardName])) {
$overboard->settings['include'] = $config['overboards'][$boardName]['include'];
require "templates/themes/overboards/overboards.php";
foreach ($overboards_config as $settings) {
if ($settings['uri'] === $boardName) {
require "templates/themes/overboards/theme.php";
$overboard = new overboards($overboards_config);
echo $overboard->build($settings, true);
return;
}
$overboard->settings['boards'] = listBoards();
echo $overboard->build($mod);
return;
}
elseif (in_array($boardName,array_keys($config['boards_alias']))){
$boardName = $config['boards_alias'][$boardName];
openBoard($boardName);
}
else {
error($config['error']['noboard']);
}
error($config['error']['404']);
}
if (!$page = index($page_no, $mod)) {

Loading…
Cancel
Save