Can't get additional config vars to display on board settings page

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
User avatar
kinerity
Community Team Member
Community Team Member
Posts: 1683
Joined: Mon Sep 01, 2014 1:00 am
Location: sudo rm -rf /
Name: Kailey Truscott
Contact:

Can't get additional config vars to display on board settings page

Post by kinerity » Mon Apr 16, 2018 1:00 am

I can't get my new $config_vars to display after the warnings_expire_days var in board settings. The config vars in the database match my naming convention as well as the language vars.

Code: Select all

public function acp_board_config_edit_add($event)
{
	if ($event['mode'] == 'settings')
	{
		$display_vars = $event['display_vars'];

		$config_vars = array(
			'autoban_warnings'	=> array('lang' => 'AUTOBAN_WARNINGS', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true),
			'autoban_expire'	=> array('lang' => 'AUTOBAN_EXPIRE', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true),
		);

		$display_vars = phpbb_insert_config_array($display_vars, $config_vars, array('after' => 'warnings_expire_days'));

		$event['display_vars'] = $display_vars;
	}
}
Kailey Truscott - Community Team

User avatar
3Di
Registered User
Posts: 12686
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Can't get additional config vars to display on board settings page

Post by 3Di » Mon Apr 16, 2018 1:09 am

change

Code: Select all

$display_vars = phpbb_insert_config_array($display_vars, $config_vars, array('after' => 'warnings_expire_days'));
to

Code: Select all

$display_vars['vars'] = phpbb_insert_config_array($display_vars['vars'], $config_vars, array('after' => 'warnings_expire_days'));
should do.
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

User avatar
kinerity
Community Team Member
Community Team Member
Posts: 1683
Joined: Mon Sep 01, 2014 1:00 am
Location: sudo rm -rf /
Name: Kailey Truscott
Contact:

Re: Can't get additional config vars to display on board settings page

Post by kinerity » Mon Apr 16, 2018 1:16 am

You sir are a life saver! Thanks!
Kailey Truscott - Community Team

User avatar
3Di
Registered User
Posts: 12686
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Can't get additional config vars to display on board settings page

Post by 3Di » Mon Apr 16, 2018 3:38 am

No probs.
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

Post Reply

Return to “Extension Writers Discussion”

Who is online

Users browsing this forum: piotr-linski and 15 guests