Skip to:
Content

BuddyPress.org

Changeset 1715


Ignore:
Timestamp:
08/27/2009 07:48:54 PM (17 years ago)
Author:
apeatling
Message:

Fixes #755 props chrisscott

Location:
trunk
Files:
8 edited

Legend:

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

    r1703 r1715  
    791791
    792792        foreach ( $terms as $term ) {
    793                 $link = get_blog_option( 1, 'siteurl') . '/tag/' . $term->slug;
     793                $link = get_blog_option( BP_ROOT_BLOG, 'siteurl') . '/tag/' . $term->slug;
    794794                $link = apply_filters('term_link', $link);
    795795               
  • trunk/bp-core.php

    r1701 r1715  
    1414/* Define on which blog ID BuddyPress should run */
    1515if ( !defined( 'BP_ROOT_BLOG' ) )
    16         define( 'BP_ROOT_BLOG', 1 );
     16        define( 'BP_ROOT_BLOG', 2 );
    1717
    1818/* Define the user and usermeta table names, useful if you are using custom or shared tables */
     
    387387 */
    388388function bp_core_get_root_domain() {
    389         return apply_filters( 'bp_core_get_root_domain', get_blog_option( BP_ROOT_BLOG, 'siteurl' ) );
     389        global $current_blog;
     390       
     391        if ( defined( 'BP_ENABLE_MULTIBLOG' ) )
     392                $domain = get_blog_option( $current_blog->blog_id, 'siteurl' );
     393        else
     394                $domain = get_blog_option( BP_ROOT_BLOG, 'siteurl' );
     395
     396        return apply_filters( 'bp_core_get_root_domain', $domain );
    390397}
    391398
     
    12971304 */
    12981305function bp_core_email_from_name_filter() {
    1299         return get_blog_option( 1, 'blogname' );
     1306        return get_blog_option( BP_ROOT_BLOG, 'blogname' );
    13001307}
    13011308add_filter( 'wp_mail_from_name', 'bp_core_email_from_name_filter' );
  • trunk/bp-core/bp-core-catchuri.php

    r1714 r1715  
    3838                        return false;
    3939        }
    40        
     40
    4141        if ( strpos( $_SERVER['REQUEST_URI'], 'wp-load.php' ) )
    4242                $path = bp_core_referrer();
     
    5050        $noget = substr( $path, 0, strpos( $path, '?' ) );
    5151        if ( $noget != '' ) $path = $noget;
    52        
     52
    5353        /* Fetch the current URI and explode each part seperated by '/' into an array */
    5454        $bp_uri = explode( "/", $path );
    55        
    56         if ( defined( 'BP_ENABLE_MULTIBLOG' ) ) {
     55
     56        /* Loop and remove empties */
     57        for ( $i = 0; $i <= count( $bp_uri ); $i++ )
     58                if ( empty( $bp_uri[$i] ) ) unset( $bp_uri[$i] );
     59
     60        if ( defined( 'BP_ENABLE_MULTIBLOG' ) || 1 != BP_ROOT_BLOG ) {
    5761                /* If we are running BuddyPress on any blog, not just a root blog, we need to first
    5862                   shift off the blog name if we are running a subdirectory install of WPMU. */
     
    6064                        array_shift( $bp_uri );
    6165        }
    62        
    63         /* Take empties off the end of complete URI */
    64         if ( empty( $bp_uri[count($bp_uri) - 1] ) )
    65                 array_pop( $bp_uri );
    66 
    67         /* Take empties off the start of complete URI */
    68         if ( empty( $bp_uri[0] ) )
    69                 array_shift( $bp_uri );
    70                
     66
    7167        /* Get total URI segment count */
    7268        $bp_uri_count = count( $bp_uri ) - 1;
     
    152148        $action_variables = array_merge( array(), $action_variables );
    153149
    154         //var_dump($current_component, $current_action, $action_variables);
     150        //var_dump($current_component, $current_action, $action_variables); die;
    155151}
    156152add_action( 'plugins_loaded', 'bp_core_set_uri_globals', 3 );
     
    175171
    176172        $bp_path = $pages;
    177        
     173
    178174        if ( !bp_is_blog_page() ) {
    179175                remove_action( 'template_redirect', 'redirect_canonical' );
  • trunk/bp-friends/bp-friends-notifications.php

    r1518 r1715  
    1919        // Set up and send the message
    2020        $to = $ud->user_email;
    21         $subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( 'New friendship request from %s', 'buddypress' ), $initiator_name );
     21        $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'New friendship request from %s', 'buddypress' ), $initiator_name );
    2222
    2323        $message = sprintf( __(
     
    5656        // Set up and send the message
    5757        $to = $ud->user_email;
    58         $subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( '%s accepted your friendship request', 'buddypress' ), $friend_name );
     58        $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( '%s accepted your friendship request', 'buddypress' ), $friend_name );
    5959
    6060        $message = sprintf( __(
  • trunk/bp-groups/bp-groups-notifications.php

    r1700 r1715  
    1414        $poster_profile_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $poster_ud->user_login;
    1515
    16         $subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( 'New wire post on group: %s', 'buddypress' ), stripslashes($group->name) );
     16        $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'New wire post on group: %s', 'buddypress' ), stripslashes($group->name) );
    1717
    1818        foreach ( $group->user_dataset as $user ) {
     
    5555       
    5656        $group = new BP_Groups_Group( $group_id, false, true );
    57         $subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . __( 'Group Details Updated', 'buddypress' );
     57        $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . __( 'Group Details Updated', 'buddypress' );
    5858
    5959        foreach ( $group->user_dataset as $user ) {
     
    105105        // Set up and send the message
    106106        $to = $ud->user_email;
    107         $subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( 'Membership request for group: %s', 'buddypress' ), stripslashes($group->name) );
     107        $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'Membership request for group: %s', 'buddypress' ), stripslashes($group->name) );
    108108
    109109$message = sprintf( __(
     
    149149       
    150150        if ( $accepted ) {
    151                 $subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( 'Membership request for group "%s" accepted', 'buddypress' ), stripslashes($group->name) );
     151                $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'Membership request for group "%s" accepted', 'buddypress' ), stripslashes($group->name) );
    152152                $message = sprintf( __(
    153153'Your membership request for the group "%s" has been accepted.
     
    159159               
    160160        } else {
    161                 $subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( 'Membership request for group "%s" rejected', 'buddypress' ), stripslashes($group->name) );
     161                $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'Membership request for group "%s" rejected', 'buddypress' ), stripslashes($group->name) );
    162162                $message = sprintf( __(
    163163'Your membership request for the group "%s" has been rejected.
     
    201201        $to = $ud->user_email;
    202202
    203         $subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( 'You have been promoted in the group: "%s"', 'buddypress' ), stripslashes($group->name) );
     203        $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'You have been promoted in the group: "%s"', 'buddypress' ), stripslashes($group->name) );
    204204
    205205        $message = sprintf( __(
     
    244244                $to = $invited_ud->user_email;
    245245
    246                 $subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( 'You have an invitation to the group: "%s"', 'buddypress' ), stripslashes($group->name) );
     246                $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'You have an invitation to the group: "%s"', 'buddypress' ), stripslashes($group->name) );
    247247
    248248                $message = sprintf( __(
  • trunk/bp-messages/bp-messages-notifications.php

    r1518 r1715  
    1818                // Set up and send the message
    1919                $to = $ud->user_email;
    20                 $subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( 'New message from %s', 'buddypress' ), stripslashes($sender_name) );
     20                $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'New message from %s', 'buddypress' ), stripslashes($sender_name) );
    2121
    2222                $content = sprintf( __(
     
    6565//
    6666// ---------------------
    67 // ', 'buddypress' ), get_blog_option( 1, 'blogname' ), stripslashes( strip_tags( $message_subject ) ), stripslashes( strip_tags( $message ) ), $message_link );
     67// ', 'buddypress' ), get_blog_option( BP_ROOT_BLOG, 'blogname' ), stripslashes( strip_tags( $message_subject ) ), stripslashes( strip_tags( $message ) ), $message_link );
    6868//
    6969//              $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
  • trunk/bp-xprofile.php

    r1714 r1715  
    242242function xprofile_screen_display_profile() {
    243243        global $bp, $is_new_friend;
    244        
     244
    245245        // If this is a first visit to a new friends profile, delete the friend accepted notifications for the
    246246        // logged in user. $is_new_friend is set in bp-core/bp-core-catchuri.php in bp_core_set_uri_globals()
  • trunk/bp-xprofile/bp-xprofile-notifications.php

    r1518 r1715  
    3535                        // Set up and send the message
    3636                        $to = $ud->user_email;
    37                         $subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( '%s posted on your wire.', 'buddypress' ), stripslashes($poster_name) );
     37                        $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( '%s posted on your wire.', 'buddypress' ), stripslashes($poster_name) );
    3838
    3939$message = sprintf( __(
Note: See TracChangeset for help on using the changeset viewer.