2016-12-07, 03:21 PM
The other week I did my first attempt at making a plugin after reading the help docs, everything worked completely fine. The plugin for now basically just adds settings to the AdminCP.
But now when I install them, they won't uninstall or give me the option to.
Here is the code
But now when I install them, they won't uninstall or give me the option to.
Here is the code
<?php
if(!defined("IN_MYBB"))
{
die("Direct initialization of this file is not allowed.");
}
function noticemods_info()
{
return array(
"name" => "noticemods",
"description" => "NoticeMods highlights moderator posts so they can be seen clearly over other posts.",
"website" => "http://virtualfrost.com",
"author" => "VirtualFrost",
"authorsite" => "http://virtualfrost.com",
"version" => "1.0.0",
"guid" => "",
"codename" => "",
"compatibility" => "18*"
);
}
function noticemods_install()
{
global $db, $mybb;
$setting_group = array(
'name' => 'noticemodsgroup',
'title' => 'NoticeMods Settings',
'description' => 'NoticeMods Configuration.',
'disporder' => 5, // The order your setting group will display
'isdefault' => 0
);
$gid = $db->insert_query("settinggroups", $setting_group);
$setting_array = array(
// A text setting
'noticemods_user' => array(
'title' => 'Moderator Username',
'description' => 'Enter the username of the user who you wish to have highlighted posts.',
'optionscode' => 'text',
'value' => '',
'disporder' => 1
),
'noticemods_post_bg' => array(
'title' => 'Background Color',
'description' => 'Select the background color for the moderator posts',
'optionscode' => 'text',
'value' => '',
'disporder' => 2
),
);
foreach($setting_array as $name => $setting)
{
$setting['name'] = $name;
$setting['gid'] = $gid;
$db->insert_query('settings', $setting);
}
// Don't forget this!
rebuild_settings();
}
function noticemods_is_installed()
{
}
function noticemods_uninstall()
{
global $db;
$db->delete_query('settings', "name IN ('noticemods_user')");
$db->delete_query('settinggroups', "name = 'noticemodsgroup'");
rebuild_settings();
}
function noticemods_activate()
{
}
function noticemods_deactivate()
{
}
?>