Skip to:
Content

BuddyPress.org

Ticket #974: patch_974.patch

File patch_974.patch, 10.2 KB (added by DJPaul, 16 years ago)
  • bp-xprofile/bp-xprofile-notifications.php

     
    2727                if ( !get_usermeta( $user_id, 'notification_profile_wire_post' ) || 'yes' == get_usermeta( $user_id, 'notification_profile_wire_post' ) ) {
    2828                        $poster_name = bp_core_get_user_displayname( $poster_id );
    2929                        $wire_post = new BP_Wire_Post( $bp->profile->table_name_wire, $wire_post_id, true );
    30                         $ud = get_userdata($user_id);
     30                        $ud = get_userdata( $user_id );
    3131                       
    32                         $wire_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $ud->user_login . '/wire';
    33                         $settings_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $ud->user_login . '/settings/notifications';
     32                        $wire_link = bp_core_get_user_domain( $user_id ) . 'wire';
     33                        $settings_link = bp_core_get_user_domain( $user_id ) . 'settings/notifications';
    3434                       
    3535                        // Set up and send the message
    3636                        $to = $ud->user_email;
  • bp-friends/bp-friends-notifications.php

     
    4848                return false;
    4949       
    5050        $ud = get_userdata( $initiator_id );
    51         $friend_ud = get_userdata( $friend_id );
    52        
    53         $friend_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $friend_ud->user_login;
    54         $settings_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $ud->user_login . '/settings/notifications';
     51        $friend_link = bp_core_get_user_domain( $friend_id );
     52        $settings_link = bp_core_get_user_domain( $initiator_id ) . 'settings/notifications';
    5553               
    5654        // Set up and send the message
    5755        $to = $ud->user_email;
  • bp-messages/bp-messages-notifications.php

     
    1111        for ( $i = 0; $i < count($recipient_ids); $i++ ) {
    1212                if ( $message->sender_id == $recipient_ids[$i] || 'no' == get_userdata( $recipient_ids[$i], 'notification-messages-new-message' ) ) continue;
    1313
    14                 $ud = get_userdata($recipient_ids[$i]);
    15                 $message_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $ud->user_login . '/messages/view/' . $message->id;
    16                 $settings_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $ud->user_login . '/settings/notifications';
     14                $ud = get_userdata( $recipient_ids[$i] );
     15                $message_link = bp_core_get_user_domain( $recipient_ids[$i] ) . 'messages/view/' . $message->id;
     16                $settings_link = bp_core_get_user_domain( $recipient_ids[$i] ) . 'settings/notifications';
    1717               
    1818                // Set up and send the message
    1919                $to = $ud->user_email;
    20                 $subject = '[' . get_blog_option( BP_ROOT_BLOG, '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:
     
    4949//      for ( $i = 0; $i < count($users); $i++ ) {
    5050//              if ( get_userdata( $users[$i]->user_id, 'notification-messages-new-notice' ) == 'no' ) continue;
    5151//
    52 //              $message_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $users[$i]->user_login . '/messages';
    53 //              $settings_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $users[$i]->user_login . '/settings/notifications';
     52//              $message_link = bp_core_get_user_domain( $users[$i]->user_id ) . 'messages';
     53//              $settings_link = bp_core_get_user_domain( $users[$i]->user_id ) . 'settings/notifications';
    5454//
    5555//              // Set up and send the message
    5656//              $to = $users[$i]->user_email;
  • bp-core.php

     
    724724       
    725725        if ( !$bp->current_component && isset( $_GET['random-member'] ) ) {
    726726                $user = BP_Core_User::get_random_users(1);
    727                
    728                 $ud = get_userdata( $user['users'][0]->user_id );
    729                
    730                 if ( !defined( 'BP_ENABLE_ROOT_PROFILES' ) )
    731                         bp_core_redirect( $bp->root_domain . '/' . BP_MEMBERS_SLUG . '/' . $ud->user_login );
    732                 else
    733                         bp_core_redirect( $bp->root_domain . '/' . $ud->user_login );                   
     727                bp_core_redirect( bp_core_get_user_domain( $user['users'][0]->user_id ) );
    734728        }
    735729}
    736730add_action( 'wp', 'bp_core_get_random_member' );
     
    794788function bp_core_get_userurl( $uid ) {
    795789        global $bp;
    796790       
    797         if ( !is_numeric($uid) )
     791        if ( !is_numeric( $uid ) )
    798792                return false;
    799        
    800         $ud = get_userdata($uid);
    801        
    802         if ( !defined( 'BP_ENABLE_ROOT_PROFILES' ) )   
    803                 return apply_filters( 'bp_core_get_userurl', $bp->root_domain . '/' . BP_MEMBERS_SLUG . '/' . $ud->user_login . '/' );
    804         else
    805                 return apply_filters( 'bp_core_get_userurl', $bp->root_domain . '/' . $ud->user_login . '/' ); 
     793
     794        return apply_filters( 'bp_core_get_userurl', bp_core_get_user_domain( $uid ) );
    806795}
    807796
    808797/**
  • bp-groups/bp-groups-notifications.php

     
    1010        $group = new BP_Groups_Group( $group_id, false, true );
    1111       
    1212        $poster_name = bp_core_get_user_displayname( $wire_post->user_id );
    13         $poster_ud = get_userdata( $wire_post->user_id );
    14         $poster_profile_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $poster_ud->user_login;
     13        $poster_profile_link = bp_core_get_user_domain( $wire_post->user_id );
    1514
    1615        $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'New wire post on group: %s', 'buddypress' ), stripslashes($group->name) );
    1716
     
    2524
    2625                $wire_link = site_url() . '/' . $bp->groups->slug . '/' . $group->slug . '/wire';
    2726                $group_link = site_url() . '/' . $bp->groups->slug . '/' . $group->slug;
    28                 $settings_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $ud->user_login . '/settings/notifications';
     27                $settings_link = bp_core_get_user_domain( $user->user_id ) . 'settings/notifications';
    2928
    3029                $message = sprintf( __(
    3130'%s posted on the wire of the group "%s":
     
    6564                $to = $ud->user_email;
    6665
    6766                $group_link = site_url() . '/' . $bp->groups->slug . '/' . $group->slug;
    68                 $settings_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $ud->user_login . '/settings/notifications';
     67                $settings_link = bp_core_get_user_domain( $user->user_id ) . 'settings/notifications';
    6968
    7069                $message = sprintf( __(
    7170'Group details for the group "%s" were updated:
     
    9493               
    9594        $requesting_user_name = bp_core_get_user_displayname( $requesting_user_id );
    9695        $group = new BP_Groups_Group( $group_id, false, false );
    97        
    9896        $ud = get_userdata($admin_id);
    99         $requesting_ud = get_userdata($requesting_user_id);
    10097
    10198        $group_requests = bp_get_group_permalink( $group ) . '/admin/membership-requests';
    102         $profile_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $requesting_ud->user_login . '/profile';
    103         $settings_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $ud->user_login . '/settings/notifications';
     99        $profile_link = bp_core_get_user_domain( $requesting_user_id ) . 'profile';
     100        $settings_link = bp_core_get_user_domain( $admin_id ) . 'settings/notifications';
    104101
    105102        // Set up and send the message
    106103        $to = $ud->user_email;
     
    138135                return false;
    139136               
    140137        $group = new BP_Groups_Group( $group_id, false, false );
    141        
    142         $ud = get_userdata($requesting_user_id);
     138        $ud = get_userdata( $requesting_user_id );
    143139
    144140        $group_link = bp_get_group_permalink( $group );
    145         $settings_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $ud->user_login . '/settings/notifications';
     141        $settings_link = bp_core_get_user_domain( $requesting_user_id ) . 'settings/notifications';
    146142
    147143        // Set up and send the message
    148144        $to = $ud->user_email;
     
    195191        $ud = get_userdata($user_id);
    196192
    197193        $group_link = bp_get_group_permalink( $group );
    198         $settings_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $ud->user_login . '/settings/notifications';
     194        $settings_link = bp_core_get_user_domain( $user_id ) . 'settings/notifications';
    199195
    200196        // Set up and send the message
    201197        $to = $ud->user_email;
     
    220216function groups_notification_group_invites( &$group, &$member, $inviter_user_id ) {
    221217        global $bp;
    222218       
    223         $inviter_ud = get_userdata($inviter_user_id);
    224219        $inviter_name = bp_core_get_userlink( $inviter_user_id, true, false, true );
    225         $inviter_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $inviter_ud->user_login;
     220        $inviter_link = bp_core_get_user_domain( $inviter_user_id );
    226221       
    227222        $group_link = bp_get_group_permalink( $group );
    228223       
     
    235230                if ( 'no' == get_usermeta( $invited_user_id, 'notification_groups_invite' ) )
    236231                        return false;
    237232
    238                 $invited_ud = get_userdata($invited_user_id);
    239                 $settings_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $invited_ud->user_login . '/settings/notifications';
    240                 $invited_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $invited_ud->user_login;
    241                 $invites_link = $invited_link . '/' . $bp->groups->slug . '/invites';
     233                $invited_ud = get_userdata( $invited_user_id );
     234                $settings_link = bp_core_get_user_domain( $invited_user_id ) . 'settings/notifications';
     235                $invited_link = bp_core_get_user_domain( $invited_user_id );
     236                $invites_link = $invited_link . $bp->groups->slug . '/invites';
    242237
    243238                // Set up and send the message
    244239                $to = $invited_ud->user_email;
    245240
    246                 $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'You have an invitation to the group: "%s"', 'buddypress' ), stripslashes($group->name) );
     241                $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'You have an invitation to the group: "%s"', 'buddypress' ), stripslashes( $group->name ) );
    247242
    248243                $message = sprintf( __(
    249244'One of your friends %s has invited you to the group: "%s".
     
    255250To view %s\'s profile visit: %s
    256251
    257252---------------------
    258 ', 'buddypress' ), $inviter_name, stripslashes($group->name), $invites_link, $group_link, $inviter_name, $inviter_link );
     253', 'buddypress' ), $inviter_name, stripslashes( $group->name ), $invites_link, $group_link, $inviter_name, $inviter_link );
    259254
    260255                $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
    261256