Skip to:
Content

BuddyPress.org

Changeset 4965


Ignore:
Timestamp:
08/11/2011 08:44:20 PM (13 years ago)
Author:
djpaul
Message:

Fix blog posts not showing in activity stream in non-multisites. Fixes #3445, props boonebgorges and paulgibbs

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-blogs/bp-blogs-functions.php

    r4961 r4965  
    5050    $wpdb->query( "TRUNCATE TABLE {$bp->blogs->table_name}" );
    5151
    52     $blog_ids = $wpdb->get_col( $wpdb->prepare( "SELECT blog_id FROM {$wpdb->base_prefix}blogs WHERE mature = 0 AND spam = 0 AND deleted = 0" ) );
     52    if ( is_multisite() )
     53        $blog_ids = $wpdb->get_col( $wpdb->prepare( "SELECT blog_id FROM {$wpdb->base_prefix}blogs WHERE mature = 0 AND spam = 0 AND deleted = 0" ) );
     54    else
     55        $blog_ids = 1;
    5356
    5457    if ( $blog_ids ) {
     
    5760            $subscribers    = get_users( array( 'blog_id' => $blog_id, 'role' => 'subscriber' ) );
    5861
    59             if ( $users ) {
     62            if ( !empty( $users ) ) {
    6063                foreach ( (array)$users as $user ) {
    6164                    // Don't record blogs for subscribers
     
    461464    global $wpdb, $bp;
    462465
    463     if ( !is_numeric( $blog_id ) || !is_multisite() )
     466    if ( !is_numeric( $blog_id ) )
    464467        return false;
    465468
     
    488491    $blog_id = (int) $blog_id;
    489492
    490     if ( !$blog_id || !is_multisite() )
     493    if ( !$blog_id )
    491494        return false;
    492495
     
    520523    global $wpdb, $bp;
    521524
    522     if ( !is_numeric( $blog_id ) || !is_multisite() )
     525    if ( !is_numeric( $blog_id ) )
    523526        return false;
    524527
  • trunk/bp-blogs/bp-blogs-loader.php

    r4961 r4965  
    5454            'slug'                  => BP_BLOGS_SLUG,
    5555            'root_slug'             => isset( $bp->pages->blogs->slug ) ? $bp->pages->blogs->slug : BP_BLOGS_SLUG,
    56             'has_directory'         => true,
     56            'has_directory'         => is_multisite(), // Non-multisite installs don't need a top-level Sites directory, since there's only one site
    5757            'notification_callback' => 'bp_blogs_format_notifications',
    5858            'search_string'         => __( 'Search sites...', 'buddypress' ),
  • trunk/bp-core/admin/bp-core-admin.php

    r4963 r4965  
    1212}
    1313add_action( 'in_plugin_update_message-buddypress/bp-loader.php', 'bp_core_update_message' );
    14 
    15 /**
    16  * Renders the main admin panel.
    17  *
    18  * @package BuddyPress Core
    19  * @since {@internal Unknown}}
    20  */
    21 function bp_core_admin_dashboard() {
    22     $base_url = bp_get_admin_url( 'admin.php' );
    23     $action   = add_query_arg( array( 'page' => 'bp-general-settings' ), $base_url );
    24     ?>
    25 
    26     <div class="wrap" id="bp-admin">
    27 
    28         <div id="bp-admin-header">
    29             <h3><?php _e( 'BuddyPress', 'buddypress' ); ?></h3>
    30             <h2><?php _e( 'Dashboard',  'buddypress' ); ?></h2>
    31         </div>
    32 
    33         <?php do_action( 'bp_admin_notices' ); ?>
    34 
    35         <form action="<?php echo $action ?>" method="post" id="bp-admin-form">
    36             <div id="bp-admin-content">
    37                 <p>[TODO: All sorts of awesome things will go here. Latest plugins and themes, stats, version check, support topics, news, tips]</p>
    38             </div>
    39         </form>
    40 
    41     </div>
    42 
    43 <?php
    44 }
    4514
    4615/**
     
    348317            'description' => __( 'Allow your users to modify their account and notification settings directly from within their profiles.', 'buddypress' )
    349318        ),
    350         'friends' => array(
     319        'friends'  => array(
    351320            'title'       => __( 'Friend Connections', 'buddypress' ),
    352321            'description' => __( 'Let your users make connections so they can track the activity of others and focus on the people they care about the most.', 'buddypress' )
     
    360329            'description' => __( 'Global, personal, and group activity streams with threaded commenting, direct posting, favoriting and @mentions, all with full RSS feed and email notification support.', 'buddypress' )
    361330        ),
    362         'groups' => array(
     331        'groups'   => array(
    363332            'title'       => __( 'User Groups', 'buddypress' ),
    364333            'description' => __( 'Groups allow your users to organize themselves into specific public, private or hidden sections with separate activity streams and member listings.', 'buddypress' )
    365334        ),
    366         'forums' => array(
     335        'forums'   => array(
    367336            'title'       => __( 'Discussion Forums', 'buddypress' ),
    368337            'description' => __( 'Full-powered discussion forums built directly into groups allow for more conventional in-depth conversations. NOTE: This will require an extra (but easy) setup step.', 'buddypress' )
     338        ),
     339        'blogs'    => array(
     340            'title'       => __( 'Site Tracking', 'buddypress' ),
     341            'description' => __( 'Make BuddyPress aware of new posts and new comments from your site.', 'buddypress' )
    369342        )
    370343    ) );
    371344
    372     if ( is_multisite() ) {
    373         $optional_components['blogs'] = array(
    374             'title'       => __( 'Site Tracking', 'buddypress' ),
    375             'description' => __( 'Track new sites, new posts and new comments across your entire network.', 'buddypress' )
    376         );
    377     }
     345    if ( is_multisite() )
     346        $optional_components['blogs']['description'] = __( 'Make BuddyPress aware of new sites, new posts and new comments from across your entire network.', 'buddypress' );
    378347
    379348    // Required components
  • trunk/bp-core/admin/bp-core-update.php

    r4961 r4965  
    302302                <th scope="row">
    303303                    <h5><?php _e( 'Sites', 'buddypress' ); ?></h5>
    304                     <p><?php _e( 'Displays individual groups as well as a directory of groups.', 'buddypress' ); ?></p>
     304                    <p><?php _e( 'Displays a directory of the sites in your network.', 'buddypress' ); ?></p>
    305305                </th>
    306306                <td>
     
    312312        </table>
    313313
    314         <p><?php _e( 'Would you like to enable site tracking, which tracks activity across all of your network?', 'buddypress' ); ?></p>
     314        <p><?php _e( 'Would you like to enable site tracking, which tracks blog posts and comments from across your network?', 'buddypress' ); ?></p>
    315315
    316316        <div class="left-col">
     
    428428            <tr valign="top">
    429429                <th scope="row">
    430                     <h5><?php _e( 'Members', 'buddypres' ); ?></h5>
     430                    <h5><?php _e( 'Members', 'buddypress' ); ?></h5>
    431431                    <p><?php _e( 'Displays member profiles, and a directory of all site members.', 'buddypress' ); ?></p>
    432432                </th>
     
    472472                    <th scope="row">
    473473                        <h5><?php _e( 'Forums', 'buddypress' ); ?></h5>
    474                         <p><?php _e( 'Displays individual groups as well as a directory of groups.', 'buddypress' ); ?></p>
     474                        <p><?php _e( 'Displays a directory of public forum topics.', 'buddypress' ); ?></p>
    475475                    </th>
    476476                    <td>
     
    482482            <?php endif; ?>
    483483
     484            <?php /* The Blogs component only needs a directory page when Multisite is enabled */ ?>
    484485            <?php if ( is_multisite() && isset( $active_components['blogs'] ) ) : ?>
    485486
     
    487488                    <th scope="row">
    488489                        <h5><?php _e( 'Sites', 'buddypress' ); ?></h5>
    489                         <p><?php _e( 'Displays individual groups as well as a directory of groups.', 'buddypress' ); ?></p>
     490                        <p><?php _e( 'Displays a directory of the sites in your network.', 'buddypress' ); ?></p>
    490491                    </th>
    491492                    <td>
     
    10231024            if ( !function_exists( 'bp_core_update_message' ) )
    10241025                require( WP_PLUGIN_DIR . '/buddypress/bp-core/admin/bp-core-admin.php' );
     1026
    10251027            bp_core_add_admin_menu();
    10261028
     
    11101112        bp_core_install_extended_profiles();
    11111113
    1112     // Only install blog tables if this is a multisite installation
    1113     if ( is_multisite() && !empty( $active_components['blogs'] ) )
     1114    // Blog tracking
     1115    if ( !empty( $active_components['blogs'] ) )
    11141116        bp_core_install_blog_tracking();
    11151117}
     
    11371139
    11381140    // On first installation - record all existing blogs in the system.
    1139     if ( !(int)$bp->site_options['bp-blogs-first-install'] && is_multisite() ) {
     1141    if ( !(int)$bp->site_options['bp-blogs-first-install'] ) {
    11401142        bp_blogs_record_existing_blogs();
    11411143        bp_update_option( 'bp-blogs-first-install', 1 );
  • trunk/bp-core/bp-core-functions.php

    r4961 r4965  
    353353     * on the off chance that someone has activated the blogs component and then disabled MS
    354354     */
    355     if ( is_multisite() && bp_is_active( 'blogs' ) ) {
     355    if ( bp_is_active( 'blogs' ) ) {
    356356        $count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM {$bp->blogs->table_name}" ) );
    357357
  • trunk/bp-core/bp-core-loader.php

    r4961 r4965  
    5858
    5959        // Set the included and optional components.
    60         $bp->optional_components = array( 'activity', 'forums', 'friends', 'groups', 'messages', 'settings', 'xprofile' );
    61 
    62         // Blogs component only available for multisite
    63         if ( is_multisite() )
    64             $bp->optional_components[] = 'blogs';
    65 
    66         $bp->optional_components    = apply_filters( 'bp_optional_components', $bp->optional_components );
     60        $bp->optional_components = apply_filters( 'bp_optional_components', array( 'activity', 'blogs', 'forums', 'friends', 'groups', 'messages', 'settings', 'xprofile' ) );
    6761
    6862        // Set the required components
    69         $bp->required_components    = apply_filters( 'bp_required_components', array( 'members' ) );
     63        $bp->required_components = apply_filters( 'bp_required_components', array( 'members' ) );
    7064
    7165        // Get a list of activated components
Note: See TracChangeset for help on using the changeset viewer.