function update() { if (!empty($_POST)) { if (isset($_POST['k2'])) { // Advanced Navigation if (isset($_POST['k2']['advnav'])) { update_option('k2livesearch', '1'); update_option('k2rollingarchives', '1'); } else { update_option('k2livesearch', '0'); update_option('k2rollingarchives', '0'); } // Archives Page if (isset($_POST['k2']['archives'])) { if (get_option('k2archives') != 'add_archive') { update_option('k2archives', '1'); K2Archive::create_archive(); } } else { // thanks to Michael Hampton, http://www.ioerror.us/ for the assist update_option('k2archives', '0'); K2Archive::delete_archive(); } // Live Commenting if (isset($_POST['k2']['livecommenting'])) { update_option('k2livecommenting', '1'); } else { update_option('k2livecommenting', '0'); } // Set all the options foreach ($_POST['k2'] as $option => $value) { update_option('k2' . $option, $value); } if (isset($_POST['k2']['scheme'])) { update_style_info(); } } if (isset($_POST['configela']) and !K2Archive::setup_archive()) { unset($_POST['configela']); } } }