user_login ) ) { $blogs = get_blogs_of_user( (int) $_GET['spam_user'], true ); foreach ( (array) $blogs as $key => $details ) { if ( $details->userblog_id == $current_site->blog_id ) { continue; } // main blog not a spam ! update_blog_status( $details->userblog_id, "spam", '1' ); set_time_limit( 60 ); } update_user_status( (int) $_GET['spam_user'], "spam", '1' ); $_GET['updatedmsg'] = sprintf( __( '%s blog(s) spammed for user!', 'ust' ), count( $blogs ) ); } } else if ( isset( $_GET['spam_ip'] ) ) { //spam all blogs created or modified with the IP address $spam_ip = addslashes( $_GET['spam_ip'] ); $query = "SELECT b.blog_id FROM {$wpdb->blogs} b, {$wpdb->registration_log} r, {$wpdb->base_prefix}ust u WHERE b.site_id = '{$wpdb->siteid}' AND b.blog_id = r.blog_id AND b.blog_id = u.blog_id AND b.spam = 0 AND (r.IP = '$spam_ip' OR u.last_ip = '$spam_ip')"; $blogs = $wpdb->get_results( $query, ARRAY_A ); foreach ( (array) $blogs as $blog ) { if ( $blog['blog_id'] == $current_site->blog_id ) { continue; } // main blog not a spam ! update_blog_status( $blog['blog_id'], "spam", '1' ); set_time_limit( 60 ); } $_GET['updatedmsg'] = sprintf( __( '%s blog(s) spammed for %s!', 'ust' ), count( $blogs ), $spam_ip ); } else if ( isset( $_GET['ignore_blog'] ) ) { //ignore a single blog so it doesn't show up on the possible spam list ust_blog_ignore( (int) $_GET['id'] ); } else if ( isset( $_GET['unignore_blog'] ) ) { //unignore a single blog so it can show up on the possible spam list ust_blog_unignore( (int) $_GET['id'] ); } else if ( isset( $_GET['spam_blog'] ) ) { //spam a single blog update_blog_status( (int) $_GET['id'], "spam", '1' ); } else if ( isset( $_GET['unspam_blog'] ) ) { update_blog_status( (int) $_GET['id'], "spam", '0' ); ust_blog_ignore( (int) $_GET['id'], false ); } else if ( isset( $_GET['action'] ) && $_GET['action'] == 'all_notspam' ) { $_GET['updatedmsg'] = __( 'Blogs marked as not spam.', 'ust' ); } else if ( isset( $_GET['action'] ) && $_GET['action'] == 'allblogs' ) { foreach ( (array) $_POST['allblogs'] as $key => $val ) { if ( $val != '0' && $val != $current_site->blog_id ) { if ( isset( $_POST['allblog_ignore'] ) ) { $_GET['updatedmsg'] = __( 'Selected Blogs Ignored.', 'ust' ); ust_blog_ignore( $val ); set_time_limit( 60 ); } else if ( isset( $_POST['allblog_unignore'] ) ) { $_GET['updatedmsg'] = __( 'Selected Blogs Un-ignored.', 'ust' ); ust_blog_unignore( $val ); set_time_limit( 60 ); } else if ( isset( $_POST['allblog_spam'] ) ) { $_GET['updatedmsg'] = __( 'Blogs marked as spam.', 'ust' ); update_blog_status( $val, "spam", '1' ); set_time_limit( 60 ); } } } } else if ( isset( $_GET['action'] ) && $_GET['action'] == 'delete' ) { $_GET['updatedmsg'] = __( 'Blog Deleted!', 'ust' ); } if ( isset( $_GET['updated'] ) && $_GET['updatedmsg'] ) { ?>

" . sprintf( __( 'You must enable the Anti-Splog API by entering your WPMU DEV Premium API key to be able to use this feature of the plugin.', 'ust' ), "$ust_admin_url&tab=settings" ) . "

"; } _e( '

This is the moderation queue for suspicious blogs. When you are sure a blog is spam, mark it so. If it is definitely a valid blog you should "ignore" it. It is best to leave blogs in here until you are sure whether they are spam or not spam, as the system learns from both actions.

', 'ust' ); $apage = isset( $_GET['apage'] ) ? intval( $_GET['apage'] ) : 1; $num = isset( $_GET['num'] ) ? intval( $_GET['num'] ) : $ust_settings['paged_blogs']; $page_link = ( $apage > 1 ) ? '&apage=' . $apage : ''; //get sort if ( isset( $_GET['orderby'] ) && $_GET['orderby'] == 'lastupdated' ) { $order_by = 'b.last_updated DESC'; } else if ( isset( $_GET['orderby'] ) && $_GET['orderby'] == 'registered' ) { $order_by = 'b.registered DESC'; } else { $order_by = 'u.certainty DESC, b.last_updated DESC'; } $blogname_columns = is_subdomain_install() ? __( 'Domain' ) : __( 'Path' ); if ( is_array( $ust_settings['keywords'] ) && count( $ust_settings['keywords'] ) ) { foreach ( $ust_settings['keywords'] as $word ) { $keywords[] = "`post_content` LIKE '%" . addslashes( trim( $word ) ) . "%'"; } $keyword_string = implode( $keywords, ' OR ' ); } //if the Post Indexer plugin is installed and keywords are set if ( class_exists( 'postindexermodel' ) && $keyword_string ) { $query = "SELECT * FROM {$wpdb->blogs} b JOIN {$wpdb->registration_log} r ON b.blog_id = r.blog_id JOIN {$wpdb->base_prefix}ust u ON b.blog_id = u.blog_id LEFT JOIN (SELECT `BLOG_ID` as bid, COUNT( `ID` ) AS total FROM `{$wpdb->base_prefix}network_posts` WHERE $keyword_string GROUP BY BLOG_ID) as s ON b.blog_id = s.bid WHERE b.site_id = '{$wpdb->siteid}' AND b.spam = '0' AND b.deleted = '0' AND b.archived = '0' AND u.`ignore` = '0' AND b.blog_id != '{$current_site->blog_id}' AND (u.certainty > 0 OR s.total > 0) ORDER BY s.total DESC, u.certainty DESC, b.last_updated DESC"; $total = $wpdb->get_var( "SELECT COUNT(b.blog_id) FROM {$wpdb->blogs} b JOIN {$wpdb->registration_log} r ON b.blog_id = r.blog_id JOIN {$wpdb->base_prefix}ust u ON b.blog_id = u.blog_id LEFT JOIN (SELECT `BLOG_ID`, COUNT( `ID` ) AS total FROM `{$wpdb->base_prefix}network_posts` WHERE $keyword_string GROUP BY BLOG_ID) as s ON b.blog_id = s.BLOG_ID WHERE b.site_id = '{$wpdb->siteid}' AND b.spam = '0' AND b.deleted = '0' AND b.archived = '0' AND u.`ignore` = '0' AND b.blog_id != '{$current_site->blog_id}' AND (u.certainty > 0 OR s.total > 0)" ); $posts_columns = array( 'id' => __( 'ID', 'ust' ), 'blogname' => $blogname_columns, 'ips' => __( 'IPs', 'ust' ), 'users' => __( 'Blog Users', 'ust' ), 'keywords' => __( 'Keywords', 'ust' ), 'certainty' => __( 'Splog Certainty', 'ust' ), 'lastupdated' => __( 'Last Updated' ), 'registered' => __( 'Registered' ), 'posts' => __( 'Recent Posts', 'ust' ) ); } else { //no post indexer $query = "SELECT * FROM {$wpdb->blogs} b JOIN {$wpdb->registration_log} r ON b.blog_id = r.blog_id JOIN {$wpdb->base_prefix}ust u ON b.blog_id = u.blog_id WHERE b.site_id = '{$wpdb->siteid}' AND b.spam = '0' AND b.deleted = '0' AND b.archived = '0' AND u.ignore = '0' AND b.blog_id != '{$current_site->blog_id}' AND u.certainty > 0 ORDER BY $order_by"; $total = $wpdb->get_var( "SELECT COUNT(b.blog_id) FROM {$wpdb->blogs} b JOIN {$wpdb->registration_log} r ON b.blog_id = r.blog_id JOIN {$wpdb->base_prefix}ust u ON b.blog_id = u.blog_id WHERE b.site_id = '{$wpdb->siteid}' AND b.spam = '0' AND b.deleted = '0' AND b.archived = '0' AND u.ignore = '0' AND b.blog_id != '{$current_site->blog_id}' AND u.certainty > 0" ); $posts_columns = array( 'id' => __( 'ID', 'ust' ), 'blogname' => $blogname_columns, 'ips' => __( 'IPs', 'ust' ), 'users' => __( 'Blog Users', 'ust' ), 'certainty' => __( 'Splog Certainty', 'ust' ), 'lastupdated' => '' . __( 'Last Updated' ) . '', 'registered' => '' . __( 'Registered' ) . '', 'posts' => __( 'Recent Posts', 'ust' ) ); } $query .= " LIMIT " . intval( ( $apage - 1 ) * $num ) . ", " . intval( $num ); $blog_list = $wpdb->get_results( $query, ARRAY_A ); $blog_navigation = paginate_links( array( 'base' => add_query_arg( 'apage', '%#%' ), 'format' => '', 'total' => ceil( $total / $num ), 'current' => $apage ) ); if ( isset( $_GET['orderby'] ) ) { $page_link = $page_link . '&orderby=' . urlencode( $_GET['orderby'] ); } ?>
$blog_navigation
"; } ?>


$column_display_name ) { $col_url = $column_display_name; ?> '; $blogname = is_subdomain_install() ? str_replace( '.' . $current_site->domain, '', $blog['domain'] ) : $blog['path']; foreach ( $posts_columns as $column_name => $column_display_name ) { switch ( $column_name ) { case 'id': ?> get_row( "SELECT user_login, spam FROM " . $wpdb->base_prefix . "users WHERE ID = '" . $blog['last_user_id'] . "'" ); $user_login = $result->user_login; $user_spam = $result->spam; ?> base_prefix}{$blog['blog_id']}_posts` WHERE post_status = 'publish' AND post_type = 'post' AND ID != '1' ORDER BY post_date DESC LIMIT {$ust_settings['paged_posts']}"; $posts = $wpdb->get_results( $query, ARRAY_A ); ?> $column_display_name ) { $col_url = $column_display_name; ?>
' name='allblogs[]' value=''/>
' . __( 'Ignore', 'ust' ) . ''; ?> | ' . __( 'Spam' ) . ''; ?>
Registered:
Last User: title="" href="users.php?s=" class="edit">
Last IP:
get_blog_prefix( $blog['blog_id'] ); $blogusers = $wpdb->get_results( "SELECT user_id, user_id AS ID, user_login, display_name, user_email, spam, meta_value FROM $wpdb->users, $wpdb->usermeta WHERE {$wpdb->users}.ID = {$wpdb->usermeta}.user_id AND meta_key = '{$blog_prefix}capabilities' ORDER BY {$wpdb->usermeta}.user_id" ); if ( is_array( $blogusers ) ) { $blogusers_warning = ''; if ( count( $blogusers ) > 5 ) { $blogusers = array_slice( $blogusers, 0, 5 ); $blogusers_warning = __( 'Only showing first 5 users.' ) . ' ' . __( 'More' ) . ''; } foreach ( $blogusers as $key => $val ) { $spm_class = ( $val->spam ) ? ' style="color:red;"' : ''; echo '' . $val->user_login . ' '; echo '' . __( 'Blogs', 'ust' ) . ''; if ( $val->spam == 0 ) { echo ' | ' . __( 'Spam', 'ust' ) . ''; } echo '
'; } if ( $blogusers_warning != '' ) { echo '' . $blogusers_warning . '
'; } } ?>
% g:i:s a' ), $blog['last_updated'] ); ?> g:i:s a' ), $blog['registered'] ); ?> ' . ust_trim_title( $title ) . '
'; $preview_id ++; } } else { _e( 'No Posts', 'ust' ); } ?>
$blog_navigation
"; } ?>

'; foreach ( $post_preview as $id => $content ) { if ( $ust_settings['strip'] ) { $content = strip_tags( $content, '