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

@@ -10,7 +10,7 @@
*/
defined('MYAAC') or die('Direct access not allowed!');
$configForumTablePrefix = config('forum_table_prefix');
$configForumTablePrefix = setting('core.forum_table_prefix');
if(null !== $configForumTablePrefix && !empty(trim($configForumTablePrefix))) {
if(!in_array($configForumTablePrefix, array('myaac_', 'z_'))) {
throw new RuntimeException('Invalid value for forum_table_prefix in config.php. Can be only: "myaac_" or "z_".');
@@ -47,7 +47,7 @@ class Forum
return
$db->query(
'SELECT `id` FROM `players` WHERE `account_id` = ' . $db->quote($account->getId()) .
' AND `level` >= ' . $db->quote($config['forum_level_required']) .
' AND `level` >= ' . $db->quote(setting('core.forum_level_required')) .
' LIMIT 1')->rowCount() > 0;
}