MyBB Community Forums

Full Version: Is it Possible to Separate Settings Group in Single Plugin?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i am working on a plugin which has many of settings, i can't put all into one setting group because it will irritating to manage setting from ACP. i mean a very long page with lot of options.
Looking for Separate it.

MyPlugin Options:
  this settings group has enable/disable options only

MyPlugin Values:
 this settings group has text and other fields where user can set custom values for settings 

and so on...

Any Solution for this?
You can just create more then one group and define wich setting go to wich group.
An example of a plugin i still have in dev with more then one setting group.
(2017-04-26, 09:25 AM)broatcast Wrote: [ -> ]You can just create more then one group and define wich setting go to wich group.
An example of a plugin i still have in dev with more then one setting group.

thanks for providing solution but i am developing a plugin under newpoints and it has not GID Sad
You the new gid when you create the group... if you like to add them to an existing group of another plugin then search for the nametag in settinggroups and you get the gid this way otherwise i dont understand what exactly you try to so.
(2017-04-26, 03:55 PM)broatcast Wrote: [ -> ]You the new gid when you create the group... if you like to add them to an existing group of another plugin then search for the nametag in settinggroups and you get the gid this way otherwise i dont understand what exactly you try to so.

okie, i will try to explain...

NewPoints is a pay per post points plugin
It has own plugin settings and own all settings with a separate plugin listing...
it store plugin settings into its own plugin settings table and then retrieve plugin_info array to fetch information and create automatic setting groups by plugin tag
it has following fields in plugin settings table:
sid - auto increment
plugin - plugin tag
name - plugin settings names
title - title of plugin settings
description - description of plugin settings
type - field type
value - field value
disporder - sort order for plugin settings
You can see in /inc/plugins/newpoints/core/plugin.php how he is adding settings and groups, the function is defined in /inc/plugins/newpoints.php at line 312, called "newpoints_add_setting", the setting groups get generated automaticly out from the plugins info so you are right, but you can try it by using the "newpoints_admin_settings_start" hook to manipulate this page and add some own. But if you like use the same table thats generated by this this process you need an extra new hook for this.
May put this then in the plugin installation readme to let the user add this hook, or automaticly manipulate the file on plugin installation routine, or ask the author to add this hook in next release after you finish your plugin.
(2017-04-27, 12:32 PM)broatcast Wrote: [ -> ]You can see in /inc/plugins/newpoints/core/plugin.php how he is adding settings and groups, the function is defined in /inc/plugins/newpoints.php at line 312, called "newpoints_add_setting", the setting groups get generated automaticly out from the plugins info so you are right, but you can try it by using the "newpoints_admin_settings_start" hook to manipulate this page and add some own. But if you like use the same table thats generated by this this process you need an extra new hook for this.
May put this then in the plugin installation readme to let the user add this hook, or automaticly manipulate the file on plugin installation routine, or ask the author to add this hook in next release after you finish your plugin.

hmmmm... i'll think about it in next release, currently i've setup everything so can't change any settings now
Newpoints still offers helper functions to create setting groups, so though the code isn't going to be the same the concept remains. You could also use the peeker js helpers to hide unnecessary settings until activated.