MyBB Community Forums

Full Version: Extra setting field (aka. optionscode) for plugin
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
At the moment we have the current setting field (aka. optionscode) supported:
  • text : A regular text box
  • numeric : A numeric field
  • textarea : A larger text box
  • yesno : A boolean yes/no control
  • onoff : A boolean on/off control
  • select : A select box (in the format select followed by = with one per newline)
  • forumselect : A built-in radio + select box to select forums
  • forumselectsingle : A built-in select box to select only one forum
  • groupselect : A built-in radio + select box to select groups
  • groupselectsingle : A built-in select box to to select only one user group
  • radio : A set of radio buttons (in the format select followed by = with one per newline)
  • checkbox : A boolean checkbox field
  • language : A language selection box
  • adminlanguage : An ACP language select
  • cpstyle : A theme selector
  • php : A php code
I would like to request that these are also included in this list:
  • Date
  • Date and Time
  • monetary (a double type field for currency like values, in MySQL it would be something like double 9.2 for example, separated by a dot)
The numeric field is nice but not usable for decimal numbers.

I could reproduce implement a date and time option using the select but it wouldn't feel well with day, month, year, hour, minutes, seconds 1 per row as it would require that to make it.

It would simplify things for us and it could be saved with proper field types to SQL which saves a lot of time in the later for MySQL queries and the sort and also simplifies it at creating plugins.
Instead of monetary, I would suggest a "decimal" type which would allow decimal numbers as this is more generic.

MyBB 2.0 adds more field types, using HTML5 to validate.
The numeric field should support floats, doesn't it currently? If so, it might be a bug.

For date/time you could use a php field with JS datepicker. There's no need for it in core, IMO.
(2016-06-08, 05:51 PM)Destroy666 Wrote: [ -> ]The numeric field should support floats, doesn't it currently? If so, it might be a bug.
I've tried the other day but it doesn't accept a separator(dot, comma), I would have to test again to see exactly what was the issue.

(2016-06-08, 05:51 PM)Destroy666 Wrote: [ -> ]For date/time you could use a php field with JS datepicker. There's no need for it in core, IMO.

And how exactly would I add JS datapicket to a setting field of a plugin which is the configuration page of the plugin in the admin?

Thanks for the answer.