If you're asking about how to create a setting group and settings for your plugin; you currently have to do that manually using SQL queries. Which unfortunately leads to problems and errors just about everywhere. For example I don't like plugin groups just using disporder 1 for their groups.
I'm currently working on a
plugin library which among other things allows you to create (and update) groups and settings. This code originally comes from my Google SEO plugin (which has several setting groups and a growing number of settings to manage, so the manual SQL approach would be bothersome).
/**
* SETTINGS
*
* $PL->settings(name, title, description, list)
*
* Create a setting group with any number of settings with $PL->settings()
* If the setting group already exists, the settings are updated properly.
*/
$PL->settings("hello_pl", // group name and settings prefix
"Hello PluginLibrary!",
"Setting group for the Hello PluginLibrary sample plugin.",
array(
"foobar" => array(
"title" => "Foo Bar",
"description" => "The setting name depends on the prefix (hello_pl) and the key (foobar). The name of this setting is hello_pl_foobar.",
),
"no" => array(
"title" => "Simple Yes/No setting",
"description" => "The default is no. The name of this setting is hello_pl_no.",
),
"yes" => array(
"title" => "Yes/No setting",
"description" => "This one is set to yes. The name of this setting is hello_pl_yes.",
"value" => 1,
),
"text" => array(
"title" => "Text setting",
"description" => "Give me a word. The name of this setting is hello_pl_text.",
"optionscode" => "text",
),
"textarea" => array(
"title" => "Text area (hello_pl_textarea)",
"description" => "Multiple lines. The name of this setting is hello_pl_textarea.",
"optionscode" => "textarea",
"value" => "line1\nline2",
),
)
// , true /* optional, prints a language file */
);
Such a function should be in MyBB itself, unfortunately that isn't the case.
(2010-12-31, 03:47 AM)Yaldaram Wrote: [ -> ]admin_config_settings_begin
admin_config_settings_add
admin_config_settings_start
You can also embed PHP code or JavaScript in the setting itself. MyBB itself has some multiple choice settings that work like that, if I remember correctly when selecting smtp/php mail, it shows the smtp detail settings only when necessary. And this can be done without hooks...