function spa_save_uninstall_data()
{
    check_admin_referer('forum-adminform_uninstall', 'forum-adminform_uninstall');
    $mess = spa_text('Options Updated');
    # Are we setting the uninstall flag?
    spa_update_check_option('sfuninstall');
    if (isset($_POST['sfuninstall'])) {
        $mess = spa_text('Simple:Press database entries will be removed when de-activated');
    }
    # Are we setting the remove storage locations flag?
    spa_update_check_option('removestorage');
    if (isset($_POST['removestorage'])) {
        $mess = spa_text('Simple:Press storage locations will be removed when de-activated');
    }
    do_action('sph_toolbox_uninstall_save');
    return $mess;
}
function spa_save_integration_page_data()
{
    check_admin_referer('forum-adminform_integration', 'forum-adminform_integration');
    $mess = '';
    $slugid = sp_esc_int($_POST['slug']);
    if ($slugid == '' || $slugid == 0) {
        $setslug = '';
        $setpage = 0;
    } else {
        $setpage = $slugid;
        $page = spdb_table(SFWPPOSTS, "ID={$slugid}", 'row');
        $setslug = $page->post_name;
        if ($page->post_parent) {
            $parent = $page->post_parent;
            while ($parent) {
                $thispage = spdb_table(SFWPPOSTS, "ID={$parent}", 'row');
                $setslug = $thispage->post_name . '/' . $setslug;
                $parent = $thispage->post_parent;
            }
        }
    }
    sp_update_option('sfpage', $setpage);
    sp_update_option('sfslug', $setslug);
    spa_update_check_option('sfinloop');
    spa_update_check_option('sfmultiplecontent');
    spa_update_check_option('sfwpheadbypass');
    spa_update_check_option('sfwplistpages');
    spa_update_check_option('sfscriptfoot');
    spa_update_check_option('sfuseob');
    spa_update_check_option('spwptexturize');
    sp_update_option('spheaderspace', sp_esc_int($_POST['spheaderspace']));
    if (!$setpage) {
        $mess .= spa_text('Page slug missing');
        $mess .= ' - ' . spa_text('Unable to determine forum permalink without it');
    } else {
        $mess .= spa_text('Forum page and slug updated');
        sp_update_permalink(true);
    }
    do_action('sph_integration_save');
    return $mess;
}
function spa_save_content_data()
{
    check_admin_referer('forum-adminform_content', 'forum-adminform_content');
    $mess = spa_text('Options updated');
    # Save Image resizing
    $sfimage = array();
    $sfimage = sp_get_option('sfimage');
    $sfimage['enlarge'] = isset($_POST['sfimgenlarge']);
    $sfimage['process'] = isset($_POST['process']);
    $sfimage['constrain'] = isset($_POST['constrain']);
    $sfimage['forceclear'] = isset($_POST['forceclear']);
    $thumb = sp_esc_int($_POST['sfthumbsize']);
    if ($thumb < 100) {
        $thumb = 100;
        $mess .= '<br />* ' . spa_text('Image thumbsize reset to minimum 100px');
    }
    $sfimage['thumbsize'] = $thumb;
    $sfimage['style'] = sp_esc_str($_POST['style']);
    sp_update_option('sfimage', $sfimage);
    sp_update_option('sfdates', sp_filter_title_save(trim($_POST['sfdates'])));
    sp_update_option('sftimes', sp_filter_title_save(trim($_POST['sftimes'])));
    # link filters
    $sffilters = array();
    $sffilters['sfnofollow'] = isset($_POST['sfnofollow']);
    $sffilters['sftarget'] = isset($_POST['sftarget']);
    $sffilters['sffilterpre'] = isset($_POST['sffilterpre']);
    $sffilters['sfdupemember'] = isset($_POST['sfdupemember']);
    $sffilters['sfdupeguest'] = isset($_POST['sfdupeguest']);
    $sffilters['sfurlchars'] = sp_esc_int($_POST['sfurlchars']);
    $sffilters['sfmaxlinks'] = sp_esc_int($_POST['sfmaxlinks']);
    if (empty($sffilters['sfmaxlinks'])) {
        $sffilters['sfmaxlinks'] = 0;
    }
    $sffilters['sfmaxsmileys'] = sp_esc_int($_POST['sfmaxsmileys']);
    if (empty($sffilters['sfmaxsmileys'])) {
        $sffilters['sfmaxsmileys'] = 0;
    }
    $sffilters['sfnolinksmsg'] = sp_filter_text_save(trim($_POST['sfnolinksmsg']));
    sp_update_option('sffilters', $sffilters);
    spa_update_check_option('sffiltershortcodes');
    sp_update_option('sfshortcodes', sp_filter_text_save(trim($_POST['sfshortcodes'])));
    do_action('sph_option_content_save');
    return $mess;
}