' . __( 'Pattern(s) succesfully deleted.', 'ust' ) . '

'; } } //save or add pattern if ( isset( $_POST['submit_settings'] ) ) { $error = false; if ( false === @preg_match( stripslashes( $_POST['regex'] ), 'thisisjustateststring' ) ) { $error = __( 'Please enter a valid PCRE Regular Expression with delimiters.', 'ust' ); } if ( ! $error ) { if ( isset( $_POST['pattern_id'] ) && isset( $patterns[ intval( $_POST['pattern_id'] ) ] ) ) { $id = intval( $_POST['pattern_id'] ); $patterns[ $id ]['regex'] = stripslashes( trim( $_POST['regex'] ) ); $patterns[ $id ]['desc'] = stripslashes( wp_filter_nohtml_kses( trim( $_POST['desc'] ) ) ); $patterns[ $id ]['type'] = $_POST['type']; $patterns[ $id ]['action'] = $_POST['action']; } else { $patterns[] = array( 'regex' => stripslashes( trim( $_POST['regex'] ) ), 'desc' => stripslashes( wp_filter_nohtml_kses( trim( $_POST['desc'] ) ) ), 'type' => $_POST['type'], 'action' => $_POST['action'], 'matched' => 0 ); } update_site_option( 'ust_patterns', $patterns ); unset( $_POST ); unset( $_GET ); $new_pattern_code = ''; echo '

' . __( 'Pattern successfully saved.', 'ust' ) . '

'; } else { echo '

' . $error . '

'; } } //if editing a pattern if ( isset( $_GET['id'] ) ) { $new_pattern_code = (int) $_GET['id']; } $apage = isset( $_GET['apage'] ) ? intval( $_GET['apage'] ) : 1; $num = isset( $_GET['num'] ) ? intval( $_GET['num'] ) : 20; $pattern_list = get_site_option( 'ust_patterns' ); $total = ( is_array( $pattern_list ) ) ? count( $pattern_list ) : 0; if ( $total ) { $pattern_list = array_slice( $pattern_list, intval( ( $apage - 1 ) * $num ), intval( $num ) ); } $pattern_navigation = paginate_links( array( 'base' => add_query_arg( 'apage', '%#%' ), 'format' => '', 'total' => ceil( $total / $num ), 'current' => $apage ) ); $page_link = ( $apage > 1 ) ? '&apage=' . $apage : ''; ?>

$pattern_navigation
"; } ?>


'display name' $posts_columns = array( 'regex' => __( 'Regular Expression', 'ust' ), 'type' => __( 'Check', 'ust' ), 'action' => __( 'Action', 'ust' ), 'matched' => __( 'Matched', 'ust' ), 'edit' => __( 'Edit', 'ust' ) ); ?> $column_display_name ) { $col_url = $column_display_name; ?> $pattern ) { $class = ( isset( $class ) && 'alternate' == $class ) ? '' : 'alternate'; echo ''; foreach ( $posts_columns as $column_name => $column_display_name ) { switch ( $column_name ) { case 'regex': ?> $column_display_name ) { $col_url = $column_display_name; ?>

»
$pattern_navigation
"; } ?>

'; } else { $regex = isset( $_POST['regex'] ) ? stripslashes( $_POST['regex'] ) : ''; $desc = isset( $_POST['desc'] ) ? stripslashes( $_POST['desc'] ) : ''; $type = isset( $_POST['type'] ) ? stripslashes( $_POST['type'] ) : 'domain'; $action = isset( $_POST['action'] ) ? stripslashes( $_POST['action'] ) : 'splog'; } ?>
valid delimited PCRE format. Regex can be very complicated, so it\'s recommended to use an online tool like RegExr to build and test them. It is also recommended in most cases to use the "Mark as Splog" action rather than block. This will make it much harder for spammers to learn how to get around your pattern rules, and will also allow the Anti-Splog API to learn from these detected spammers.', 'ust' ) ?>