Changeset 1815 for trunk/bp-groups/bp-groups-notifications.php
- Timestamp:
- 09/07/2009 08:42:59 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 );
Note: See TracChangeset
for help on using the changeset viewer.