Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/07/2009 08:42:59 PM (15 years ago)
Author:
apeatling
Message:

Fixes #974 props djpaul

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups/bp-groups-notifications.php

    r1715 r1815  
    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;
    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 ) ) );
    1716
    1817    foreach ( $group->user_dataset as $user ) {
     
    2423        $to = $ud->user_email;
    2524
    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/';
    2928
    3029        $message = sprintf( __(
     
    4039
    4140---------------------
    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 );
    4342
    4443        $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
     
    6564        $to = $ud->user_email;
    6665
    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/';
    6968
    7069        $message = sprintf( __(
     
    7473
    7574---------------------
    76 ', 'buddypress' ), stripslashes($group->name), $group_link );
     75', 'buddypress' ), stripslashes( attribute_escape( $group->name ) ), $group_link );
    7776
    7877        $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
     
    10099
    101100    $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/';
    104103
    105104    // Set up and send the message
    106105    $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 ) ) );
    108107
    109108$message = sprintf( __(
     
    118117
    119118---------------------
    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 );
    121120
    122121    $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
     
    143142
    144143    $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/';
    146145
    147146    // Set up and send the message
     
    149148   
    150149    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 ) ) );
    152151        $message = sprintf( __(
    153152'Your membership request for the group "%s" has been accepted.
     
    156155
    157156---------------------
    158 ', 'buddypress' ), stripslashes($group->name), $group_link );
     157', 'buddypress' ), stripslashes( attribute_escape( $group->name ) ), $group_link );
    159158       
    160159    } 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 ) ) );
    162161        $message = sprintf( __(
    163162'Your membership request for the group "%s" has been rejected.
     
    166165
    167166---------------------
    168 ', 'buddypress' ), stripslashes($group->name), $group_link );
     167', 'buddypress' ), stripslashes( attribute_escape( $group->name ) ), $group_link );
    169168    }
    170169   
     
    196195
    197196    $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/';
    199198
    200199    // Set up and send the message
    201200    $to = $ud->user_email;
    202201
    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 ) ) );
    204203
    205204    $message = sprintf( __(
     
    209208
    210209---------------------
    211 ', 'buddypress' ), $promoted_to, stripslashes($group->name), $group_link );
     210', 'buddypress' ), $promoted_to, stripslashes( attribute_escape( $group->name ) ), $group_link );
    212211
    213212    $message .= sprintf( __( 'To disable these notifications please log in and go to: %s', 'buddypress' ), $settings_link );
     
    221220    global $bp;
    222221   
    223     $inviter_ud = get_userdata($inviter_user_id);
     222    $inviter_ud = get_userdata( $inviter_user_id );
    224223    $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 );
    226225   
    227226    $group_link = bp_get_group_permalink( $group );
     
    237236
    238237        $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 );
    241241        $invites_link = $invited_link . '/' . $bp->groups->slug . '/invites';
    242242
     
    244244        $to = $invited_ud->user_email;
    245245
    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 ) ) );
    247247
    248248        $message = sprintf( __(
     
    256256
    257257---------------------
    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 );
    259259
    260260        $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.