MyBB Community Forums

Full Version: [Suggestion] option single to groupselect & forumselect
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi there,

Having added groupselect and forumselect for the settings options is really great, but I think it could be useful to have the hability to select only one group (or forum), without the "all" nor "none" options.

I mean something like:
else if($type[0] == "forumalone")
{
   $selected_value = (int)$setting['value']; // No need to check if empty, int will give 0
   $setting_code = $form->generate_forum_select('select['.$setting['name'].'][]', $selected_value, array('id' => $element_id, 'size' => 5));
}
else if($type[0] == "groupalone")
{
   $selected_value = (int)$setting['value']; // No need to check if empty, int will give 0
   $setting_code = $form->generate_group_select('select['.$setting['name'].'][]', $selected_value, array('id' => $element_id, 'size' => 5));
}

And another small suggestion : having a "userselect" method (ajax completion ?)

Regards
Any specific case when selecting only one forum would be preferred?

Agree with this idea though:
(2015-04-02, 09:12 AM)Crazycat Wrote: [ -> ]And another small suggestion : having a "userselect" method (ajax completion ?)
Eg a "move thread when x happens" plugin with a setting "where should the thread be moved"
Or for "bots" like rss feed poster, and other plugins wich target a particular forum.

The groupalone function is peharps less useful.
If someone wanted to create a thread in a specific forum upon warning a user or a report being generated are two examples I can think of right away.
I think you can already use the _php_ setting type.

$setting => array(
	'name'			=> 'foo',
	'optionscode'	=> "\$form->generate_forum_select(\$element_name, \$setting['value'], array('id' => \$element_id, 'main_option' => \$lang->none));";
	'value'			=> -1
);

I would have liked to see this in 1.8.0 but now it seems redundant to add it. The _username_ setting would be probably more useful.
I know this, but it may help a lot of people who are not really familiar with MyBB plugins. And it's just 2 conditions in the if... Why is it not a switch ?
I'm not against the addition, just would liked it being implemented from the beginning as already mentioned.

The _php_ solution will work on all 1.8 versions, probably even 1.6.
* Crazycat hide his boxing gloves...

Ok, I agree with you, and it may be interresting to have the _php_ equivalent in the 1.6 FAQ, for retro-compatibility Smile
(2015-04-02, 09:12 AM)Crazycat Wrote: [ -> ]And another small suggestion : having a "userselect" method (ajax completion ?)

Regards

I miss that very much