Browse Source

Add foreign boards option to config

- this will append links to other websites at the end of the board list
- added getchan.net's /GET/ and /ref/
pull/40/head
towards-a-new-leftypol 3 years ago
parent
commit
92bbc50e78
  1. 20
      inc/display.php
  2. 93
      inc/instance-config.php

20
inc/display.php

@ -50,6 +50,7 @@ function doBoardListPart($list, $root, &$boards) {
} }
} }
} }
$body = preg_replace('/\/$/', '', $body); $body = preg_replace('/\/$/', '', $body);
return $body; return $body;
@ -68,6 +69,25 @@ function createBoardlist($mod=false) {
$body = doBoardListPart($config['boards'], $mod?'?/':$config['root'], $boards); $body = doBoardListPart($config['boards'], $mod?'?/':$config['root'], $boards);
if (isset($config['foreign_boards'])) {
$body .= ' <span class="sub">[';
// Append links to foreign boards
$i = 0;
foreach ($config['foreign_boards'] as $fboardname => $fboardurl) {
$i++;
$body .= ' <a href="' . $fboardurl . '">' . $fboardname . '</a>';
// only put slash in between elements
if ($i != count($config['foreign_boards'])) {
$body .= ' /';
}
}
$body .= ']</span> ';
}
if ($config['boardlist_wrap_bracket'] && !preg_match('/\] $/', $body)) if ($config['boardlist_wrap_bracket'] && !preg_match('/\] $/', $body))
$body = '[' . $body . ']'; $body = '[' . $body . ']';

93
inc/instance-config.php

@ -12,50 +12,55 @@
* Front page configurations. * Front page configurations.
*/ */
$config['boards'] = array( $config['boards'] = array(
array('leftypol', array('leftypol',
'b', 'b',
'hobby', 'hobby',
'tech', 'tech',
'edu', 'edu',
'games', 'games',
'anime' 'anime'
) , ) ,
array('meta') array('meta')
); );
// Board categories. Only used in the "Categories" theme. $config['foreign_boards'] = array(
$config['categories'] = array( 'GET' => 'https://getchan.net/GET/',
'Leftypol' => array('leftypol', 'ref' => 'https://getchan.net/ref/'
'b', );
'hobby', // Board categories. Only used in the "Categories" theme.
'tech', $config['categories'] = array(
'edu', 'Leftypol' => array('leftypol',
'games', 'b',
'anime' 'hobby',
), 'tech',
'Meta' => array('meta') 'edu',
); 'games',
// Optional for the Categories theme. This is an array of name => (title, url) groups for categories 'anime'
// with non-board links. ),
$config['custom_categories'] = array( 'Meta' => array('meta')
'Our Friends' => array( );
'GET' => 'https://getchan.net/GET/',
'ref' => 'https://getchan.net/ref/' // Optional for the Categories theme. This is an array of name => (title, url) groups for categories
), // with non-board links.
'Links' => array( $config['custom_categories'] = array(
'New Multitude' => 'https://newmultitude.org/', 'Our Friends' => array(
'Booru image repository' => 'https://lefty.booru.org/', 'GET' => 'https://getchan.net/GET/',
'Leftypedia' => 'https://leftypedia.org/', 'ref' => 'https://getchan.net/ref/'
'Official chat room' => 'https://app.element.io/#/room/!RQxdjfGouwsFHwUzwL:matrix.org', ),
'Rules' => 'rules.html' 'Links' => array(
), 'New Multitude' => 'https://newmultitude.org/',
'Learning resources and blogs' => array( 'Booru image repository' => 'https://lefty.booru.org/',
'Michael Roberts\' blog' => 'https://thenextrecession.wordpress.com/', 'Leftypedia' => 'https://leftypedia.org/',
'A Critique Of Crisis Theory blog' => 'https://critiqueofcrisistheory.wordpress.com/', 'Official chat room' => 'https://app.element.io/#/room/!RQxdjfGouwsFHwUzwL:matrix.org',
'Leftypedia' => 'https://leftypedia.org/', 'Rules' => 'rules.html'
'Marxis Internet Archive' => 'https://www.marxists.org/' ),
), 'Learning resources and blogs' => array(
); 'Michael Roberts\' blog' => 'https://thenextrecession.wordpress.com/',
'A Critique Of Crisis Theory blog' => 'https://critiqueofcrisistheory.wordpress.com/',
'Leftypedia' => 'https://leftypedia.org/',
'Marxis Internet Archive' => 'https://www.marxists.org/'
),
);
/* /*
* Database and site wide configurations * Database and site wide configurations

Loading…
Cancel
Save