Skip to:
Content

bbPress.org


Ignore:
Timestamp:
09/10/2011 10:27:19 PM (10 years ago)
Author:
johnjamesjacoby
Message:

API adjustments:

  • Refactor _status_ vars into callable functions.
  • Audit usage of $bbp global.
  • Perform get_class() checks on extensions to avoid errors if global $bbp is overloaded.
  • Bump DB version to 175.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-includes/bbp-user-functions.php

    r3504 r3505  
    10231023
    10241024    // Make array of post types to mark as spam
    1025     $post_types = array( bbp_get_topic_post_type(), bbp_get_reply_post_type() );
    1026     $post_types = "'" . implode( "', '", $post_types ) . "'";
     1025    $post_types  = array( bbp_get_topic_post_type(), bbp_get_reply_post_type() );
     1026    $post_types  = "'" . implode( "', '", $post_types ) . "'";
     1027    $status      = bbp_get_public_status_id();
    10271028
    10281029    // Loop through blogs and remove their posts
     
    10331034
    10341035        // Get topics and replies
    1035         $posts = $wpdb->get_col( "SELECT ID FROM {$wpdb->posts} WHERE post_author = {$user_id} AND post_status = 'publish' AND post_type IN ({$post_types})" );
     1036        $posts = $wpdb->get_col( "SELECT ID FROM {$wpdb->posts} WHERE post_author = {$user_id} AND post_status = '{$status}' AND post_type IN ({$post_types})" );
    10361037
    10371038        // Loop through posts and spam them
     
    10971098
    10981099    // Arm the torpedos
    1099     global $wpdb, $bbp;
     1100    global $wpdb;
    11001101
    11011102    // Get the blog IDs of the user to mark as spam
     
    11091110    $post_types = array( bbp_get_topic_post_type(), bbp_get_reply_post_type() );
    11101111    $post_types = "'" . implode( "', '", $post_types ) . "'";
     1112    $status     = bbp_get_spam_status_id();
    11111113
    11121114    // Loop through blogs and remove their posts
     
    11171119
    11181120        // Get topics and replies
    1119         $posts = $wpdb->get_col( "SELECT ID FROM {$wpdb->posts} WHERE post_author = {$user_id} AND post_status = '{$bbp->spam_status_id}' AND post_type IN ({$post_types})" );
     1121        $posts = $wpdb->get_col( "SELECT ID FROM {$wpdb->posts} WHERE post_author = {$user_id} AND post_status = '{$status}' AND post_type IN ({$post_types})" );
    11201122
    11211123        // Loop through posts and spam them
Note: See TracChangeset for help on using the changeset viewer.