Skip to:
Content

BuddyPress.org

Changeset 3620


Ignore:
Timestamp:
12/30/2010 08:30:39 PM (14 years ago)
Author:
boonebgorges
Message:

Allows super admins to edit user settings. Fixes #965. Props johnjamesjacoby and sorich87 for initial patches.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity.php

    r3592 r3620  
    203203
    204204function bp_activity_screen_notification_settings() {
    205     global $bp; ?>
     205    global $bp;
     206   
     207    ?>
     208   
    206209    <table class="notification-settings zebra" id="activity-notification-settings">
    207210        <thead>
     
    217220            <tr id="activity-notification-settings-mentions">
    218221                <td></td>
    219                 <td><?php printf( __( 'A member mentions you in an update using "@%s"', 'buddypress' ), bp_core_get_username( $bp->loggedin_user->id, $bp->loggedin_user->userdata->user_nicename, $bp->loggedin_user->userdata->user_login ) ) ?></td>
    220                 <td class="yes"><input type="radio" name="notifications[notification_activity_new_mention]" value="yes" <?php if ( !get_user_meta( $bp->loggedin_user->id, 'notification_activity_new_mention', true ) || 'yes' == get_user_meta( $bp->loggedin_user->id, 'notification_activity_new_mention', true ) ) { ?>checked="checked" <?php } ?>/></td>
    221                 <td class="no"><input type="radio" name="notifications[notification_activity_new_mention]" value="no" <?php if ( 'no' == get_user_meta( $bp->loggedin_user->id, 'notification_activity_new_mention', true ) ) { ?>checked="checked" <?php } ?>/></td>
     222                <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>
    222225            </tr>
    223226            <tr id="activity-notification-settings-replies">
    224227                <td></td>
    225228                <td><?php _e( "A member replies to an update or comment you've posted", 'buddypress' ) ?></td>
    226                 <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->loggedin_user->id, 'notification_activity_new_reply', true ) ) { ?>checked="checked" <?php } ?>/></td>
    227                 <td class="no"><input type="radio" name="notifications[notification_activity_new_reply]" value="no" <?php if ( 'no' == get_user_meta( $bp->loggedin_user->id, 'notification_activity_new_reply', true ) ) { ?>checked="checked" <?php } ?>/></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>
    228231            </tr>
    229232
  • trunk/bp-core/bp-core-settings.php

    r3592 r3620  
    1515
    1616    /* Add the settings navigation item */
    17     bp_core_new_nav_item( array( 'name' => __('Settings', 'buddypress'), 'slug' => $bp->settings->slug, 'position' => 100, 'show_for_displayed_user' => false, 'screen_function' => 'bp_core_screen_general_settings', 'default_subnav_slug' => 'general' ) );
    18 
    19     $settings_link = $bp->loggedin_user->domain . $bp->settings->slug . '/';
    20 
    21     bp_core_new_subnav_item( array( 'name' => __( 'General', 'buddypress' ), 'slug' => 'general', 'parent_url' => $settings_link, 'parent_slug' => $bp->settings->slug, 'screen_function' => 'bp_core_screen_general_settings', 'position' => 10, 'user_has_access' => bp_is_my_profile() ) );
    22     bp_core_new_subnav_item( array( 'name' => __( 'Notifications', 'buddypress' ), 'slug' => 'notifications', 'parent_url' => $settings_link, 'parent_slug' => $bp->settings->slug, 'screen_function' => 'bp_core_screen_notification_settings', 'position' => 20, 'user_has_access' => bp_is_my_profile() ) );
     17    bp_core_new_nav_item( array( 'name' => __('Settings', 'buddypress'), 'slug' => $bp->settings->slug, 'position' => 100, 'show_for_displayed_user' => bp_core_can_edit_settings(), 'screen_function' => 'bp_core_screen_general_settings', 'default_subnav_slug' => 'general' ) );
     18
     19    $settings_link = $bp->displayed_user->domain . $bp->settings->slug . '/';
     20
     21    bp_core_new_subnav_item( array( 'name' => __( 'General', 'buddypress' ), 'slug' => 'general', 'parent_url' => $settings_link, 'parent_slug' => $bp->settings->slug, 'screen_function' => 'bp_core_screen_general_settings', 'position' => 10, 'user_has_access' => bp_core_can_edit_settings() ) );
     22    bp_core_new_subnav_item( array( 'name' => __( 'Notifications', 'buddypress' ), 'slug' => 'notifications', 'parent_url' => $settings_link, 'parent_slug' => $bp->settings->slug, 'screen_function' => 'bp_core_screen_notification_settings', 'position' => 20, 'user_has_access' => bp_core_can_edit_settings() ) );
    2323
    2424    if ( !is_super_admin() && empty( $bp->site_options['bp-disable-account-deletion'] ) )
     
    2929add_action( 'bp_setup_nav', 'bp_core_add_settings_nav' );
    3030
     31function bp_core_can_edit_settings() {
     32    if ( bp_is_my_profile() )
     33        return true;
     34   
     35    if ( is_super_admin() )
     36        return true;
     37   
     38    return false;
     39}
     40
    3141/**** GENERAL SETTINGS ****/
    3242
    3343function bp_core_screen_general_settings() {
    34     global $current_user, $bp_settings_updated, $pass_error, $email_error, $pwd_error;
     44    global $bp, $current_user, $bp_settings_updated, $pass_error, $email_error, $pwd_error;
    3545
    3646    $bp_settings_updated = false;
     
    4757
    4858        // Validate the user again for the current password when making a big change
    49         if ( !empty( $_POST['pwd'] ) && $_POST['pwd'] != '' && wp_check_password($_POST['pwd'], $current_user->user_pass, $current_user->ID) ) {
     59        if ( is_super_admin() || ( !empty( $_POST['pwd'] ) && $_POST['pwd'] != '' && wp_check_password($_POST['pwd'], $current_user->user_pass, $current_user->ID ) ) ) {
     60       
     61            $update_user = get_userdata( $bp->displayed_user->id );
    5062
    5163            // Make sure changing an email address does not already exist
     
    5365
    5466                // What is missing from the profile page vs signup - lets double check the goodies
    55                 $user_email = sanitize_email( wp_specialchars( trim( $_POST['email'] ) ) );
     67                $user_email = sanitize_email( esc_html( trim( $_POST['email'] ) ) );
    5668
    5769                if ( !is_email( $user_email ) )
     
    6577                    if ( in_array( $emaildomain, (array)$limited_email_domains ) == false ) {
    6678                        $email_error = true;
    67 
    6879                    }
    6980                }
    7081
    71                 if ( !$email_error && $current_user->user_email != $user_email  ) {
     82                if ( !$email_error && $bp->displayed_user->userdata->user_email != $user_email  ) {
    7283
    7384                    //we don't want email dups in the system
     
    7586                        $email_error = true;
    7687
    77                     if (!$email_error)
    78                         $current_user->user_email = $user_email;
     88                    if ( !$email_error )
     89                        $update_user->user_email = $user_email;
    7990                }
    8091            }
     
    8293            if ( $_POST['pass1'] != '' && $_POST['pass2'] != '' ) {
    8394
    84                 if ( $_POST['pass1'] == $_POST['pass2'] && !strpos( " " . $_POST['pass1'], "\\" ) )
    85                     $current_user->user_pass = $_POST['pass1'];
    86                 else
     95                if ( $_POST['pass1'] == $_POST['pass2'] && !strpos( " " . $_POST['pass1'], "\\" ) ) {
     96                    $update_user->user_pass = $_POST['pass1'];
     97                } else {
    8798                    $pass_error = true;
     99                }
    88100
    89101            } else if ( empty( $_POST['pass1'] ) && !empty( $_POST['pass2'] ) || !empty( $_POST['pass1'] ) && empty( $_POST['pass2'] ) ) {
    90102                $pass_error = true;
    91103            } else {
    92                 unset( $current_user->user_pass );
     104                unset( $update_user->user_pass );
    93105            }
    94106
    95             if ( !$email_error && !$pass_error && wp_update_user( get_object_vars( $current_user ) ) )
     107            if ( !$email_error && !$pass_error && wp_update_user( get_object_vars( $update_user ) ) ) {
     108                // Make sure these changes are in $bp for the current page load
     109                $bp->displayed_user->userdata = bp_core_get_core_userdata( $bp->displayed_user->id );
    96110                $bp_settings_updated = true;
     111            }
    97112
    98113        } else {
     
    114129
    115130function bp_core_screen_general_settings_content() {
    116     global $bp, $current_user, $bp_settings_updated, $pass_error, $pwd_error, $email_error; ?>
     131    global $bp, $bp_settings_updated, $pass_error, $pwd_error, $email_error; ?>
    117132
    118133    <?php if ( $bp_settings_updated && !$pass_error ) { ?>
     
    142157
    143158
    144     <form action="<?php echo $bp->loggedin_user->domain . BP_SETTINGS_SLUG . '/general' ?>" method="post" class="standard-form" id="settings-form">
    145 
    146         <label for="pwd"><?php _e( 'Current Password <span>(required to update email or change current password)</span>', 'buddypress' ) ?></label>
    147         <input type="password" name="pwd" id="pwd" size="16" value="" class="settings-input small" /> &nbsp;<a href="<?php echo site_url('wp-login.php?action=lostpassword', 'login') ?>" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a>
     159    <form action="<?php echo $bp->displayed_user->domain . BP_SETTINGS_SLUG . '/general' ?>" method="post" class="standard-form" id="settings-form">
     160
     161        <?php if ( empty( $bp->loggedin_user->is_super_admin ) ) : ?>
     162            <label for="pwd"><?php _e( 'Current Password <span>(required to update email or change current password)</span>', 'buddypress' ) ?></label>
     163            <input type="password" name="pwd" id="pwd" size="16" value="" class="settings-input small" /> &nbsp;<a href="<?php echo site_url('wp-login.php?action=lostpassword', 'login') ?>" title="<?php _e('Password Lost and Found') ?>"><?php _e('Lost your password?') ?></a>
     164        <?php endif ?>
    148165
    149166        <label for="email"><?php _e( 'Account Email', 'buddypress' ) ?></label>
    150         <input type="text" name="email" id="email" value="<?php echo esc_attr( $current_user->user_email ); ?>" class="settings-input" />
     167        <input type="text" name="email" id="email" value="<?php echo esc_attr( $bp->displayed_user->userdata->user_email ); ?>" class="settings-input" />
    151168
    152169        <label for="pass1"><?php _e( 'Change Password <span>(leave blank for no change)</span>', 'buddypress' ) ?></label>
     
    170187
    171188function bp_core_screen_notification_settings() {
    172     global $current_user, $bp_settings_updated;
     189    global $bp, $bp_settings_updated;
    173190
    174191    $bp_settings_updated = false;
     
    179196        if ( isset( $_POST['notifications'] ) ) {
    180197            foreach ( (array)$_POST['notifications'] as $key => $value ) {
    181                 update_user_meta( (int)$current_user->id, $key, $value );
     198                update_user_meta( (int)$bp->displayed_user->id, $key, $value );
    182199            }
    183200        }
     
    199216
    200217function bp_core_screen_notification_settings_content() {
    201     global $bp, $current_user, $bp_settings_updated; ?>
     218    global $bp, $bp_settings_updated; ?>
    202219
    203220    <?php if ( $bp_settings_updated ) { ?>
     
    207224    <?php } ?>
    208225
    209     <form action="<?php echo $bp->loggedin_user->domain . BP_SETTINGS_SLUG . '/notifications' ?>" method="post" id="settings-form">
     226    <form action="<?php echo $bp->displayed_user->domain . BP_SETTINGS_SLUG . '/notifications' ?>" method="post" id="settings-form">
    210227        <p><?php _e( 'Send a notification by email when:', 'buddypress' ) ?></p>
    211228
     
    227244
    228245function bp_core_screen_delete_account() {
     246    global $bp;
     247   
    229248    if ( isset( $_POST['delete-account-understand'] ) ) {
    230249        check_admin_referer( 'delete-account' );
    231250
    232251        // delete the users account
    233         if ( bp_core_delete_account() )
     252        if ( bp_core_delete_account( $bp->displayed_user->id ) )
    234253            bp_core_redirect( site_url() );
    235254    }
     
    246265
    247266function bp_core_screen_delete_account_content() {
    248     global $bp, $current_user, $bp_settings_updated, $pass_error;   ?>
    249 
    250     <form action="<?php echo $bp->loggedin_user->domain .  BP_SETTINGS_SLUG . '/delete-account'; ?>" name="account-delete-form" id="account-delete-form" class="standard-form" method="post">
     267    global $bp, $bp_settings_updated, $pass_error;  ?>
     268
     269    <form action="<?php echo $bp->displayed_user->domain .  BP_SETTINGS_SLUG . '/delete-account'; ?>" name="account-delete-form" id="account-delete-form" class="standard-form" method="post">
    251270
    252271        <div id="message" class="info">
  • trunk/bp-friends.php

    r3592 r3620  
    108108
    109109function friends_screen_notification_settings() {
    110     global $current_user; ?>
     110    global $bp;
     111   
     112    ?>
     113   
    111114    <table class="notification-settings zebra" id="friends-notification-settings">
    112115        <thead>
     
    123126                <td></td>
    124127                <td><?php _e( 'A member sends you a friendship request', 'buddypress' ) ?></td>
    125                 <td class="yes"><input type="radio" name="notifications[notification_friends_friendship_request]" value="yes" <?php if ( !get_user_meta( $current_user->id, 'notification_friends_friendship_request', true ) || 'yes' == get_user_meta( $current_user->id, 'notification_friends_friendship_request', true ) ) { ?>checked="checked" <?php } ?>/></td>
    126                 <td class="no"><input type="radio" name="notifications[notification_friends_friendship_request]" value="no" <?php if ( get_user_meta( $current_user->id, 'notification_friends_friendship_request', true ) == 'no' ) { ?>checked="checked" <?php } ?>/></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>
    127130            </tr>
    128131            <tr id="friends-notification-settings-accepted">
    129132                <td></td>
    130133                <td><?php _e( 'A member accepts your friendship request', 'buddypress' ) ?></td>
    131                 <td class="yes"><input type="radio" name="notifications[notification_friends_friendship_accepted]" value="yes" <?php if ( !get_user_meta( $current_user->id, 'notification_friends_friendship_accepted', true ) || 'yes' == get_user_meta( $current_user->id, 'notification_friends_friendship_accepted', true ) ) { ?>checked="checked" <?php } ?>/></td>
    132                 <td class="no"><input type="radio" name="notifications[notification_friends_friendship_accepted]" value="no" <?php if ( 'no' == get_user_meta( $current_user->id, 'notification_friends_friendship_accepted', true ) ) { ?>checked="checked" <?php } ?>/></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>
    133136            </tr>
    134137
  • trunk/bp-groups.php

    r3592 r3620  
    939939
    940940function groups_screen_notification_settings() {
    941     global $current_user; ?>
     941    global $bp;
     942   
     943    ?>
     944   
    942945    <table class="notification-settings zebra" id="groups-notification-settings">
    943946        <thead>
     
    954957                <td></td>
    955958                <td><?php _e( 'A member invites you to join a group', 'buddypress' ) ?></td>
    956                 <td class="yes"><input type="radio" name="notifications[notification_groups_invite]" value="yes" <?php if ( !get_user_meta( $current_user->id, 'notification_groups_invite', true ) || 'yes' == get_user_meta( $current_user->id, 'notification_groups_invite', true ) ) { ?>checked="checked" <?php } ?>/></td>
    957                 <td class="no"><input type="radio" name="notifications[notification_groups_invite]" value="no" <?php if ( 'no' == get_user_meta( $current_user->id, 'notification_groups_invite', true ) ) { ?>checked="checked" <?php } ?>/></td>
     959                <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>
     960                <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>
    958961            </tr>
    959962            <tr id="groups-notification-settings-info-updated">
    960963                <td></td>
    961964                <td><?php _e( 'Group information is updated', 'buddypress' ) ?></td>
    962                 <td class="yes"><input type="radio" name="notifications[notification_groups_group_updated]" value="yes" <?php if ( !get_user_meta( $current_user->id, 'notification_groups_group_updated', true ) || 'yes' == get_user_meta( $current_user->id, 'notification_groups_group_updated', true ) ) { ?>checked="checked" <?php } ?>/></td>
    963                 <td class="no"><input type="radio" name="notifications[notification_groups_group_updated]" value="no" <?php if ( 'no' == get_user_meta( $current_user->id, 'notification_groups_group_updated', true ) ) { ?>checked="checked" <?php } ?>/></td>
     965                <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>
     966                <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>
    964967            </tr>
    965968            <tr id="groups-notification-settings-promoted">
    966969                <td></td>
    967970                <td><?php _e( 'You are promoted to a group administrator or moderator', 'buddypress' ) ?></td>
    968                 <td class="yes"><input type="radio" name="notifications[notification_groups_admin_promotion]" value="yes" <?php if ( !get_user_meta( $current_user->id, 'notification_groups_admin_promotion', true ) || 'yes' == get_user_meta( $current_user->id, 'notification_groups_admin_promotion', true ) ) { ?>checked="checked" <?php } ?>/></td>
    969                 <td class="no"><input type="radio" name="notifications[notification_groups_admin_promotion]" value="no" <?php if ( 'no' == get_user_meta( $current_user->id, 'notification_groups_admin_promotion', true ) ) { ?>checked="checked" <?php } ?>/></td>
     971                <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>
     972                <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>
    970973            </tr>
    971974            <tr id="groups-notification-settings-request">
    972975                <td></td>
    973976                <td><?php _e( 'A member requests to join a private group for which you are an admin', 'buddypress' ) ?></td>
    974                 <td class="yes"><input type="radio" name="notifications[notification_groups_membership_request]" value="yes" <?php if ( !get_user_meta( $current_user->id, 'notification_groups_membership_request', true ) || 'yes' == get_user_meta( $current_user->id, 'notification_groups_membership_request', true ) ) { ?>checked="checked" <?php } ?>/></td>
    975                 <td class="no"><input type="radio" name="notifications[notification_groups_membership_request]" value="no" <?php if ( 'no' == get_user_meta( $current_user->id, 'notification_groups_membership_request', true ) ) { ?>checked="checked" <?php } ?>/></td>
     977                <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>
     978                <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>
    976979            </tr>
    977980
  • trunk/bp-messages.php

    r3584 r3620  
    168168
    169169function messages_screen_notification_settings() {
    170     global $current_user; ?>
     170    global $bp;
     171   
     172    ?>
     173   
    171174    <table class="notification-settings zebra" id="messages-notification-settings">
    172175        <thead>
     
    183186                <td></td>
    184187                <td><?php _e( 'A member sends you a new message', 'buddypress' ) ?></td>
    185                 <td class="yes"><input type="radio" name="notifications[notification_messages_new_message]" value="yes" <?php if ( !get_user_meta( $current_user->id, 'notification_messages_new_message', true ) || 'yes' == get_user_meta( $current_user->id, 'notification_messages_new_message', true ) ) { ?>checked="checked" <?php } ?>/></td>
    186                 <td class="no"><input type="radio" name="notifications[notification_messages_new_message]" value="no" <?php if ( 'no' == get_user_meta( $current_user->id, 'notification_messages_new_message', true ) ) { ?>checked="checked" <?php } ?>/></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>
    187190            </tr>
    188191            <tr id="messages-notification-settings-new-site-notice">
    189192                <td></td>
    190193                <td><?php _e( 'A new site notice is posted', 'buddypress' ) ?></td>
    191                 <td class="yes"><input type="radio" name="notifications[notification_messages_new_notice]" value="yes" <?php if ( !get_user_meta( $current_user->id, 'notification_messages_new_notice', true ) || 'yes' == get_user_meta( $current_user->id, 'notification_messages_new_notice', true ) ) { ?>checked="checked" <?php } ?>/></td>
    192                 <td class="no"><input type="radio" name="notifications[notification_messages_new_notice]" value="no" <?php if ( 'no' == get_user_meta( $current_user->id, 'notification_messages_new_notice', true ) ) { ?>checked="checked" <?php } ?>/></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>
    193196            </tr>
    194197
Note: See TracChangeset for help on using the changeset viewer.