Reviewed some settings again, fixing many glitches

This commit is contained in:
slawkens
2023-08-24 17:20:32 +02:00
parent 3ef53aff6c
commit 0746708743
56 changed files with 181 additions and 170 deletions

View File

@@ -140,8 +140,8 @@ class CreateCharacter
if(empty($errors))
{
$number_of_players_on_account = $account->getPlayersList(true)->count();
if($number_of_players_on_account >= config('characters_per_account'))
$errors[] = 'You have too many characters on your account <b>('.$number_of_players_on_account.'/'.config('characters_per_account').')</b>!';
if($number_of_players_on_account >= setting('core.characters_per_account'))
$errors[] = 'You have too many characters on your account <b>('.$number_of_players_on_account . '/' . setting('core.characters_per_account') . ')</b>!';
}
if(empty($errors))

View File

@@ -10,13 +10,13 @@
*/
defined('MYAAC') or die('Direct access not allowed!');
$configForumTablePrefix = setting('core.forum_table_prefix');
if(null !== $configForumTablePrefix && !empty(trim($configForumTablePrefix))) {
if(!in_array($configForumTablePrefix, array('myaac_', 'z_'))) {
$settingForumTablePrefix = setting('core.forum_table_prefix');
if(null !== $settingForumTablePrefix && !empty(trim($settingForumTablePrefix))) {
if(!in_array($settingForumTablePrefix, array('myaac_', 'z_'))) {
throw new RuntimeException('Invalid value for forum_table_prefix in config.php. Can be only: "myaac_" or "z_".');
}
define('FORUM_TABLE_PREFIX', $configForumTablePrefix);
define('FORUM_TABLE_PREFIX', $settingForumTablePrefix);
}
else {
if($db->hasTable('z_forum')) {

View File

@@ -106,8 +106,8 @@ WHERE TABLE_SCHEMA = "' . $config['database_name'] . '";');
}
$ret['templates'] = get_templates();
$ret['date_timezone'] = $config['date_timezone'];
$ret['backward_support'] = $config['backward_support'];
$ret['date_timezone'] = setting('core.date_timezone');
$ret['backward_support'] = setting('core.backward_support');
$cache_engine = strtolower($config['cache_engine']);
if($cache_engine == 'auto') {
@@ -117,4 +117,4 @@ WHERE TABLE_SCHEMA = "' . $config['database_name'] . '";');
$ret['cache_engine'] = $cache_engine;
return $ret;
}
}
}