function cleanup() { global $serendipity; DbSpice::install($this); $announcerssmax = $this->get_config('announcerssmax', 3); if (!is_numeric($announcerssmax)) { $this->set_config('announcerssmax', 3); } $announcersscachemin = $this->get_config('announcersscachemin', 90); if (!is_numeric($announcersscachemin)) { $this->set_config('announcersscachemin', 90); } // Asure numeric inputs for rule settings $config_rules = array('rule_extras_commentcount', 'rule_extras_commentlength', 'rule_dofollow_commentcount', 'rule_dofollow_commentlength'); foreach ($config_rules as $config_rule) { $check = $this->get_config($config_rule, 0); if (!is_numeric($check)) { $this->set_config($check, 0); } } // clear cache $cacheDir = dirname($this->cacheRssFilename("doesntmatter")); if (is_dir($cacheDir) && ($handle = opendir($cacheDir))) { while (false !== ($file = readdir($handle))) { $filename = $cacheDir . '/' . $file; if (!is_dir($filename)) { unlink($filename); } } } // Clean up old configurations: serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}config where name like 'serendipity_event_commentspice:%required_fields';"); serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}config where name like 'serendipity_event_commentspice:%do_honeypod';"); serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}config where name like 'serendipity_event_commentspice:%do_honeypot';"); serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}config where name like 'serendipity_event_commentspice:%spamlogtype';"); serendipity_db_query("DELETE FROM {$serendipity['dbPrefix']}config where name like 'serendipity_event_commentspice:%spamlogfile';"); }