Example #1
0
function sp_add_option($option_name, $value = '')
{
    global $wpdb, $spAllOptions;
    # make sure $spAllOptions has been populated before we try and use it
    if (empty($spAllOptions)) {
        $spAllOptions = sp_load_alloptions();
    }
    $value = maybe_serialize($value);
    $result = $wpdb->query('INSERT INTO ' . SFOPTIONS . " (option_name, option_value) VALUES ('{$option_name}', '{$value}') ON DUPLICATE KEY UPDATE option_name=VALUES(option_name), option_value=VALUES(option_value)");
    if ($result) {
        $spAllOptions[$option_name] = $value;
        return true;
    } else {
        return false;
    }
}
	width: 820px;
}

#zonecount {
	display:none;
}

.stayleft {
	float: left;
	padding-right: 15px;
}
</style>
<?php 
global $spAllOptions, $spStatus;
$spAllOptions = array();
$spAllOptions = sp_load_alloptions();
# get current version  and build from database
$current_version = sp_get_option('sfversion');
$current_build = sp_get_option('sfbuild');
# check if we are coming back in with post values to install
if (isset($_POST['goinstall'])) {
    sp_go_install();
    return;
}
# check if we are coming back in with post values to upgrade
if (isset($_POST['goupgrade'])) {
    # run the upgrade
    sp_go_upgrade($current_version, $current_build);
    return;
}
# check if we are coming back in with post values to upgrade network