Browse Source

Implemented mods can't access random from dashboard #88. Please note this doesn't use mod custom_pages functionality provided by vichan (because the that only works if your overboard has name that doesn't look like other boards), and requires ['overboards'] to be set as an array of board uri's which are overboards, with the correct values for type (theme type e.g. ukko, rand or semirand) title, subtitle, thread_limit and exclude in array of for each board uri

main
Benjamin Southall 7 years ago
committed by -
parent
commit
b54d414bc4
  1. 11
      inc/config.php
  2. 23
      inc/mod/pages.php
  3. 2
      templates/themes/rand/info.php
  4. 2
      templates/themes/semirand/info.php
  5. 2
      templates/themes/ukko/info.php

11
inc/config.php

@ -1005,6 +1005,17 @@
// Show "Catalog" link in page navigation. Use with the Catalog theme. Set to false to disable.
$config['catalog_link'] = 'catalog.html';
// Overboard details. Used to enable mod.php to browse overboards such as ukko and rand.
// $config['overboards'] = array(
// '*' => array(
// 'type' => 'ukko',
// 'title' => 'Ukko',
// 'subtitle' => '',
// 'thread_limit' => '10',
// 'exclude' => ''
// )
// );
// Board categories. Only used in the "Categories" theme.
// $config['categories'] = array(
// 'Group Name' => array('a', 'b', 'c'),

23
inc/mod/pages.php

@ -737,8 +737,27 @@ function mod_board_log($board, $page_no = 1, $hide_names = false, $public = fals
function mod_view_board($boardName, $page_no = 1) {
global $config, $mod;
if (!openBoard($boardName))
error($config['error']['noboard']);
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'];
$overboard->settings['exclude'] = $config['overboards'][$boardName]['exclude'];
echo $overboard->build($mod);
return;
}
else {
error($config['error']['noboard']);
}
}
if (!$page = index($page_no, $mod)) {
error($config['error']['404']);

2
templates/themes/rand/info.php

@ -4,7 +4,7 @@
// Theme name
$theme['name'] = 'Random Overboard';
// Description (you can use Tinyboard markup here)
$theme['description'] = 'Board with threads and messages from all boards, sorted randomly';
$theme['description'] = 'Board with threads and messages from all boards, sorted randomly. Remember to update $config[\'overboards\'] to allow mod.php access.';
$theme['version'] = 'v0.2';
// Theme configuration

2
templates/themes/semirand/info.php

@ -4,7 +4,7 @@
$theme = array(
'name' => 'Mixed All/Random Overboard',
// Description (you can use Tinyboard markup here)
'description' => 'Board with threads from all boards with most recently bumped and random ones intermixed',
'description' => 'Board with threads from all boards with most recently bumped and random ones intermixed. Remember to update $config[\'overboards\'] to allow mod.php access.',
'version' => 'v0.1',
// Unique function name for building and installing whatever's necessary
'build_function' => 'semirand_build',

2
templates/themes/ukko/info.php

@ -4,7 +4,7 @@
// Theme name
$theme['name'] = 'Overboard (Ukko)';
// Description (you can use Tinyboard markup here)
$theme['description'] = 'Board with threads and messages from all boards';
$theme['description'] = 'Board with threads and messages from all boards. Remember to update $config[\'overboards\'] to allow mod.php access.';
$theme['version'] = 'v0.2';
// Theme configuration

Loading…
Cancel
Save