Ticket #974: patch_974.patch
File patch_974.patch, 10.2 KB (added by , 16 years ago) |
---|
-
bp-xprofile/bp-xprofile-notifications.php
27 27 if ( !get_usermeta( $user_id, 'notification_profile_wire_post' ) || 'yes' == get_usermeta( $user_id, 'notification_profile_wire_post' ) ) { 28 28 $poster_name = bp_core_get_user_displayname( $poster_id ); 29 29 $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 ); 31 31 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'; 34 34 35 35 // Set up and send the message 36 36 $to = $ud->user_email; -
bp-friends/bp-friends-notifications.php
48 48 return false; 49 49 50 50 $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'; 55 53 56 54 // Set up and send the message 57 55 $to = $ud->user_email; -
bp-messages/bp-messages-notifications.php
11 11 for ( $i = 0; $i < count($recipient_ids); $i++ ) { 12 12 if ( $message->sender_id == $recipient_ids[$i] || 'no' == get_userdata( $recipient_ids[$i], 'notification-messages-new-message' ) ) continue; 13 13 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'; 17 17 18 18 // Set up and send the message 19 19 $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 ) ); 21 21 22 22 $content = sprintf( __( 23 23 '%s sent you a new message: … … 49 49 // for ( $i = 0; $i < count($users); $i++ ) { 50 50 // if ( get_userdata( $users[$i]->user_id, 'notification-messages-new-notice' ) == 'no' ) continue; 51 51 // 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'; 54 54 // 55 55 // // Set up and send the message 56 56 // $to = $users[$i]->user_email; -
bp-core.php
724 724 725 725 if ( !$bp->current_component && isset( $_GET['random-member'] ) ) { 726 726 $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 ) ); 734 728 } 735 729 } 736 730 add_action( 'wp', 'bp_core_get_random_member' ); … … 794 788 function bp_core_get_userurl( $uid ) { 795 789 global $bp; 796 790 797 if ( !is_numeric( $uid) )791 if ( !is_numeric( $uid ) ) 798 792 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 ) ); 806 795 } 807 796 808 797 /** -
bp-groups/bp-groups-notifications.php
10 10 $group = new BP_Groups_Group( $group_id, false, true ); 11 11 12 12 $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 ); 15 14 16 15 $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'New wire post on group: %s', 'buddypress' ), stripslashes($group->name) ); 17 16 … … 25 24 26 25 $wire_link = site_url() . '/' . $bp->groups->slug . '/' . $group->slug . '/wire'; 27 26 $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'; 29 28 30 29 $message = sprintf( __( 31 30 '%s posted on the wire of the group "%s": … … 65 64 $to = $ud->user_email; 66 65 67 66 $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'; 69 68 70 69 $message = sprintf( __( 71 70 'Group details for the group "%s" were updated: … … 94 93 95 94 $requesting_user_name = bp_core_get_user_displayname( $requesting_user_id ); 96 95 $group = new BP_Groups_Group( $group_id, false, false ); 97 98 96 $ud = get_userdata($admin_id); 99 $requesting_ud = get_userdata($requesting_user_id);100 97 101 98 $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'; 104 101 105 102 // Set up and send the message 106 103 $to = $ud->user_email; … … 138 135 return false; 139 136 140 137 $group = new BP_Groups_Group( $group_id, false, false ); 141 142 $ud = get_userdata($requesting_user_id); 138 $ud = get_userdata( $requesting_user_id ); 143 139 144 140 $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'; 146 142 147 143 // Set up and send the message 148 144 $to = $ud->user_email; … … 195 191 $ud = get_userdata($user_id); 196 192 197 193 $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'; 199 195 200 196 // Set up and send the message 201 197 $to = $ud->user_email; … … 220 216 function groups_notification_group_invites( &$group, &$member, $inviter_user_id ) { 221 217 global $bp; 222 218 223 $inviter_ud = get_userdata($inviter_user_id);224 219 $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 ); 226 221 227 222 $group_link = bp_get_group_permalink( $group ); 228 223 … … 235 230 if ( 'no' == get_usermeta( $invited_user_id, 'notification_groups_invite' ) ) 236 231 return false; 237 232 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'; 242 237 243 238 // Set up and send the message 244 239 $to = $invited_ud->user_email; 245 240 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 ) ); 247 242 248 243 $message = sprintf( __( 249 244 'One of your friends %s has invited you to the group: "%s". … … 255 250 To view %s\'s profile visit: %s 256 251 257 252 --------------------- 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 ); 259 254 260 255 $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); 261 256