Move forum config to settings

This commit is contained in:
slawkens
2023-07-20 16:36:59 +02:00
parent a7b8ccaee2
commit 55a5ccdd1e
15 changed files with 128 additions and 44 deletions

View File

@@ -11,22 +11,24 @@
defined('MYAAC') or die('Direct access not allowed!');
$title = 'Forum';
if(strtolower($config['forum']) != 'site') {
if($config['forum'] != '') {
header('Location: ' . $config['forum']);
require_once LIBS . 'forum.php';
$forumSetting = setting('core.forum');
if(strtolower($forumSetting) != 'site') {
if($forumSetting != '') {
header('Location: ' . $forumSetting);
exit;
}
echo 'Forum is disabled on this site.';
return;
return false;
}
if(!$logged) {
echo 'You are not logged in. <a href="?subtopic=accountmanagement&redirect=' . BASE_URL . urlencode('?subtopic=forum') . '">Log in</a> to post on the forum.<br /><br />';
return false;
}
require_once LIBS . 'forum.php';
$sections = array();
foreach(getForumBoards() as $section) {
$sections[$section['id']] = array(