Skip to:
Content

BuddyPress.org

Ticket #5446: 5446.diff

File 5446.diff, 2.3 KB (added by imath, 10 years ago)
  • bp-groups/bp-groups-notifications.php

    diff --git bp-groups/bp-groups-notifications.php bp-groups/bp-groups-notifications.php
    index 50e27cd..12d7d81 100644
    function groups_notification_new_membership_request( $requesting_user_id, $admin 
    6161        if ( bp_is_active( 'notifications' ) ) {
    6262                bp_notifications_add_notification( array(
    6363                        'user_id'           => $admin_id,
    64                         'item_id'           => $requesting_user_id,
    65                         'secondary_item_id' => $group_id,
     64                        'item_id'           => $group_id,
     65                        'secondary_item_id' => $requesting_user_id,
    6666                        'component_name'    => buddypress()->groups->id,
    6767                        'component_action'  => 'new_membership_request'
    6868                ) );
    function groups_notification_new_membership_request( $requesting_user_id, $admin 
    7171        if ( 'no' == bp_get_user_meta( $admin_id, 'notification_groups_membership_request', true ) )
    7272                return false;
    7373
     74        // Username of the user requesting a membership: %1$s in mail
    7475        $requesting_user_name = bp_core_get_user_displayname( $requesting_user_id );
    7576        $group                = groups_get_group( array( 'group_id' => $group_id ) );
    7677
     78        // Group Administrator user's data
    7779        $ud             = bp_core_get_core_userdata( $admin_id );
    7880        $group_requests = bp_get_group_permalink( $group ) . 'admin/membership-requests';
     81
     82        // Link to the user's profile who's requesting a membership: %3$s in mail
    7983        $profile_link   = bp_core_get_user_domain( $requesting_user_id );
     84
    8085        $settings_slug  = function_exists( 'bp_get_settings_slug' ) ? bp_get_settings_slug() : 'settings';
    81         $settings_link  = bp_core_get_user_domain( $requesting_user_id ) . $settings_slug . '/notifications/';
     86        // Link to the group administrator email settings: %s in "disable notifications" part of the email
     87        $settings_link  = bp_core_get_user_domain( $admin_id ) . $settings_slug . '/notifications/';
    8288
    8389        // Set up and send the message
    8490        $to       = $ud->user_email;
    function groups_format_notifications( $action, $item_id, $secondary_item_id, $to 
    316322
    317323        switch ( $action ) {
    318324                case 'new_membership_request':
    319                         $group_id = $secondary_item_id;
    320                         $requesting_user_id = $item_id;
     325                        $group_id = $item_id;
     326                        $requesting_user_id = $secondary_item_id;
    321327
    322328                        $group = groups_get_group( array( 'group_id' => $group_id ) );
    323329                        $group_link = bp_get_group_permalink( $group );