Пример #1
0
function mysupport_do_install()
{
    global $db, $cache, $mysupport_uninstall_confirm_override;
    // this is so we override the confirmation when trying to uninstall, so we can just run the uninstall code
    $mysupport_uninstall_confirm_override = true;
    mysupport_do_uninstall();
    mysupport_table_columns(1);
    if (!$db->table_exists("mysupport")) {
        $db->write_query("\r\n\t\t\tCREATE TABLE  " . TABLE_PREFIX . "mysupport (\r\n\t\t\t\t`mid` SMALLINT(5) NOT NULL AUTO_INCREMENT PRIMARY KEY ,\r\n\t\t\t\t`type` VARCHAR(20) NOT NULL ,\r\n\t\t\t\t`name` VARCHAR(255) NOT NULL ,\r\n\t\t\t\t`description` VARCHAR(500) NOT NULL,\r\n\t\t\t\t`extra` VARCHAR(255) NOT NULL\r\n\t\t\t) ENGINE = MYISAM ;\r\n\t\t");
    }
    $settings_group = array("name" => "mysupport", "title" => "MySupport Settings", "description" => "Settings for the MySupport plugin.", "disporder" => "28", "isdefault" => "no");
    $db->insert_query("settinggroups", $settings_group);
    mysupport_import_settings();
    mysupport_do_templates(1);
    mysupport_stylesheet(1);
    // insert some default priorities
    $priorities = array();
    $priorities[] = array("type" => "priority", "name" => "Low", "description" => "Low priority threads.", "extra" => "ADCBE7");
    $priorities[] = array("type" => "priority", "name" => "Normal", "description" => "Normal priority threads.", "extra" => "D6ECA6");
    $priorities[] = array("type" => "priority", "name" => "High", "description" => "High priority threads.", "extra" => "FFF6BF");
    $priorities[] = array("type" => "priority", "name" => "Urgent", "description" => "Urgent priority threads.", "extra" => "FFE4E1");
    foreach ($priorities as $priority) {
        $db->insert_query("mysupport", $priority);
    }
    mysupport_insert_task();
    // set some values for the staff groups
    $update = array("canmarksolved" => 1, "canmarktechnical" => 1, "canseetechnotice" => 1, "canassign" => 1, "canbeassigned" => 1, "cansetpriorities" => 1, "canseepriorities" => 1, "canmanagesupportdenial" => 1);
    $db->update_query("usergroups", $update, "gid IN ('3','4','6')");
    change_admin_permission("config", "mysupport", 1);
    $cache->update_forums();
    $cache->update_usergroups();
    mysupport_cache();
}
Пример #2
0
function mysupport_uninstall()
{
    require_once MYBB_ROOT . "inc/plugins/mysupport/mysupport.php";
    return mysupport_do_uninstall();
}