MyBB Community Forums

Full Version: Plugin with selection option
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
In PlugIn given is:
"name" => "page",
"title" => $db->escape_string($lang->setting_page),
"description" => $db->escape_string($lang->setting_page_desc),
"optionscode" => 'select\n0='.$db->escape_string($lang->page_portal_index).'\n1='.$db->escape_string($lang->page_portal).'\n2='. $db->escape_string($lang->page_index).'\n3='.$db->escape_string($lang->page_other).'\n4='.$db->escape_string($lang->page_all) ,
'value' => '0',
"disporder" => "2",
"gid" => intval($gid)

"name" => "other_page",
"title" => $db->escape_string($lang->setting_other_side),
"description" => $db->escape_string($lang->setting_other_side_desc),
"option code" => 'text',
"value" => '',
"disporder" => "3",
"gid" => intval($gid)

How can I ensure that the array with disporder "3" is only displayed/opened if the array "2" has the default "\n3"?

If there is already an entry in Dispoder "3", the entry should be automatically deleted when it is closed (by making a different selection in Dispoder "2").

Many thanks in advance for tips and assistance
Actually, you can just ignore "disporder"!
This value is simply used for an "ORDER BY" statement whilst running the SQL statement of your plugin options. It won't cause issues in case of duplicates.
In a plug-in file, make sure the "disporder" values are unique to prevent a second stage sortnig will take affect and only same values may disappear reversed.