2011-11-09, 05:48 PM
Greetings.
I have the following code in my upcomming plugin.
But I want to make a code which can get the Terms of Service Version from the database.
Hope someone will be able to help me with this.
This is my code.
I have the following code in my upcomming plugin.
But I want to make a code which can get the Terms of Service Version from the database.
Hope someone will be able to help me with this.
This is my code.
//All the activation processes go here
function tospopup_activate()
{
global $db;
$group = array(
"gid" => "NULL",
"title" => "Terms of Service Popup",
"name" => "tospopup",
"description" => "Settings for Terms of Service Popup.",
"disporder" => "1",
"isdefault" => "no",
);
$db->insert_query(TABLE_PREFIX."settinggroups", $group);
$gid = $db->insert_id(); //This will get the id of the just added record in the db
$setting_1 = array(
"sid" => "NULL",
"name" => "tospopup_setting",
"title" => "Terms of Service Version",
"description" => "What is your current Terms of Service Version. Change this version number to another number whenever you want to force your users to accept the new Terms of Service.",
"optionscode" => "text",
"value" => '1.0.0',
"disporder" => '1',
"gid" => intval($gid),
);
$db->insert_query(TABLE_PREFIX."settings", $setting_1);
rebuildsettings();
}
//All deactivation processes go here
function tospopup_deactivate()
{
global $db;
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='tospopup_setting'");
$db->query("DELETE FROM ".TABLE_PREFIX."settinggroups WHERE name='tospopup'");
rebuildsettings();
}