function asb_admin_update_theme_select()
{
    // is the group installed?
    $gid = asb_get_settingsgroup();
    if ((int) $gid == 0) {
        flash_message($lang->asb_theme_exclude_select_update_fail, 'error');
        admin_redirect('index.php?module=config-settings');
    }
    global $db, $lang;
    if (!$lang->asb) {
        $lang->load('asb');
    }
    $query = $db->simple_select('settings', '*', "name='asb_exclude_theme'");
    // is the setting created?
    if ($db->num_rows($query) == 0) {
        flash_message($lang->asb_theme_exclude_select_update_fail, 'error');
        admin_redirect('index.php?module=config-settings');
    }
    // update the setting
    require_once MYBB_ROOT . 'inc/plugins/asb/functions_install.php';
    $status = $db->update_query('settings', array("optionscode" => $db->escape_string(asb_build_theme_exclude_select())), "name='asb_exclude_theme'");
    // success?
    if (!$status) {
        flash_message($lang->asb_theme_exclude_select_update_fail, 'error');
    } else {
        flash_message($lang->asb_theme_exclude_select_update_success, 'success');
    }
    admin_redirect(asb_build_settings_url($gid));
}
<?php

/*
 * Plugin Name: Advanced Sidebox for MyBB 1.6.x
 * Copyright 2014 WildcardSearch
 * http://www.rantcentralforums.com
 *
 * this file contains data used by classes/installer.php
 */
$tables = array("asb_sideboxes" => array("id" => 'INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY', "display_order" => 'INT(10) NOT NULL', "box_type" => 'VARCHAR(25) NOT NULL', "title" => 'VARCHAR(32) NOT NULL', "title_link" => 'VARCHAR(128) NOT NULL', "position" => 'INT(2)', "scripts" => 'TEXT', "groups" => 'TEXT', "themes" => 'TEXT', "settings" => 'TEXT', "wrap_content" => 'INT(1)', "dateline" => 'INT(10)'), "asb_custom_sideboxes" => array("id" => 'INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY', "title" => 'VARCHAR(32) NOT NULL', "description" => 'VARCHAR(128) NOT NULL', "wrap_content" => 'INT(1)', "content" => 'TEXT', "dateline" => 'INT(10)'), "asb_script_info" => array("id" => 'INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY', "title" => 'VARCHAR(32) NOT NULL', "filename" => 'VARCHAR(32) NOT NULL', "action" => 'VARCHAR(32) NOT NULL', "page" => 'VARCHAR(32) NOT NULL', "width_left" => 'INT(2)', "width_right" => 'INT(2)', "template_name" => 'VARCHAR(128) NOT NULL', "hook" => 'VARCHAR(128) NOT NULL', "find_top" => 'TEXT', "find_bottom" => 'TEXT', "replace_all" => 'INT(1)', "replacement" => 'TEXT', "replacement_template" => 'VARCHAR(128) NOT NULL', "eval" => 'INT(1)', "active" => 'INT(1)', "dateline" => 'INT(10)'));
$columns = array("users" => array("show_sidebox" => 'INT(1) DEFAULT 1'));
$update_themes_link = "<ul><li><a href=\"" . ASB_URL . "&amp;action=update_theme_select\" title=\"\">{$lang->asb_theme_exclude_select_update_link}</a><br />{$lang->asb_theme_exclude_select_update_description}</li></ul>";
$settings = array("asb_settings" => array("group" => array("name" => 'asb_settings', "title" => 'Advanced Sidebox', "description" => $lang->asb_settingsgroup_description, "disporder" => '101', "isdefault" => 0), "settings" => array("asb_show_empty_boxes" => array("sid" => 'NULL', "name" => 'asb_show_empty_boxes', "title" => $lang->asb_show_empty_boxes . ':', "description" => $db->escape_string($lang->asb_show_empty_boxes_desc), "optionscode" => 'yesno', "value" => '1', "disporder" => '10'), "asb_show_toggle_icons" => array("sid" => 'NULL', "name" => 'asb_show_toggle_icons', "title" => $lang->asb_show_toggle_icons, "description" => '', "optionscode" => 'yesno', "value" => '0', "disporder" => '20'), "asb_show_expanders" => array("sid" => 'NULL', "name" => 'asb_show_expanders', "title" => $lang->asb_show_expanders, "description" => '', "optionscode" => 'yesno', "value" => '1', "disporder" => '30'), "asb_allow_user_disable" => array("sid" => 'NULL', "name" => 'asb_allow_user_disable', "title" => $lang->asb_allow_user_disable, "description" => '', "optionscode" => 'yesno', "value" => '1', "disporder" => '40'), "asb_minify_js" => array("sid" => 'NULL', "name" => 'asb_minify_js', "title" => $lang->asb_minify_js_title, "description" => $lang->asb_minify_js_desc, "optionscode" => 'yesno', "value" => '1', "disporder" => '50'), "asb_exclude_theme" => array("sid" => 'NULL', "name" => 'asb_exclude_theme', "title" => $lang->asb_theme_exclude_list . ':', "description" => $db->escape_string($lang->asb_theme_exclude_list_description . $update_themes_link), "optionscode" => $db->escape_string(asb_build_theme_exclude_select()), "value" => '', "disporder" => '60'))));
$templates = array("asb" => array("group" => array("prefix" => 'asb', "title" => $lang->asb), "templates" => array("asb_begin" => <<<EOF
<table width="100%" border="0" cellspacing="5">
\t<tr>{\$left_content}
\t\t<!-- start: ASB middle column (page contents of {\$filename}) -->
\t\t<td width="auto" valign="top">
EOF
, "asb_end" => <<<EOF
\t\t</td>
\t\t<!-- end: ASB middle column (page contents of {\$filename}) -->{\$right_content}
</tr>
</table>
EOF
, "asb_sidebox_column" => <<<EOF
\t\t\t<td style="width: {\$width}px;{\$show_column}" id="{\$column_id}" valign="top">
\t\t\t\t{\$sideboxes}
\t\t\t\t{\$content_pad}
\t\t\t</td>
EOF