Changeset 1815
- Timestamp:
- 09/07/2009 08:42:59 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core.php
r1809 r1815 846 846 $ud = get_userdata( $user['users'][0]->user_id ); 847 847 848 if ( !defined( 'BP_ENABLE_ROOT_PROFILES' ) ) 849 bp_core_redirect( $bp->root_domain . '/' . BP_MEMBERS_SLUG . '/' . $ud->user_login ); 850 else 851 bp_core_redirect( $bp->root_domain . '/' . $ud->user_login ); 848 bp_core_redirect( bp_core_get_user_domain( $user['users'][0]->user_id ) ); 852 849 } 853 850 } … … 915 912 if ( !is_numeric($uid) ) 916 913 return false; 917 918 $ud = get_userdata($uid); 919 920 if ( !defined( 'BP_ENABLE_ROOT_PROFILES' ) ) 921 return apply_filters( 'bp_core_get_userurl', $bp->root_domain . '/' . BP_MEMBERS_SLUG . '/' . $ud->user_login . '/' ); 922 else 923 return apply_filters( 'bp_core_get_userurl', $bp->root_domain . '/' . $ud->user_login . '/' ); 914 915 return apply_filters( 'bp_core_get_userurl', bp_core_get_user_domain( $uid ) ); 924 916 } 925 917 -
trunk/bp-friends/bp-friends-notifications.php
r1715 r1815 12 12 $initiator_ud = get_userdata( $initiator_id ); 13 13 14 $all_requests_link = site_url( BP_MEMBERS_SLUG . '/' . $ud->user_login . '/friends/requests/' );15 $settings_link = site_url( BP_MEMBERS_SLUG . '/' . $ud->user_login . '/settings/notifications' );14 $all_requests_link = bp_core_get_user_domain( $friend_id ) . 'friends/requests/'; 15 $settings_link = bp_core_get_user_domain( $friend_id ) . 'settings/notifications'; 16 16 17 $initiator_link = site_url( BP_MEMBERS_SLUG . '/' . $initiator_ud->user_login . '/profile');17 $initiator_link = bp_core_get_user_domain( $initiator_id ); 18 18 19 19 // Set up and send the message … … 49 49 50 50 $ud = get_userdata( $initiator_id ); 51 $friend_ud = get_userdata( $friend_id );52 51 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';52 $friend_link = bp_core_get_user_domain( $friend_id ); 53 $settings_link = bp_core_get_user_domain( $initiator_id ) . 'settings/notifications'; 55 54 56 55 // Set up and send the message -
trunk/bp-groups/bp-groups-notifications.php
r1715 r1815 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; 15 16 $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'New wire post on group: %s', 'buddypress' ), stripslashes($group->name) ); 13 $poster_profile_link = bp_core_get_user_domain( $wire_post->user_id ); 14 15 $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'New wire post on group: %s', 'buddypress' ), stripslashes( attribute_escape( $group->name ) ) ); 17 16 18 17 foreach ( $group->user_dataset as $user ) { … … 24 23 $to = $ud->user_email; 25 24 26 $wire_link = site_url( ) . '/' . $bp->groups->slug . '/' . $group->slug . '/wire';27 $group_link = site_url( ) . '/' . $bp->groups->slug . '/' . $group->slug;28 $settings_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $ud->user_login . '/settings/notifications';25 $wire_link = site_url( $bp->groups->slug . '/' . $group->slug . '/wire/' ); 26 $group_link = site_url( $bp->groups->slug . '/' . $group->slug . '/' ); 27 $settings_link = bp_core_get_user_domain( $user->user_id ) . 'settings/notifications/'; 29 28 30 29 $message = sprintf( __( … … 40 39 41 40 --------------------- 42 ', 'buddypress' ), $poster_name, stripslashes( $group->name), stripslashes($wire_post->content), $wire_link, $group_link, $poster_name, $poster_profile_link );41 ', 'buddypress' ), $poster_name, stripslashes( attribute_escape( $group->name ) ), stripslashes($wire_post->content), $wire_link, $group_link, $poster_name, $poster_profile_link ); 43 42 44 43 $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); … … 65 64 $to = $ud->user_email; 66 65 67 $group_link = site_url( ) . '/' . $bp->groups->slug . '/' . $group->slug;68 $settings_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $ud->user_login . '/settings/notifications';66 $group_link = site_url( $bp->groups->slug . '/' . $group->slug ); 67 $settings_link = bp_core_get_user_domain( $user->user_id ) . 'settings/notifications/'; 69 68 70 69 $message = sprintf( __( … … 74 73 75 74 --------------------- 76 ', 'buddypress' ), stripslashes( $group->name), $group_link );75 ', 'buddypress' ), stripslashes( attribute_escape( $group->name ) ), $group_link ); 77 76 78 77 $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); … … 100 99 101 100 $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';101 $profile_link = bp_core_get_user_domain( $requesting_user_id ); 102 $settings_link = bp_core_get_user_domain( $requesting_user_id ) . 'settings/notifications/'; 104 103 105 104 // Set up and send the message 106 105 $to = $ud->user_email; 107 $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'Membership request for group: %s', 'buddypress' ), stripslashes( $group->name) );106 $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'Membership request for group: %s', 'buddypress' ), stripslashes( attribute_escape( $group->name ) ) ); 108 107 109 108 $message = sprintf( __( … … 118 117 119 118 --------------------- 120 ', 'buddypress' ), $requesting_user_name, stripslashes( $group->name), $group_requests, $requesting_user_name, $profile_link );119 ', 'buddypress' ), $requesting_user_name, stripslashes( attribute_escape( $group->name ) ), $group_requests, $requesting_user_name, $profile_link ); 121 120 122 121 $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); … … 143 142 144 143 $group_link = bp_get_group_permalink( $group ); 145 $settings_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $ud->user_login . '/settings/notifications';144 $settings_link = bp_core_get_user_domain( $requesting_user_id ) . 'settings/notifications/'; 146 145 147 146 // Set up and send the message … … 149 148 150 149 if ( $accepted ) { 151 $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'Membership request for group "%s" accepted', 'buddypress' ), stripslashes( $group->name) );150 $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'Membership request for group "%s" accepted', 'buddypress' ), stripslashes( attribute_escape( $group->name ) ) ); 152 151 $message = sprintf( __( 153 152 'Your membership request for the group "%s" has been accepted. … … 156 155 157 156 --------------------- 158 ', 'buddypress' ), stripslashes( $group->name), $group_link );157 ', 'buddypress' ), stripslashes( attribute_escape( $group->name ) ), $group_link ); 159 158 160 159 } else { 161 $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'Membership request for group "%s" rejected', 'buddypress' ), stripslashes( $group->name) );160 $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'Membership request for group "%s" rejected', 'buddypress' ), stripslashes( attribute_escape( $group->name ) ) ); 162 161 $message = sprintf( __( 163 162 'Your membership request for the group "%s" has been rejected. … … 166 165 167 166 --------------------- 168 ', 'buddypress' ), stripslashes( $group->name), $group_link );167 ', 'buddypress' ), stripslashes( attribute_escape( $group->name ) ), $group_link ); 169 168 } 170 169 … … 196 195 197 196 $group_link = bp_get_group_permalink( $group ); 198 $settings_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $ud->user_login . '/settings/notifications';197 $settings_link = bp_core_get_user_domain( $user_id ) . 'settings/notifications/'; 199 198 200 199 // Set up and send the message 201 200 $to = $ud->user_email; 202 201 203 $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'You have been promoted in the group: "%s"', 'buddypress' ), stripslashes( $group->name) );202 $subject = '[' . get_blog_option( BP_ROOT_BLOG, 'blogname' ) . '] ' . sprintf( __( 'You have been promoted in the group: "%s"', 'buddypress' ), stripslashes( attribute_escape( $group->name ) ) ); 204 203 205 204 $message = sprintf( __( … … 209 208 210 209 --------------------- 211 ', 'buddypress' ), $promoted_to, stripslashes( $group->name), $group_link );210 ', 'buddypress' ), $promoted_to, stripslashes( attribute_escape( $group->name ) ), $group_link ); 212 211 213 212 $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); … … 221 220 global $bp; 222 221 223 $inviter_ud = get_userdata( $inviter_user_id);222 $inviter_ud = get_userdata( $inviter_user_id ); 224 223 $inviter_name = bp_core_get_userlink( $inviter_user_id, true, false, true ); 225 $inviter_link = site_url() . '/' . BP_MEMBERS_SLUG . '/' . $inviter_ud->user_login;224 $inviter_link = bp_core_get_user_domain( $inviter_user_id ); 226 225 227 226 $group_link = bp_get_group_permalink( $group ); … … 237 236 238 237 $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; 238 239 $settings_link = bp_core_get_user_domain( $invited_user_id ) . 'settings/notifications/'; 240 $invited_link = bp_core_get_user_domain( $invited_user_id ); 241 241 $invites_link = $invited_link . '/' . $bp->groups->slug . '/invites'; 242 242 … … 244 244 $to = $invited_ud->user_email; 245 245 246 $subject = '[' . get_blog_option( BP_ROOT_BLOG, '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( attribute_escape( $group->name ) ) ); 247 247 248 248 $message = sprintf( __( … … 256 256 257 257 --------------------- 258 ', 'buddypress' ), $inviter_name, stripslashes( $group->name), $invites_link, $group_link, $inviter_name, $inviter_link );258 ', 'buddypress' ), $inviter_name, stripslashes( attribute_escape( $group->name ) ), $invites_link, $group_link, $inviter_name, $inviter_link ); 259 259 260 260 $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); -
trunk/bp-messages/bp-messages-notifications.php
r1715 r1815 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( __( … … 40 40 41 41 42 /* This is too expensive to send on normal servers uncomment at your own risk. */ 42 /* This is too expensive to send on normal servers uncomment action at your own risk. */ 43 function messages_notification_new_notice( $message_subject, $message ) { 44 global $bp, $wpdb; 43 45 44 // function messages_notification_new_notice( $message_subject, $message ) { 45 // global $bp, $wpdb; 46 // 47 // $users = $wpdb->get_results( $wpdb->prepare( "SELECT ID as user_id, user_email, user_login FROM {$wpdb->base_prefix}users WHERE user_status = 0 AND spam = 0 AND deleted = 0" ) ); 48 // 49 // for ( $i = 0; $i < count($users); $i++ ) { 50 // if ( get_userdata( $users[$i]->user_id, 'notification-messages-new-notice' ) == 'no' ) continue; 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'; 54 // 55 // // Set up and send the message 56 // $to = $users[$i]->user_email; 57 // $subject = __( 'New Site Notice', 'buddypress' ); 58 // 59 // $message = sprintf( __( 60 // 'A new site notice has been posted on %s: 61 // 62 // "%s: %s" 63 // 64 // To view the notice: %s 65 // 66 // --------------------- 67 // ', 'buddypress' ), get_blog_option( BP_ROOT_BLOG, 'blogname' ), stripslashes( strip_tags( $message_subject ) ), stripslashes( strip_tags( $message ) ), $message_link ); 68 // 69 // $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); 70 // 71 // // Send it 72 // wp_mail( $to, $subject, $message ); 73 // 74 // unset($message); 75 // unset($subject); 76 // unset($to); 77 // } 78 // } 46 $users = $wpdb->get_results( $wpdb->prepare( "SELECT ID as user_id, user_email, user_login FROM {$wpdb->base_prefix}users WHERE user_status = 0 AND spam = 0 AND deleted = 0" ) ); 47 48 for ( $i = 0; $i < count($users); $i++ ) { 49 if ( get_userdata( $users[$i]->user_id, 'notification-messages-new-notice' ) == 'no' ) continue; 50 51 $message_link = bp_core_get_user_domain( $users[$i]->user_id ) . 'messages'; 52 $settings_link = bp_core_get_user_domain( $users[$i]->user_id ) . 'settings/notifications'; 53 54 // Set up and send the message 55 $to = $users[$i]->user_email; 56 $subject = __( 'New Site Notice', 'buddypress' ); 57 58 $message = sprintf( __( 59 'A new site notice has been posted on %s: 60 61 "%s: %s" 62 63 To view the notice: %s 64 65 --------------------- 66 ', 'buddypress' ), get_blog_option( BP_ROOT_BLOG, 'blogname' ), stripslashes( wp_filter_kses( $message_subject ) ), stripslashes( wp_filter_kses( $message ) ), $message_link ); 67 68 $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link ); 69 70 // Send it 71 wp_mail( $to, $subject, $message ); 72 73 unset($message); 74 unset($subject); 75 unset($to); 76 } 77 } 79 78 // add_action( 'bp_messages_notice_sent', 'messages_notification_new_notice', 10, 2 ); 80 79 -
trunk/bp-xprofile/bp-xprofile-notifications.php
r1727 r1815 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
Note: See TracChangeset
for help on using the changeset viewer.