2012-10-08, 11:04 PM
I am doing a plugin for personal use and for avoid so many lines of code I'm using PluginLibrary, but I have some doubts when creating the settings ..
I have the following code, but it like I do with PluginLibrary?
Search in the documentation, but it only found this but not know how change the values there by of my code.
Know it is something basic, but do not understand XD
Thank you in advance :p
I have the following code, but it like I do with PluginLibrary?
global $db;
$query = $db->simple_select("settinggroups", "COUNT(*) as rows");
$rows = $db->fetch_field($query, "rows");
$insertarray = array(
'name' => 'pmpopup',
'title' => 'PM Popup',
'description' => 'Options on how to configure and personalize PM Popup',
'disporder' => $rows+1,
'isdefault' => 0
);
$gid = $db->insert_query("settinggroups", $insertarray);
$insertarray = array(
'name' => 'pmpopup_enable',
'title' => 'Enable popup of private messages',
'description' => 'Turns on or off PM Popup.',
'optionscode' => 'onoff',
'value' => 1,
'disporder' => 0,
'gid' => $gid
);
$db->insert_query("settings", $insertarray);
Search in the documentation, but it only found this but not know how change the values there by of my code.
$PL->settings('plugin_name',
'Group Title',
'Group Description',
array(
'no' => array(
'title' => 'Simple Yes/No Setting',
'description' => 'The default is no.',
),
'yes' => array(
'title' => 'Simple Yes/No Setting',
'description' => 'This one is set to yes.',
'value' => 1,
),
'text' => array(
'title' => 'Text setting',
'description' => 'Enter some text here.',
'optionscode' => 'text',
),
'textarea' => array(
'title' => 'Text area setting',
'description' => 'Enter multiple lines of text.',
'optionscode' => 'textarea',
'value' => 'Default value for this setting.',
),
)
);
Know it is something basic, but do not understand XD
Thank you in advance :p