MyBB Community Forums

Full Version: Adding drop downs?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How do I add dropdowns to my plugin? In the admin CP setting?

For example (yesno):
$option_name = array(
		"name" => "option_name",
		"title" => "Option 1",
		"description" => "blahblah",
		"optionscode" => "yesno",
		"value" => "1",
		"disporder" => "1",
		"gid" => intval($gid),
		);
	$db->insert_query("settings", $option_name);

But how do i make a drop down?
Anyone?
please?
I don't know if I understood your post correctly, but look at /admin/modules/config/settings.php:
$setting_types = array(
		"text" => $lang->text,
		"textarea" => $lang->textarea,
		"yesno" => $lang->yesno,
		"onoff" => $lang->onoff,
		"select" => $lang->select,
		"radio" => $lang->radio,
		"checkbox" => $lang->checkbox,
		"language" => $lang->language_selection_box,
		"adminlanguage" => $lang->adminlanguage,
		"cpstyle" => $lang->cpstyle,
		//"php" => $lang->php // Internal Use Only
	);
You wanted to use select, aren't you?
What I mean is how do you format a drop down? Like adding settings to it? Smile
It was enough to look into database and just check. Wink Eg. mail setting (optionscode column):
select
mail=PHP mail
smtp=SMTP mail