summaryrefslogtreecommitdiff
path: root/inc/mod/pages.php
diff options
context:
space:
mode:
authorBenjamin Southall <applemansigloo@gmail.com>2017-04-11 03:08:20 +0900
committerBenjamin Southall <applemansigloo@gmail.com>2017-04-11 03:08:20 +0900
commitddbabcccab20faf0a005b35137d69e6f33023d22 (patch)
treed4af25851ba2463e7b2e2898073b181d831f7632 /inc/mod/pages.php
parente37a3d6e6422d11ad515b76080f3e90b29be1735 (diff)
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
Diffstat (limited to 'inc/mod/pages.php')
-rw-r--r--inc/mod/pages.php22
1 files changed, 20 insertions, 2 deletions
diff --git a/inc/mod/pages.php b/inc/mod/pages.php
index ab7c240e..57174162 100644
--- a/inc/mod/pages.php
+++ b/inc/mod/pages.php
@@ -741,8 +741,26 @@ 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);
+ }
+ else {
+ error($config['error']['noboard']);
+ }
+ }
if (!$page = index($page_no, $mod)) {
error($config['error']['404']);