Skip to:
Content

BuddyPress.org

Changeset 3641


Ignore:
Timestamp:
01/01/2011 08:13:49 PM (15 years ago)
Author:
boonebgorges
Message:

Fetches the bp_pages names and slugs from the root blog table when viewing a secondary blog. Fixes #2989

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity.php

    r3633 r3641  
    985985    $content = preg_replace('/<img[^>]*>/Ui', '', $content );
    986986
    987     if ( !empty( $matches ) ) {
     987    if ( !empty( $matches ) && !empty( $matches[0] ) ) {
    988988        /* Get the SRC value */
    989989        preg_match( '/<img.*?(src\=[\'|"]{0,1}.*?[\'|"]{0,1})[\s|>]{1}/i', $matches[0][0], $src );
  • trunk/bp-core.php

    r3627 r3641  
    252252    if ( empty( $page_ids ) )
    253253        return false;
     254       
     255    $posts_table_name = is_multisite() && !defined( 'BP_ENABLE_MULTIBLOG' ) ? $wpdb->get_blog_prefix( BP_ROOT_BLOG ) . 'posts' : $wpdb->posts;
    254256
    255257    $page_ids_sql = implode( ',', (array)$page_ids );
    256     $page_names = $wpdb->get_results( $wpdb->prepare( "SELECT ID, post_name, post_parent FROM {$wpdb->posts} WHERE ID IN ({$page_ids_sql}) " ) );
     258
     259    $page_names = $wpdb->get_results( $wpdb->prepare( "SELECT ID, post_name, post_parent FROM {$posts_table_name} WHERE ID IN ({$page_ids_sql}) " ) );
    257260    $pages = new stdClass;
    258261
     
    267270                /* Get the slug */
    268271                while ( $page_name->post_parent != 0 ) {
    269                     $parent = $wpdb->get_results( $wpdb->prepare( "SELECT post_name, post_parent FROM {$wpdb->posts} WHERE ID = %d", $page_name->post_parent ) );
     272                    $parent = $wpdb->get_results( $wpdb->prepare( "SELECT post_name, post_parent FROM {$posts_table_name} WHERE ID = %d", $page_name->post_parent ) );
    270273                    $slug[] = $parent[0]->post_name;
    271274                    $page_name->post_parent = $parent[0]->post_parent;
Note: See TracChangeset for help on using the changeset viewer.