'closed', 'count' => $affected ); break; case 'open' : foreach ( $topic_ids as $topic_id ) { $affected += bb_open_topic( $topic_id ); } $query_vars = array( 'message' => 'opened', 'count' => $affected ); break; case 'delete' : foreach ( $topic_ids as $topic_id ) { $affected += (int) (bool) bb_delete_topic( $topic_id, 1 ); } $query_vars = array( 'message' => 'deleted', 'count' => $affected ); break; case 'undelete' : foreach ( $topic_ids as $topic_id ) { $affected += (int) (bool) bb_delete_topic( $topic_id, 0 ); } $query_vars = array( 'message' => 'undeleted', 'count' => $affected ); break; default : if ( $action ) $query_vars = apply_filters( "bulk_topic__$action", array(), $topic_ids ); break; } bb_safe_redirect( add_query_arg( $query_vars ) ); exit; } if ( !empty( $_GET['message'] ) ) { $message_count = isset( $_GET['count'] ) ? (int) $_GET['count'] : 1; switch ( (string) $_GET['message'] ) { case 'undeleted': bb_admin_notice( sprintf( _n( 'Topic undeleted.', '%s topics undeleted.', $message_count ), bb_number_format_i18n( $message_count ) ) ); break; case 'deleted': bb_admin_notice( sprintf( _n( 'Topic deleted.', '%s topics deleted.', $message_count ), bb_number_format_i18n( $message_count ) ) ); break; case 'opened': bb_admin_notice( sprintf( _n( 'Topic opened.', '%s topics opened.', $message_count ), bb_number_format_i18n( $message_count ) ) ); break; case 'closed': bb_admin_notice( sprintf( _n( 'Topic closed.', '%s topics closed.', $message_count ), bb_number_format_i18n( $message_count ) ) ); break; } } $bb_admin_body_class = ' bb-admin-topics'; bb_get_admin_header(); if ( !bb_current_user_can('browse_deleted') ) die(__("Now how'd you get here? And what did you think you'd being doing?")); //This should never happen. add_filter( 'topic_link', 'bb_make_link_view_all' ); add_filter( 'topic_last_post_link', 'bb_make_link_view_all' ); $topic_query_vars = array( 'topic_status' => 'normal', 'open' => 'open', 'count' => true, 'per_page' => 20 ); if ( isset($_POST['search']) && $_POST['search'] ) { $topic_query_vars['post_status'] = 'all'; } elseif ( isset($_GET['search']) && $_GET['search'] ) { $topic_query_vars['post_status'] = 'all'; } $topic_query = new BB_Query_Form( 'topic', $topic_query_vars ); $topics = $topic_query->results; ?>