Skip to:
Content

BuddyPress.org

Changeset 1887


Ignore:
Timestamp:
09/16/2009 07:46:47 PM (16 years ago)
Author:
apeatling
Message:

Fixes for subdirectory WPMU installations.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core.php

    r1878 r1887  
    388388    global $bp;
    389389
    390     if ( !is_home() && is_null( $bp->displayed_user->id ) && $bp->current_component == BP_MEMBERS_SLUG ) {
     390    if ( is_null( $bp->displayed_user->id ) && $bp->current_component == BP_MEMBERS_SLUG ) {
    391391        $bp->is_directory = true;
    392392
  • trunk/bp-core/bp-core-catchuri.php

    r1801 r1887  
    5555
    5656    /* Loop and remove empties */
    57     for ( $i = 0; $i <= count( $bp_uri ); $i++ )
    58         if ( empty( $bp_uri[$i] ) ) unset( $bp_uri[$i] );
     57    foreach ( (array)$bp_uri as $key => $uri_chunk )
     58        if ( empty( $bp_uri[$key] ) ) unset( $bp_uri[$key] );
    5959
    6060    if ( defined( 'BP_ENABLE_MULTIBLOG' ) || 1 != BP_ROOT_BLOG ) {
     
    6464            array_shift( $bp_uri );
    6565    }
    66 
    67     /* Get total URI segment count */
    68     $bp_uri_count = count( $bp_uri ) - 1;
    69     $is_member_page = false;
    7066   
    7167    /* Set the indexes, these are incresed by one if we are not on a VHOST install */
     
    8884        array_shift( $paths );
    8985
    90     for ( $i = 0; $i < $bp_uri_count; $i++ ) {
    91         if ( in_array( $bp_uri[$i], $paths )) {
    92             unset( $bp_uri[$i] );
     86    foreach ( (array)$bp_uri as $key => $uri_chunk ) {
     87        if ( in_array( $uri_chunk, $paths )) {
     88            unset( $bp_uri[$key] );
    9389        }
    9490    }
     
    105101
    106102    /* Catch a member page and set the current member ID */
    107     if ( !defined( 'BP_ENABLE_ROOT_PROFILES' ) ) {
     103    if ( !defined( 'BP_ENABLE_ROOT_PROFILES' ) ) {     
    108104        if ( ( $bp_uri[0] == BP_MEMBERS_SLUG && !empty( $bp_uri[1] ) ) || in_array( 'wp-load.php', $bp_uri ) ) {   
    109105            // We are within a member page, set up user id globals
    110106            $displayed_user_id = bp_core_get_displayed_userid( $bp_uri[1] );
    111                
     107
    112108            unset($bp_uri[0]);
    113109            unset($bp_uri[1]);
     
    206202   
    207203    /* Don't hijack any URLs on blog pages */
    208     if ( !$bp_skip_blog_check ) {
    209         if ( bp_is_blog_page() )
     204    if ( bp_is_blog_page() ) {
     205        if ( !$bp_skip_blog_check )
    210206            return false;
     207    } else {
     208        $wp_query->is_home = false;
    211209    }
    212210
     
    255253    if ( !$bp_path && !bp_is_blog_page() ) {
    256254        if ( is_user_logged_in() ) {
    257             wp_redirect( $bp->loggedin_user->domain );
     255            wp_redirect( $bp->root_domain );
    258256        } else {
    259257            wp_redirect( site_url( 'wp-login.php?redirect_to=' . site_url() . $_SERVER['REQUEST_URI'] ) );
  • trunk/bp-forums.php

    r1869 r1887  
    5151            return false;
    5252           
     53        if ( !bp_forums_is_installed_correctly() ) {
     54            bp_core_add_message( 'The forums component has not been set up yet.', 'buddypress' );
     55            bp_core_redirect( $bp->root_domain );
     56        }
     57       
    5358        $bp->is_directory = true;
    5459       
  • trunk/bp-forums/bp-forums-bbpress.php

    r1858 r1887  
    6767    if ( !$tables_installed = (boolean) $bbdb->get_results( 'DESCRIBE `' . $bbdb->forums . '`;', ARRAY_A ) )
    6868        require_once( ABSPATH . 'wp-admin/upgrade-functions.php' );
    69        
     69   
    7070    require_once( BB_PATH . 'bb-admin/includes/functions.bb-admin.php' );
    71 
    7271   
    7372    if ( is_object( $wp_roles ) ) {
     
    9190    if ( !isset( $bb->site_id ) )
    9291        $bb->site_id = BP_ROOT_BLOG;
    93 
    9492
    9593    /* Check if the tables are installed, if not, install them */
  • trunk/bp-forums/bp-forums-templatetags.php

    r1858 r1887  
    295295        return apply_filters( 'bp_get_the_topic_object_name', $forum_template->topic->object_name );
    296296    }
    297 
     297   
    298298function bp_the_topic_object_slug() {
    299299    echo bp_get_the_topic_object_slug();
     
    309309}
    310310    function bp_get_the_topic_object_permalink() {
    311         global $forum_template;
    312                
     311        global $bp, $forum_template;
     312       
    313313        /* Currently this will only work with group forums, extended support in the future */
    314         return apply_filters( 'bp_get_the_topic_object_permalink', $bp->root_domain . '/' . BP_GROUPS_SLUG . '/' . $forum_template->topic->object_slug . '/' );
     314        return apply_filters( 'bp_get_the_topic_object_permalink', $bp->root_domain . '/' . BP_GROUPS_SLUG . '/' . $forum_template->topic->object_slug . '/forum/' );
    315315    }
    316316   
     
    323323        return apply_filters( 'bp_get_the_topic_last_poster_name', bp_core_get_userlink( $forum_template->topic->topic_last_poster ) );
    324324    }
    325 
     325   
    326326function bp_the_topic_object_avatar( $args = '' ) {
    327327    echo bp_get_the_topic_object_avatar( $args );
     
    341341        return apply_filters( 'bp_get_the_topic_object_avatar', bp_core_fetch_avatar( array( 'item_id' => $forum_template->topic->object_id, 'type' => $type, 'object' => 'group', 'width' => $width, 'height' => $height ) ) );       
    342342    }
    343 
     343   
    344344function bp_the_topic_last_poster_avatar( $args = '' ) {
    345345    echo bp_get_the_topic_last_poster_avatar( $args );
  • trunk/bp-themes/bp-sn-parent/directories/forums/forums-loop.php

    r1871 r1887  
    4040            </td>
    4141            <td class="td-group">
    42                 <a href="<?php bp_the_topic_object_permalink() ?>forum/"><?php bp_the_topic_object_avatar( 'type=thumb&width=20&height=20' ) ?></a>
    43                 <a href="<?php bp_the_topic_object_permalink() ?>forum/" title="<?php bp_the_topic_object_name() ?>"><?php bp_the_topic_object_name() ?></a>
     42                <a href="<?php bp_the_topic_object_permalink() ?>"><?php bp_the_topic_object_avatar( 'type=thumb&width=20&height=20' ) ?></a>
     43                <a href="<?php bp_the_topic_object_permalink() ?>" title="<?php bp_the_topic_object_name() ?>"><?php bp_the_topic_object_name() ?></a>
    4444            </td>
    4545            <td class="td-postcount">
Note: See TracChangeset for help on using the changeset viewer.