Skip to:
Content

BuddyPress.org

Ticket #2987: 2987.diff

File 2987.diff, 14.3 KB (added by wpmuguru, 16 years ago)
  • trunk/bp-friends.php

     
    107107}
    108108
    109109function friends_screen_notification_settings() {
    110         global $bp;
    111        
     110        global $bp;
     111        $send_requests = get_user_meta( $bp->displayed_user->id, 'notification_friends_friendship_request', true );
     112        if( !$send_requests )
     113                $send_requests = 'yes';
     114        $accept_requests = get_user_meta( $bp->displayed_user->id, 'notification_friends_friendship_accepted', true );
     115        if( !$accept_requests )
     116                $accept_requests = 'yes';
    112117        ?>
    113        
     118
    114119        <table class="notification-settings zebra" id="friends-notification-settings">
    115120                <thead>
    116121                        <tr>
    … …  
    125130                        <tr id="friends-notification-settings-request">
    126131                                <td></td>
    127132                                <td><?php _e( 'A member sends you a friendship request', 'buddypress' ) ?></td>
    128                                 <td class="yes"><input type="radio" name="notifications[notification_friends_friendship_request]" value="yes" <?php if ( !get_user_meta( $bp->displayed_user->id, 'notification_friends_friendship_request', true ) || 'yes' == get_user_meta( $bp->displayed_user->id, 'notification_friends_friendship_request', true ) ) { ?>checked="checked" <?php } ?>/></td>
    129                                 <td class="no"><input type="radio" name="notifications[notification_friends_friendship_request]" value="no" <?php if ( get_user_meta( $bp->displayed_user->id, 'notification_friends_friendship_request', true ) == 'no' ) { ?>checked="checked" <?php } ?>/></td>
     133                                <td class="yes"><input type="radio" name="notifications[notification_friends_friendship_request]" value="yes" <?php checked( $send_requests, 'yes', true ); ?>/></td>
     134                                <td class="no"><input type="radio" name="notifications[notification_friends_friendship_request]" value="no" <?php checked( $send_requests, 'no', true ); ?>/></td>
    130135                        </tr>
    131136                        <tr id="friends-notification-settings-accepted">
    132137                                <td></td>
    133138                                <td><?php _e( 'A member accepts your friendship request', 'buddypress' ) ?></td>
    134                                 <td class="yes"><input type="radio" name="notifications[notification_friends_friendship_accepted]" value="yes" <?php if ( !get_user_meta( $bp->displayed_user->id, 'notification_friends_friendship_accepted', true ) || 'yes' == get_user_meta( $bp->displayed_user->id, 'notification_friends_friendship_accepted', true ) ) { ?>checked="checked" <?php } ?>/></td>
    135                                 <td class="no"><input type="radio" name="notifications[notification_friends_friendship_accepted]" value="no" <?php if ( 'no' == get_user_meta( $bp->displayed_user->id, 'notification_friends_friendship_accepted', true ) ) { ?>checked="checked" <?php } ?>/></td>
     139                                <td class="yes"><input type="radio" name="notifications[notification_friends_friendship_accepted]" value="yes" <?php checked( $accept_requests, 'yes', true ); ?>/></td>
     140                                <td class="no"><input type="radio" name="notifications[notification_friends_friendship_accepted]" value="no" <?php checked( $accept_requests, 'no', true ); ?>/></td>
    136141                        </tr>
    137142
    138143                        <?php do_action( 'friends_screen_notification_settings' ); ?>
  • trunk/bp-activity.php

     
    202202add_action( 'wp', 'bp_activity_screen_single_activity_permalink', 3 );
    203203
    204204function bp_activity_screen_notification_settings() {
    205         global $bp;
    206        
     205        global $bp;
     206        $mention = get_user_meta( $bp->displayed_user->id, 'notification_activity_new_mention', true );
     207        if( !$mention )
     208                $mention = 'yes';
     209        $reply = get_user_meta( $bp->displayed_user->id, 'notification_activity_new_reply', true );
     210        if( !$reply )
     211                $reply = 'yes';
    207212        ?>
    208        
     213
    209214        <table class="notification-settings zebra" id="activity-notification-settings">
    210215                <thead>
    211216                        <tr>
    … …  
    220225                        <tr id="activity-notification-settings-mentions">
    221226                                <td></td>
    222227                                <td><?php printf( __( 'A member mentions you in an update using "@%s"', 'buddypress' ), bp_core_get_username( $bp->displayed_user->id, $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) ) ?></td>
    223                                 <td class="yes"><input type="radio" name="notifications[notification_activity_new_mention]" value="yes" <?php if ( !get_user_meta( $bp->displayed_user->id, 'notification_activity_new_mention', true ) || 'yes' == get_user_meta( $bp->displayed_user->id, 'notification_activity_new_mention', true ) ) { ?>checked="checked" <?php } ?>/></td>
    224                                 <td class="no"><input type="radio" name="notifications[notification_activity_new_mention]" value="no" <?php if ( 'no' == get_user_meta( $bp->displayed_user->id, 'notification_activity_new_mention', true ) ) { ?>checked="checked" <?php } ?>/></td>
     228                                <td class="yes"><input type="radio" name="notifications[notification_activity_new_mention]" value="yes" <?php checked( $mention, 'yes', true ); ?>/></td>
     229                                <td class="no"><input type="radio" name="notifications[notification_activity_new_mention]" value="no" <?php checked( $mention, 'no', true ); ?>/></td>
    225230                        </tr>
    226231                        <tr id="activity-notification-settings-replies">
    227232                                <td></td>
    228233                                <td><?php _e( "A member replies to an update or comment you've posted", 'buddypress' ) ?></td>
    229                                 <td class="yes"><input type="radio" name="notifications[notification_activity_new_reply]" value="yes" <?php if ( !get_user_meta( $bp->loggedin_user->id, 'notification_activity_new_reply', true ) || 'yes' == get_user_meta( $bp->displayed_user->id, 'notification_activity_new_reply', true ) ) { ?>checked="checked" <?php } ?>/></td>
    230                                 <td class="no"><input type="radio" name="notifications[notification_activity_new_reply]" value="no" <?php if ( 'no' == get_user_meta( $bp->displayed_user->id, 'notification_activity_new_reply', true ) ) { ?>checked="checked" <?php } ?>/></td>
     234                                <td class="yes"><input type="radio" name="notifications[notification_activity_new_reply]" value="yes" <?php checked( $reply, 'yes', true ); ?>/></td>
     235                                <td class="no"><input type="radio" name="notifications[notification_activity_new_reply]" value="no" <?php checked( $reply, 'no', true ); ?>/></td>
    231236                        </tr>
    232237
    233238                        <?php do_action( 'bp_activity_screen_notification_settings' ) ?>
  • trunk/bp-messages.php

     
    167167}
    168168
    169169function messages_screen_notification_settings() {
    170         global $bp;
    171        
     170        global $bp;
     171        $new_messages = get_user_meta( $bp->displayed_user->id, 'notification_messages_new_message', true );
     172        if( !$new_messages )
     173                $new_messages = 'yes';
     174        $new_notices = get_user_meta( $bp->displayed_user->id, 'notification_messages_new_notice', true );
     175        if( !$new_notices )
     176                $new_notices = 'yes';
    172177        ?>
    173        
     178
    174179        <table class="notification-settings zebra" id="messages-notification-settings">
    175180                <thead>
    176181                        <tr>
    … …  
    185190                        <tr id="messages-notification-settings-new-message">
    186191                                <td></td>
    187192                                <td><?php _e( 'A member sends you a new message', 'buddypress' ) ?></td>
    188                                 <td class="yes"><input type="radio" name="notifications[notification_messages_new_message]" value="yes" <?php if ( !get_user_meta( $bp->displayed_user->id, 'notification_messages_new_message', true ) || 'yes' == get_user_meta( $bp->displayed_user->id, 'notification_messages_new_message', true ) ) { ?>checked="checked" <?php } ?>/></td>
    189                                 <td class="no"><input type="radio" name="notifications[notification_messages_new_message]" value="no" <?php if ( 'no' == get_user_meta( $bp->displayed_user->id, 'notification_messages_new_message', true ) ) { ?>checked="checked" <?php } ?>/></td>
     193                                <td class="yes"><input type="radio" name="notifications[notification_messages_new_message]" value="yes" <?php checked( $new_messages, 'yes', true ); ?>/></td>
     194                                <td class="no"><input type="radio" name="notifications[notification_messages_new_message]" value="no" <?php checked( $new_messages, 'no', true ); ?>/></td>
    190195                        </tr>
    191196                        <tr id="messages-notification-settings-new-site-notice">
    192197                                <td></td>
    193198                                <td><?php _e( 'A new site notice is posted', 'buddypress' ) ?></td>
    194                                 <td class="yes"><input type="radio" name="notifications[notification_messages_new_notice]" value="yes" <?php if ( !get_user_meta( $bp->displayed_user->id, 'notification_messages_new_notice', true ) || 'yes' == get_user_meta( $bp->displayed_user->id, 'notification_messages_new_notice', true ) ) { ?>checked="checked" <?php } ?>/></td>
    195                                 <td class="no"><input type="radio" name="notifications[notification_messages_new_notice]" value="no" <?php if ( 'no' == get_user_meta( $bp->displayed_user->id, 'notification_messages_new_notice', true ) ) { ?>checked="checked" <?php } ?>/></td>
     199                                <td class="yes"><input type="radio" name="notifications[notification_messages_new_notice]" value="yes" <?php checked( $new_notices, 'yes', true ); ?>/></td>
     200                                <td class="no"><input type="radio" name="notifications[notification_messages_new_notice]" value="no" <?php checked( $new_notices, 'no', true ); ?>/></td>
    196201                        </tr>
    197202
    198203                        <?php do_action( 'messages_screen_notification_settings' ) ?>
  • trunk/bp-groups.php

     
    947947add_action( 'wp', 'groups_screen_group_admin_delete_group', 4 );
    948948
    949949function groups_screen_notification_settings() {
    950         global $bp;
    951        
     950        global $bp;
     951        $group_invite = get_user_meta( $bp->displayed_user->id, 'notification_groups_invite', true );
     952        if( !$group_invite )
     953                $group_invite = 'yes';
     954        $group_update = get_user_meta( $bp->displayed_user->id, 'notification_groups_group_updated', true );
     955        if( !$group_update )
     956                $group_update = 'yes';
     957        $group_promo = get_user_meta( $bp->displayed_user->id, 'notification_groups_admin_promotion', true );
     958        if( !$group_promo )
     959                $group_promo = 'yes';
     960        $group_request = get_user_meta( $bp->displayed_user->id, 'notification_groups_membership_request', true );
     961        if( !$group_request )
     962                $group_request = 'yes';
    952963        ?>
    953        
     964
    954965        <table class="notification-settings zebra" id="groups-notification-settings">
    955966                <thead>
    956967                        <tr>
    … …  
    965976                        <tr id="groups-notification-settings-invitation">
    966977                                <td></td>
    967978                                <td><?php _e( 'A member invites you to join a group', 'buddypress' ) ?></td>
    968                                 <td class="yes"><input type="radio" name="notifications[notification_groups_invite]" value="yes" <?php if ( !get_user_meta( $bp->displayed_user->id, 'notification_groups_invite', true ) || 'yes' == get_user_meta( $bp->displayed_user->id, 'notification_groups_invite', true ) ) { ?>checked="checked" <?php } ?>/></td>
    969                                 <td class="no"><input type="radio" name="notifications[notification_groups_invite]" value="no" <?php if ( 'no' == get_user_meta( $bp->displayed_user->id, 'notification_groups_invite', true ) ) { ?>checked="checked" <?php } ?>/></td>
     979                                <td class="yes"><input type="radio" name="notifications[notification_groups_invite]" value="yes" <?php checked( $group_invite, 'yes', true ); ?>/></td>
     980                                <td class="no"><input type="radio" name="notifications[notification_groups_invite]" value="no" <?php checked( $group_invite, 'no', true ); ?>/></td>
    970981                        </tr>
    971982                        <tr id="groups-notification-settings-info-updated">
    972983                                <td></td>
    973984                                <td><?php _e( 'Group information is updated', 'buddypress' ) ?></td>
    974                                 <td class="yes"><input type="radio" name="notifications[notification_groups_group_updated]" value="yes" <?php if ( !get_user_meta( $bp->displayed_user->id, 'notification_groups_group_updated', true ) || 'yes' == get_user_meta( $bp->displayed_user->id, 'notification_groups_group_updated', true ) ) { ?>checked="checked" <?php } ?>/></td>
    975                                 <td class="no"><input type="radio" name="notifications[notification_groups_group_updated]" value="no" <?php if ( 'no' == get_user_meta( $bp->displayed_user->id, 'notification_groups_group_updated', true ) ) { ?>checked="checked" <?php } ?>/></td>
     985                                <td class="yes"><input type="radio" name="notifications[notification_groups_group_updated]" value="yes" <?php checked( $group_update, 'yes', true ); ?>/></td>
     986                                <td class="no"><input type="radio" name="notifications[notification_groups_group_updated]" value="no" <?php checked( $group_update, 'no', true ); ?>/></td>
    976987                        </tr>
    977988                        <tr id="groups-notification-settings-promoted">
    978989                                <td></td>
    979990                                <td><?php _e( 'You are promoted to a group administrator or moderator', 'buddypress' ) ?></td>
    980                                 <td class="yes"><input type="radio" name="notifications[notification_groups_admin_promotion]" value="yes" <?php if ( !get_user_meta( $bp->displayed_user->id, 'notification_groups_admin_promotion', true ) || 'yes' == get_user_meta( $bp->displayed_user->id, 'notification_groups_admin_promotion', true ) ) { ?>checked="checked" <?php } ?>/></td>
    981                                 <td class="no"><input type="radio" name="notifications[notification_groups_admin_promotion]" value="no" <?php if ( 'no' == get_user_meta( $bp->displayed_user->id, 'notification_groups_admin_promotion', true ) ) { ?>checked="checked" <?php } ?>/></td>
     991                                <td class="yes"><input type="radio" name="notifications[notification_groups_admin_promotion]" value="yes" <?php checked( $group_promo, 'yes', true ); ?>/></td>
     992                                <td class="no"><input type="radio" name="notifications[notification_groups_admin_promotion]" value="no" <?php checked( $group_promo, 'no', true ); ?>/></td>
    982993                        </tr>
    983994                        <tr id="groups-notification-settings-request">
    984995                                <td></td>
    985996                                <td><?php _e( 'A member requests to join a private group for which you are an admin', 'buddypress' ) ?></td>
    986                                 <td class="yes"><input type="radio" name="notifications[notification_groups_membership_request]" value="yes" <?php if ( !get_user_meta( $bp->displayed_user->id, 'notification_groups_membership_request', true ) || 'yes' == get_user_meta( $bp->displayed_user->id, 'notification_groups_membership_request', true ) ) { ?>checked="checked" <?php } ?>/></td>
    987                                 <td class="no"><input type="radio" name="notifications[notification_groups_membership_request]" value="no" <?php if ( 'no' == get_user_meta( $bp->displayed_user->id, 'notification_groups_membership_request', true ) ) { ?>checked="checked" <?php } ?>/></td>
     997                                <td class="yes"><input type="radio" name="notifications[notification_groups_membership_request]" value="yes" <?php checked( $group_request, 'yes', true ); ?>/></td>
     998                                <td class="no"><input type="radio" name="notifications[notification_groups_membership_request]" value="no" <?php checked( $group_request, 'no', true ); ?>/></td>
    988999                        </tr>
    9891000
    9901001                        <?php do_action( 'groups_screen_notification_settings' ); ?>