%s', AAS_DIR_PATH.'/aas-config.php', __('Settings')); array_unshift($links, $url); return $links; } /** * Add configuration page access to administrator panel * * @param none * @return none **/ function aas_add_config_page() { add_options_page('Anti Artificial Spam', 'Anti Artificial Spam', 8, __FILE__, 'aas_load_config_page'); } /** * Output HTML content of the configuration page * * @param none * @return string **/ function aas_gen_config_page() { // Save options when the submit button is clicked if ($_POST['aas_btn_submit'] === 'yes') { $options = array(); $options['aas_banned_ips'] = stripslashes(apply_filters('aas_msg_sec', trim($_POST['aas_banned_ips']))); $options['aas_banned_authors'] = stripslashes(apply_filters('aas_msg_sec', trim($_POST['aas_banned_authors']))); $options['aas_banned_emails'] = stripslashes(apply_filters('aas_msg_sec', trim($_POST['aas_banned_emails']))); $options['aas_banned_urls'] = stripslashes(apply_filters('aas_msg_sec', trim($_POST['aas_banned_urls']))); $options['aas_banned_keywords'] = stripslashes(apply_filters('aas_msg_sec', trim($_POST['aas_banned_keywords']))); $options['aas_ignore_case'] = $_POST['aas_ignore_case']; // Filter empty lines out of every option list foreach ($options as $key=>$strOpt) { $arrOpt = explode("\n", $strOpt); $arrTmp = array(); foreach ($arrOpt as $opt) { $opt = trim($opt); if (!empty($opt)) { $arrTmp[] = $opt; } } $strOpt = implode("\n", $arrTmp); $options[$key] = trim($strOpt); } update_option('aas_options', $options); echo '
Options updated !