2013-08-15, 09:00 AM
Hi all,
I was recently reading this article from MyBB Documentation that briefly describes how we can add new setting groups to mybb and then settings to those setting groups.
I copied the exact code from the first code block at this page and pasted it inside the _install() function of one of my own plugins. Also I added the code from the second code block on this page to the _uninstall() function of my plugin.
On Installing and activating the plugin, new settings group appeard on the 'Board Settings' page just fine. When I clicked on it, first three settings which are a 'yesno', 'text', and 'textarea' respectively rendered just fine. But the fourth one that is a select box did not render. Also a warning was shown near the top of the page.
Here is a screenshot that shows this situation.
[attachment=29951]
For the sake of quick reference, here is the code for rendering this select box.
It looks like from the warning message that there is some problem in parsing the 'optionscode'. But I am unable to find any information about the expected format for the value of this key in the MyBB dcumentation. Can you please guide me about the real error and how I can correct it?
Thanks!!
I was recently reading this article from MyBB Documentation that briefly describes how we can add new setting groups to mybb and then settings to those setting groups.
I copied the exact code from the first code block at this page and pasted it inside the _install() function of one of my own plugins. Also I added the code from the second code block on this page to the _uninstall() function of my plugin.
On Installing and activating the plugin, new settings group appeard on the 'Board Settings' page just fine. When I clicked on it, first three settings which are a 'yesno', 'text', and 'textarea' respectively rendered just fine. But the fourth one that is a select box did not render. Also a warning was shown near the top of the page.
Here is a screenshot that shows this situation.
[attachment=29951]
For the sake of quick reference, here is the code for rendering this select box.
$myplugin_setting = array(
'name' => 'myplugin_setting4',
'title' => 'Another random setting for MyPlugin',
'description' => 'This is a select box.',
'optionscode' => 'select default=Default one=Option One two=Option Two three=Option Three',
'value' => 'default',
'disporder' => '4',
'gid' => intval($gid));
$db->insert_query('settings', $myplugin_setting);
It looks like from the warning message that there is some problem in parsing the 'optionscode'. But I am unable to find any information about the expected format for the value of this key in the MyBB dcumentation. Can you please guide me about the real error and how I can correct it?
Thanks!!