MyBB Community Forums

Full Version: New feature request - new settings type - custom multi select., or FID multiselect.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
New mybb feature :
We have mybb settings (eg. ACP->Configuration->Settings)
where we can add custom ones with ACP->Configuration->Settings->Add New Setting.

There we can chose types like 'text', 'text area', 'yes / no choice' and even predefined 'language selection box' or 'control panel style selection'.

I would like to create multi select option like this one where we can chose multiple options.
Personally i need it to chose forums where 'something will happen', then in plugin i read this setting, list of fid's like 1,2,3,4 and cast query '(...) AND fid IN (1,2,3,4) (...)'.

Ofcourse i could simply use textbox then insert there fid's like 1,2,3,4,5 but in large forums and many options like this its just a pain to distinguish which fid is which forum so nice multi select box would be really neat here.

Because there are some predefined types like 'language selection' and 'control panel style' it would be even better if can just chose (optionscode) something like predefined 'forummultiselect' which would create forum list and then set 'value' to list of selected fid's like 1,2,3,4

So, in short it could be :
additionaly to 'text', 'text area' 'yes / no' ect, add 'multiselect'.
(which would then fill 'mybb_settings - value' with selected stuff like 1,2,3,4 or x,y,z,whatever,
or even predefined 'autoselect_fid' where multiselect control would be filled with forum names,
and create 'mybb_settings - value' like 1,2,3,4 (chosed fid's) depending on selection.

Question related to same problem but as workaround while there are no such feature yet :
Or, maybe someone has allready accomplished this and know some awesome code which i could insert into SQL mybb_settings - optionscode, or 'selection box - extra' which would create nice multi select
with forum names, and then put FID's to SQL mybb_settings - value (like 1,2,3,4)

Any nice ideas of such code will be appreciated.
(btw, i know i probably could accomplish something like this by inserting php and checkboxes but it could create very high checkboxes column because forum is large, this is why i rather would like to have it as nice and small scrollable multi select)
It would require a code change in the Admin CP. Or dirty hacks.

Here's a optionscode hack that gives you a forum select box: (starts with php\n)

php
<!--".array(build_forum_jump())."-->
<select name=\"upsetting[{$setting['name']}]\" multiple>
{$forumjumpbits}
</select>

However it doesn't actually store the fids you select. It only stores a single one of them and doesn't show you which one the next time you load the box (that could be added).

For a true multi select - the Admin CP code in admin/modules/config/settings.php just doesn't handle it.

If you want to stick to hacks, you'd have to resort to JavaScript, using a regular (or hidden) textfield setting, and JavaScript to update the highlights on the multi select and update the text field when the multi select is changed in any way.

Not impossible but a bit of a pain to do really, if it's not supported by core. It's easier to get a list of fids from the admin cp forums page.
Thank you for your reply frostschutz.

Exacly thats what i thought's which made me suggest it as new feature,
which would be more easy to handle without much hassle if it would be natively build in.