Change variable in settings.php?
#4
You can yes, plugins will typically add settings groups that contain settings for the plugin, then if you call rebuild_settings() it will re-generate the settings.php file

$settings_group = array(
	"name" => "myplugin",
	"title" => "My Plugin Settings",
	"description" => "Settings for my plugin.",
	"disporder" => "10",
	"isdefault" => 0
);
$db->insert_query("settinggroups", $settings_group);
$gid = $db->insert_id();

$insert = array(
	"name" => 'mysetting',
	"title" => 'My Setting',
	"description" => 'This setting does something cool',
	"optionscode" => 'yesno',
	"value" => 1,
	"disporder" => 1,
	"gid" => intval($gid),
);
$db->insert_query("settings", $insert);

rebuild_settings();

You could then use $mybb->settings['mysetting'] to access the value of that setting.
MyReactions - All Plugins

Can you still feel the butterflies?

Free never tasted like pudding.
Reply


Messages In This Thread
Change variable in settings.php? - by CoolComfort - 2016-10-31, 09:02 AM
RE: Change variable in settings.php? - by Matt - 2016-10-31, 10:01 AM
RE: Change variable in settings.php? - by Matt - 2016-11-01, 12:59 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)