Skip to:
Content

BuddyPress.org

Changeset 1492


Ignore:
Timestamp:
06/01/2009 08:59:39 PM (16 years ago)
Author:
apeatling
Message:

Fixed wp_kses filter on activity content. Added option to allow BP to run on multiple blogs, instead of just one fixed blog by using the "BP_ENABLE_MULTIBLOG" constant.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-filters.php

    r1484 r1492  
    1414add_filter( 'bp_get_activity_content', 'make_clickable' );
    1515
    16 add_filter( 'bp_get_activity_content', 'wp_filter_kses' );
    17 
    1816?>
  • trunk/bp-activity/bp-activity-templatetags.php

    r1427 r1492  
    220220}
    221221    function bp_get_activity_content() {
    222         global $activities_template;
     222        global $activities_template, $allowed_tags;
    223223
    224224        if ( bp_is_home() && $activities_template->activity_type == 'personal' ) {
    225             return apply_filters( 'bp_get_activity_content', bp_activity_content_filter( $activities_template->activity->content, $activities_template->activity->date_recorded, $activities_template->full_name ) );                       
     225            $content = apply_filters( 'bp_get_activity_content', bp_activity_content_filter( $activities_template->activity->content, $activities_template->activity->date_recorded, $activities_template->full_name ) );                       
    226226        } else {
    227227            $activities_template->activity->content = bp_activity_insert_time_since( $activities_template->activity->content, $activities_template->activity->date_recorded );
    228             return apply_filters( 'bp_get_activity_content', $activities_template->activity->content );
    229         }
     228            $content = apply_filters( 'bp_get_activity_content', $activities_template->activity->content );
     229        }
     230       
     231        $allowed_tags .= '<span><img>';
     232        return wp_kses( $content, $allowed_tags );
    230233    }
    231234
  • trunk/bp-core/bp-core-catchuri.php

    r1458 r1492  
    3333    global $bp, $current_blog;
    3434   
    35     /* Only catch URI's on the root blog */
    36     if ( BP_ROOT_BLOG != (int) $current_blog->blog_id )
    37         return false;
     35    if ( !defined( 'BP_ENABLE_MULTIBLOG' ) ) {
     36        /* Only catch URI's on the root blog if we are not running BP on multiple blogs */
     37        if ( BP_ROOT_BLOG != (int) $current_blog->blog_id )
     38            return false;
     39    }
    3840   
    3941    if ( strpos( $_SERVER['REQUEST_URI'], 'bp-core-ajax-handler.php' ) )
     
    5254    $bp_uri = explode( "/", $path );
    5355   
     56    if ( defined( 'BP_ENABLE_MULTIBLOG' ) ) {
     57        /* If we are running BuddyPress on any blog, not just a root blog, we need to first
     58           shift off the blog name if we are running a subdirectory install of WPMU. */
     59        if ( $current_blog->path != '/' )
     60            array_shift( $bp_uri );
     61    }
     62   
    5463    /* Take empties off the end of complete URI */
    5564    if ( empty( $bp_uri[count($bp_uri) - 1] ) )
     
    5867    /* Take empties off the start of complete URI */
    5968    if ( empty( $bp_uri[0] ) )
     69        array_shift( $bp_uri );
     70   
     71    if ( (int)$current_blog->blog_id == 2 )
    6072        array_shift( $bp_uri );
    6173       
  • trunk/bp-core/bp-core-templatetags.php

    r1484 r1492  
    464464
    465465function bp_page_title() {
    466     global $bp, $post, $wp_query;
     466    echo bp_get_page_title();
     467}
     468
     469function bp_get_page_title() {
     470    global $bp, $post, $wp_query, $current_blog;
    467471
    468472    if ( is_home() && bp_is_page( 'home' ) ) {
     
    492496    }
    493497   
    494     echo apply_filters( 'bp_page_title', get_blog_option( BP_ROOT_BLOG, 'blogname' ) . ' &#8212; ' . attribute_escape( $title ), attribute_escape( $title ) );
    495    
     498    if ( defined( 'BP_ENABLE_MULTIBLOG' ) ) {
     499        $blog_title = get_blog_option( $current_blog->blog_id, 'blogname' );
     500    } else {
     501        $blog_title = get_blog_option( BP_ROOT_BLOG, 'blogname' );     
     502    }
     503   
     504    return apply_filters( 'bp_page_title', $blog_title . ' &#8212; ' . attribute_escape( $title ), attribute_escape( $title ) );
    496505}
    497506
     
    10571066
    10581067function bp_home_blog_url() {
    1059     global $bp;
    1060 
    1061     if ( 'bphome' == get_blog_option( BP_ROOT_BLOG, 'template' ) )
     1068    global $bp, $current_blog;
     1069   
     1070    if ( defined( 'BP_ENABLE_MULTIBLOG' ) ) {
     1071        $blog_id = $current_blog->blog_id;
     1072    } else {
     1073        $blog_id = BP_ROOT_BLOG;
     1074    }
     1075
     1076    if ( 'bphome' == get_blog_option( $blog_id, 'template' ) )
    10621077        echo $bp->root_domain . '/' . BP_HOME_BLOG_SLUG;
    10631078    else
Note: See TracChangeset for help on using the changeset viewer.