MyBB Community Forums

Full Version: Plugin Settings with dropdown selection options?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I would like to make a Plugin Settings witch should just be a dropdown with selection options.

I know the default Yes/No plugin setting is like this, but how to a dropdown selection?

Yes/No Settings:
	
	$motmplugin_setting = array(
        'sid'            => 'NULL',
        'name'        => 'enabled_yourplugin',
        'title'            => 'Do you want YourPlugin Enabled',
        'description'    => 'If Yes People Can Use YourPlugin, If No People Cannot Use YourPlugin.',
        'optionscode'    => 'yesno',
        'value'        => '1',
        'disporder'        => 1,
        'gid'            => intval($gid),
    );
$setting = array(
	'sid'			=> 'NULL',
	'name'			=> 'loremipsum_setting',
	'title'			=> 'Lorem ipsum',
	'description'	=> 'Lorem ipsum dolor sit amet',
	'optionscode'	=> 'select \n 1=Lorem \n 2=Lorem \n 3=Lorem',
	'value'			=> '1',
	'disporder'		=> 0,
	'gid'			=> intval($gid),
);


The three Lorem are the options and the numbers are their values, which you will use to check which option is selected. And for the record, a setting to enable/disable a plugin is completely useless. Don't add it.
Okay. Thanks a lot. What is this for?
    'value'            => '1',

Also, You are right, i will remove this and just leave the default Install/Uninstall/Activate/Deactivate for the plugin instead.
That's the default value of the setting.