2009-08-30, 09:25 PM
Often plugins add an entire new setting group when they have just a couple settings. Ones that might fit nicely with the existing groups. The problem is that people use the gid column which can be inaccurate as upgraded forums might have different than the default system.
Here is the few lines I use to determine the actual gid and I encourage other authors to use this method.
In this case I am trying to get the "member" settings gid.
Here is the list of default names used for settings.
banning
onlineoffline
calendar
clickablecode
cpprefs
datetime
forumdisplay
forumhome
general
memberlist
portal
posting
reputation
privatemessaging
server
showteam
showthread
member
whosonline
search
mailsettings
warning
Now adding a setting to one of these existing groups is easy.
Replace all red text with your own info.
I also suggest that for display order you have it after all the regular settings ...probably start it at around 20 or even 30 depending on the group. IMHO it's sloppy if a new setting that's custom is on top of the other settings. Personal pet peeve.
Plugin authors should know how to use this code.
Enjoy.
Here is the few lines I use to determine the actual gid and I encourage other authors to use this method.
Quote: $query = $db->simple_select("settinggroups", "gid", "name='member'");
$gid = intval($db->fetch_field($query, "gid"));
In this case I am trying to get the "member" settings gid.
Here is the list of default names used for settings.
banning
onlineoffline
calendar
clickablecode
cpprefs
datetime
forumdisplay
forumhome
general
memberlist
portal
posting
reputation
privatemessaging
server
showteam
showthread
member
whosonline
search
mailsettings
warning
Now adding a setting to one of these existing groups is easy.
Quote: $setting_1 = array(
"name" => "NAME",
"title" => "TITLE",
"description" => "YOUR_DESCRIPTION",
"optionscode" => "OPTION_TYPE",
"value" => "VALUE",
"disporder" => "20",
"gid" => $gid,
);
$db->insert_query("settings", $setting_1);
Replace all red text with your own info.
I also suggest that for display order you have it after all the regular settings ...probably start it at around 20 or even 30 depending on the group. IMHO it's sloppy if a new setting that's custom is on top of the other settings. Personal pet peeve.
Plugin authors should know how to use this code.
Enjoy.