Skip to:
Content

BuddyPress.org

Ticket #823: bp-root-blog-all-files.patch

File bp-root-blog-all-files.patch, 9.8 KB (added by johnjamesjacoby, 17 years ago)

Patch for all incorrect root blog references

  • bp-activity/bp-activity-templatetags.php

     
    307307               
    308308                if ( !$component_names )
    309309                        return false;
    310                
    311                 $link = remove_query_arg( array( 'afilter' ), $_SERVER['REQUEST_URI'] );
     310
     311                $link = $_SERVER['REQUEST_URI'];
     312                $link = remove_query_arg( array( 'afilter' ), $link );
    312313                $link = remove_query_arg( array( 'acpage' ), $link );
    313314
    314315                foreach ( (array) $component_names as $component_name ) {
  • bp-blogs/bp-blogs-templatetags.php

     
    788788                return false;
    789789
    790790        foreach ( $terms as $term ) {
    791                 $link = get_blog_option( 1, 'siteurl') . '/tag/' . $term->slug;
     791                $link = get_blog_option( BP_ROOT_BLOG, 'siteurl') . '/tag/' . $term->slug;
    792792                $link = apply_filters('term_link', $link);
    793793               
    794794                $term_links[] = '<a href="' . $link . '" rel="tag">' . $term->name . '</a>';
  • bp-core.php

     
    13331333 * @return The blog name for the root blog
    13341334 */
    13351335function bp_core_email_from_name_filter() {
    1336         return get_blog_option( 1, 'blogname' );
     1336        return get_blog_option( BP_ROOT_BLOG, 'blogname' );
    13371337}
    13381338add_filter( 'wp_mail_from_name', 'bp_core_email_from_name_filter' );
    13391339
  • bp-core/bp-core-avatars.php

     
    233233        if ( !$user_id )
    234234                $user_id = $bp->loggedin_user->id;
    235235
    236         $path  = get_blog_option( 1, 'upload_path' );
     236        $path  = get_blog_option( BP_ROOT_BLOG, 'upload_path' );
    237237        $newdir = path_join( ABSPATH, $path );
    238238        $newdir .= '/avatars/' . $user_id;
    239239
     
    241241       
    242242        @wp_mkdir_p( $newdir );
    243243
    244         $newurl = trailingslashit( get_blog_option( 1, 'siteurl' ) ) . '/avatars/' . $user_id;
     244        $newurl = trailingslashit( get_blog_option( BP_ROOT_BLOG, 'siteurl' ) ) . '/avatars/' . $user_id;
    245245        $newburl = $newurl;
    246246        $newsubdir = '/avatars/' . $user_id;
    247247
  • bp-core/bp-core-templatetags.php

     
    218218}
    219219
    220220function bp_site_name() {
    221         echo apply_filters( 'bp_site_name', get_blog_option( 1, 'blogname' ) );
     221        echo apply_filters( 'bp_site_name', get_blog_option( BP_ROOT_BLOG, 'blogname' ) );
    222222}
    223223
    224224function bp_is_home() {
     
    523523}
    524524
    525525function bp_has_custom_activation_page() {
    526         if ( file_exists( WP_CONTENT_DIR . '/themes/' . get_blog_option( 1, 'template') . '/activate.php') )
     526        if ( file_exists( WP_CONTENT_DIR . '/themes/' . get_blog_option( BP_ROOT_BLOG, 'template') . '/activate.php') )
    527527                return true;
    528528       
    529529        return false;
  • bp-friends/bp-friends-notifications.php

     
    1818
    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( __(
    2424"%s wants to add you as a friend.
     
    5555               
    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( __(
    6161'%s accepted your friend request.
  • bp-groups/bp-groups-notifications.php

     
    1313        $poster_ud = get_userdata( $wire_post->user_id );
    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 ) {
    1919                if ( 'no' == get_usermeta( $user->user_id, 'notification_groups_wire_post' ) ) continue;
     
    5656        global $bp;
    5757       
    5858        $group = new BP_Groups_Group( $group_id, false, true );
    59         $subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . __( 'Group Details Updated', 'buddypress' );
     59        $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . __( 'Group Details Updated', 'buddypress' );
    6060
    6161        foreach ( $group->user_dataset as $user ) {
    6262                if ( 'no' == get_usermeta( $user->user_id, 'notification_groups_group_updated' ) ) continue;
     
    106106
    107107        // Set up and send the message
    108108        $to = $ud->user_email;
    109         $subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( 'Membership request for group: %s', 'buddypress' ), stripslashes($group->name) );
     109        $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'Membership request for group: %s', 'buddypress' ), stripslashes($group->name) );
    110110
    111111$message = sprintf( __(
    112112'%s wants to join the group "%s".
     
    150150        $to = $ud->user_email;
    151151       
    152152        if ( $accepted ) {
    153                 $subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( 'Membership request for group "%s" accepted', 'buddypress' ), stripslashes($group->name) );
     153                $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'Membership request for group "%s" accepted', 'buddypress' ), stripslashes($group->name) );
    154154                $message = sprintf( __(
    155155'Your membership request for the group "%s" has been accepted.
    156156
     
    160160', 'buddypress' ), stripslashes($group->name), $group_link );
    161161               
    162162        } else {
    163                 $subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( 'Membership request for group "%s" rejected', 'buddypress' ), stripslashes($group->name) );
     163                $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'Membership request for group "%s" rejected', 'buddypress' ), stripslashes($group->name) );
    164164                $message = sprintf( __(
    165165'Your membership request for the group "%s" has been rejected.
    166166
     
    202202        // Set up and send the message
    203203        $to = $ud->user_email;
    204204
    205         $subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( 'You have been promoted in the group: "%s"', 'buddypress' ), stripslashes($group->name) );
     205        $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'You have been promoted in the group: "%s"', 'buddypress' ), stripslashes($group->name) );
    206206
    207207        $message = sprintf( __(
    208208'You have been promoted to %s for the group: "%s".
     
    245245                // Set up and send the message
    246246                $to = $invited_ud->user_email;
    247247
    248                 $subject = '[' . get_blog_option( 1, 'blogname' ) . '] ' . sprintf( __( 'You have an invitation to the group: "%s"', 'buddypress' ), stripslashes($group->name) );
     248                $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'You have an invitation to the group: "%s"', 'buddypress' ), stripslashes($group->name) );
    249249
    250250                $message = sprintf( __(
    251251'One of your friends %s has invited you to the group: "%s".
  • bp-messages/bp-messages-notifications.php

     
    1717               
    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( __(
    2323'%s sent you a new message:
     
    6464// To view the notice: %s
    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 );
    7070//
  • bp-xprofile/bp-xprofile-notifications.php

     
    3434                       
    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( __(
    4040'%s posted on your wire: