Skip to:
Content

BuddyPress.org

Changeset 3369


Ignore:
Timestamp:
11/07/2010 12:20:02 AM (16 years ago)
Author:
djpaul
Message:

Fixes even more WP_DEBUG warnings.

Location:
trunk
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity.php

    r3365 r3369  
    3333        bp_core_new_nav_item( array( 'name' => __( 'Activity', 'buddypress' ), 'slug' => $bp->activity->name, 'position' => 10, 'screen_function' => 'bp_activity_screen_my_activity', 'default_subnav_slug' => 'just-me', 'item_css_id' => $bp->activity->id ) );
    3434
    35         $user_domain = ( !empty( $bp->displayed_user->domain ) ) ? $bp->displayed_user->domain : $bp->loggedin_user->domain;
    36         $user_login = ( !empty( $bp->displayed_user->userdata->user_login ) ) ? $bp->displayed_user->userdata->user_login : $bp->loggedin_user->userdata->user_login;
     35        if ( !is_user_logged_in() && !isset( $bp->displayed_user->id ) )
     36                return;
     37
     38        $user_domain = ( isset( $bp->displayed_user->domain ) ) ? $bp->displayed_user->domain : $bp->loggedin_user->domain;
     39        $user_login = ( isset( $bp->displayed_user->userdata->user_login ) ) ? $bp->displayed_user->userdata->user_login : $bp->loggedin_user->userdata->user_login;
    3740        $activity_link = $user_domain . $bp->activity->name . '/';
    3841
     
    203206                        <tr>
    204207                                <td></td>
    205                                 <td><?php printf( __( "A member replies to an update or comment you've posted", 'buddypress' ), $current_user->user_login ) ?></td>
     208                                <td><?php _e( "A member replies to an update or comment you've posted", 'buddypress' ) ?></td>
    206209                                <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>
    207210                                <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>
     
    401404        global $bp, $wp_query;
    402405
    403         if ( $bp->current_component != $bp->activity->slug || $bp->current_action != 'feed' || $bp->displayed_user->id || $bp->groups->current_group )
     406        if ( $bp->current_component != $bp->activity->slug || $bp->current_action != 'feed' || ( isset( $bp->displayed_user->id ) && $bp->displayed_user->id ) || isset( $bp->groups->current_group ) )
    404407                return false;
    405408
     
    429432        global $bp, $wp_query;
    430433
    431         if ( $bp->current_component != $bp->activity->slug || !$bp->displayed_user->id || $bp->current_action != $bp->friends->slug || $bp->action_variables[0] != 'feed' )
     434        if ( $bp->current_component != $bp->activity->slug || !$bp->displayed_user->id || $bp->current_action != $bp->friends->slug || !isset( $bp->action_variables[0] ) || $bp->action_variables[0] != 'feed' )
    432435                return false;
    433436
     
    443446        global $bp, $wp_query;
    444447
    445         if ( $bp->current_component != $bp->activity->slug || !$bp->displayed_user->id || $bp->current_action != $bp->groups->slug || $bp->action_variables[0] != 'feed' )
     448        if ( $bp->current_component != $bp->activity->slug || !$bp->displayed_user->id || $bp->current_action != $bp->groups->slug || !isset( $bp->action_variables[0] ) || $bp->action_variables[0] != 'feed' )
    446449                return false;
    447450
     
    457460        global $bp, $wp_query;
    458461
    459         if ( $bp->current_component != $bp->activity->slug || !$bp->displayed_user->id || $bp->current_action != 'mentions' || $bp->action_variables[0] != 'feed' )
     462        if ( $bp->current_component != $bp->activity->slug || !$bp->displayed_user->id || $bp->current_action != 'mentions' || !isset( $bp->action_variables[0] ) || $bp->action_variables[0] != 'feed' )
    460463                return false;
    461464
     
    471474        global $bp, $wp_query;
    472475
    473         if ( $bp->current_component != $bp->activity->slug || !$bp->displayed_user->id || $bp->current_action != 'favorites' || $bp->action_variables[0] != 'feed' )
     476        if ( $bp->current_component != $bp->activity->slug || !$bp->displayed_user->id || $bp->current_action != 'favorites' || !isset( $bp->action_variables[0] ) || $bp->action_variables[0] != 'feed' )
    474477                return false;
    475478
  • trunk/bp-activity/bp-activity-classes.php

    r3365 r3369  
    1313        var $date_recorded;
    1414        var $hide_sitewide = false;
     15        var $mptt_left;
     16        var $mptt_right;
    1517
    1618        function bp_activity_activity( $id = false ) {
  • trunk/bp-activity/bp-activity-templatetags.php

    r3365 r3369  
    445445
    446446                // If this is a user object pass the users' email address for Gravatar so we don't have to refetch it.
    447                 if ( 'user' == $object && empty( $email ) )
     447                if ( 'user' == $object && empty( $email ) && isset( $activities_template->activity->user_email ) )
    448448                        $email = $activities_template->activity->user_email;
    449449
     
    656656                                return false;
    657657
    658                         $content .= '<ul>';
     658                        $content = '<ul>';
    659659                        foreach ( (array)$comment->children as $comment ) {
    660660                                if ( !$comment->user_fullname )
     
    999999                global $bp;
    10001000
     1001                $link = '';
     1002
    10011003                if ( $bp->current_component == $bp->profile->slug || 'just-me' == $bp->current_action )
    10021004                        $link = $bp->displayed_user->domain . $bp->activity->slug . '/feed/';
    1003                 else if ( $bp->friends->slug == $bp->current_action )
     1005                elseif ( $bp->friends->slug == $bp->current_action )
    10041006                        $link = $bp->displayed_user->domain . $bp->activity->slug . '/' . $bp->friends->slug . '/feed/';
    1005                 else if ( $bp->groups->slug == $bp->current_action )
     1007                elseif ( $bp->groups->slug == $bp->current_action )
    10061008                        $link = $bp->displayed_user->domain . $bp->activity->slug . '/' . $bp->groups->slug . '/feed/';
    1007                 else if ( 'favorites' == $bp->current_action )
     1009                elseif ( 'favorites' == $bp->current_action )
    10081010                        $link = $bp->displayed_user->domain . $bp->activity->slug . '/favorites/feed/';
    1009                 else if ( 'mentions' == $bp->current_action )
     1011                elseif ( 'mentions' == $bp->current_action )
    10101012                        $link = $bp->displayed_user->domain . $bp->activity->slug . '/mentions/feed/';
    10111013
  • trunk/bp-core/admin/bp-core-admin.php

    r3358 r3369  
    2323function bp_core_admin_settings() {
    2424        global $wpdb, $bp, $current_blog;
     25
     26        $ud = get_userdata( $bp->loggedin_user->id );
    2527?>
    2628
  • trunk/bp-core/bp-core-classes.php

    r3368 r3369  
    238238                global $wpdb, $bp;
    239239
     240                $pag_sql = '';
    240241                if ( $limit && $page )
    241242                        $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
     
    267268                 * We can't add these to the main query above since only users who have this information will be returned (since the much of the data is in usermeta and won't support any type of directional join)
    268269                 */
     270                $user_ids = array();
    269271                foreach ( (array)$paged_users as $user )
    270272                        $user_ids[] = $user->id;
  • trunk/bp-core/bp-core-filters.php

    r3362 r3369  
    127127                return $redirect_to;
    128128
    129         if ( !empty( $_REQUEST['redirect_to'] ) || strpos( $_REQUEST['redirect_to'], 'wp-admin' ) )
     129        if ( isset( $_REQUEST['redirect_to'] ) && ( !empty( $_REQUEST['redirect_to'] ) || strpos( $_REQUEST['redirect_to'], 'wp-admin' ) ) )
    130130                return $redirect_to;
    131131
  • trunk/bp-core/bp-core-settings.php

    r3352 r3369  
    115115        $bp_settings_updated = false;
    116116
    117         if ( $_POST['submit'] ) {
     117        if ( isset( $_POST['submit'] ) ) {
    118118                check_admin_referer('bp_settings_notifications');
    119119
    120                 if ( $_POST['notifications'] ) {
     120                if ( isset( $_POST['notifications'] ) ) {
    121121                        foreach ( (array)$_POST['notifications'] as $key => $value ) {
    122122                                update_user_meta( (int)$current_user->id, $key, $value );
  • trunk/bp-core/bp-core-signup.php

    r3365 r3369  
    1414        if ( $bp->current_component != BP_REGISTER_SLUG )
    1515                return false;
     16
     17        $bp->is_directory = false;
    1618
    1719        /* If the user is logged in, redirect away from here */
     
    287289
    288290        // Add our slugs to the array and allow them to be filtered
    289         $filtered_illegal_names = apply_filters( 'bp_core_illegal_usernames', array( 'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator', BP_GROUPS_SLUG, BP_MEMBERS_SLUG, BP_FORUMS_SLUG, BP_BLOGS_SLUG, BP_ACTIVITY_SLUG, BP_XPROFILE_SLUG, BP_FRIENDS_SLUG, BP_SEARCH_SLUG, BP_SETTINGS_SLUG, BP_REGISTER_SLUG, BP_ACTIVATION_SLUG ) );
     291        $filtered_illegal_names = array( 'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator' );
     292
     293        if ( bp_is_active( 'activity' ) )
     294                $filtered_illegal_names[] = BP_ACTIVITY_SLUG;
     295
     296        if ( is_multisite() && bp_is_active( 'blogs' ) )
     297                $filtered_illegal_names[] = BP_BLOGS_SLUG;
     298
     299        if ( bp_is_active( 'forums' ) )
     300                $filtered_illegal_names[] = BP_FORUMS_SLUG;
     301
     302        if ( bp_is_active( 'friends' ) )
     303                $filtered_illegal_names[] = BP_FRIENDS_SLUG;
     304
     305        if ( bp_is_active( 'groups' ) )
     306                $filtered_illegal_names[] = BP_GROUPS_SLUG;
     307
     308        if ( bp_is_active( 'xprofile' ) )
     309                $filtered_illegal_names[] = BP_XPROFILE_SLUG;
     310
     311        $filtered_illegal_names[] = BP_ACTIVATION_SLUG;
     312        $filtered_illegal_names[] = BP_MEMBERS_SLUG;
     313        $filtered_illegal_names[] = BP_REGISTER_SLUG;
     314        $filtered_illegal_names[] = BP_SEARCH_SLUG;
     315        $filtered_illegal_names[] = BP_SETTINGS_SLUG;
     316        $filtered_illegal_names = apply_filters( 'bp_core_illegal_usernames', $filtered_illegal_names );
    290317
    291318        // Merge the arrays together
     
    324351        bp_core_flush_illegal_names();
    325352
     353        $illegal_names = get_site_option( 'illegal_names' );
     354
    326355        if ( !validate_username( $user_name ) || in_array( $user_name, (array)$illegal_names ) || $user_name != $maybe[0] )
    327356                $errors->add( 'user_name', __( 'Only lowercase letters and numbers allowed', 'buddypress' ) );
  • trunk/bp-core/bp-core-templatetags.php

    r3368 r3369  
    377377                extract( $r, EXTR_SKIP );
    378378
    379                 if ( !$update = maybe_unserialize( $members_template->member->latest_update ) )
     379                if ( !isset( $members_template->member->latest_update ) || !$update = maybe_unserialize( $members_template->member->latest_update ) )
    380380                        return false;
    381381
     
    11471147}
    11481148        function bp_get_signup_username_value() {
    1149                 return apply_filters( 'bp_get_signup_username_value', $_POST['signup_username'] );
     1149                $value = '';
     1150                if ( isset( $_POST['signup_username'] ) )
     1151                        $value = $_POST['signup_username'];
     1152
     1153                return apply_filters( 'bp_get_signup_username_value', $value );
    11501154        }
    11511155
     
    11541158}
    11551159        function bp_get_signup_email_value() {
    1156                 return apply_filters( 'bp_get_signup_email_value', $_POST['signup_email'] );
     1160                $value = '';
     1161                if ( isset( $_POST['signup_email'] ) )
     1162                        $value = $_POST['signup_email'];
     1163
     1164                return apply_filters( 'bp_get_signup_email_value', $value );
    11571165        }
    11581166
     
    11611169}
    11621170        function bp_get_signup_with_blog_value() {
    1163                 return apply_filters( 'bp_get_signup_with_blog_value', $_POST['signup_with_blog'] );
     1171                $value = '';
     1172                if ( isset( $_POST['signup_with_blog'] ) )
     1173                        $value = $_POST['signup_with_blog'];
     1174
     1175                return apply_filters( 'bp_get_signup_with_blog_value', $value );
    11641176        }
    11651177
     
    11681180}
    11691181        function bp_get_signup_blog_url_value() {
    1170                 return apply_filters( 'bp_get_signup_blog_url_value', $_POST['signup_blog_url'] );
     1182                $value = '';
     1183                if ( isset( $_POST['signup_blog_url'] ) )
     1184                        $value = $_POST['signup_blog_url'];
     1185
     1186                return apply_filters( 'bp_get_signup_blog_url_value', $value );
    11711187        }
    11721188
     
    11751191}
    11761192        function bp_get_signup_blog_title_value() {
    1177                 return apply_filters( 'bp_get_signup_blog_title_value', $_POST['signup_blog_title'] );
     1193                $value = '';
     1194                if ( isset( $_POST['signup_blog_title'] ) )
     1195                        $value = $_POST['signup_blog_title'];
     1196
     1197                return apply_filters( 'bp_get_signup_blog_title_value', $value );
    11781198        }
    11791199
     
    11821202}
    11831203        function bp_get_signup_blog_privacy_value() {
    1184                 return apply_filters( 'bp_get_signup_blog_privacy_value', $_POST['signup_blog_privacy'] );
     1204                $value = '';
     1205                if ( isset( $_POST['signup_blog_privacy'] ) )
     1206                        $value = $_POST['signup_blog_privacy'];
     1207
     1208                return apply_filters( 'bp_get_signup_blog_privacy_value', $value );
    11851209        }
    11861210
     
    19401964                global $bp;
    19411965
     1966                $bp_classes = array();
     1967
    19421968                if ( bp_is_front_page() )
    19431969                        $bp_classes[] = 'home-page';
  • trunk/bp-forums/bp-forums-bbpress.php

    r3349 r3369  
    66
    77        /* Return if we've already run this function. */
    8         if ( is_object( $bbdb ) && is_object( $bb_roles ) )
     8        if ( is_object( $bbdb ) )
    99                return;
    1010
  • trunk/bp-forums/bp-forums-templatetags.php

    r3308 r3369  
    177177
    178178        /* If we're in a single group, set this group's forum_id */
    179         if ( !$forum_id && $bp->groups->current_group ) {
     179        if ( !$forum_id && isset( $bp->groups->current_group ) ) {
    180180                $bp->groups->current_group->forum_id = groups_get_groupmeta( $bp->groups->current_group->id, 'forum_id' );
    181181
     
    192192
    193193        /* Show stickies on a group forum */
    194         if ( $bp->groups->current_group )
     194        if ( isset( $bp->groups->current_group ) )
    195195                $no_stickies = null;
    196196
  • trunk/bp-friends.php

    r3331 r3369  
    7676        global $bp;
    7777
    78         if ( isset($bp->action_variables) && 'accept' == $bp->action_variables[0] && is_numeric($bp->action_variables[1]) ) {
     78        if ( isset( $bp->action_variables[0] ) && isset( $bp->action_variables[1] ) && 'accept' == $bp->action_variables[0] && is_numeric( $bp->action_variables[1] ) ) {
    7979                /* Check the nonce */
    8080                check_admin_referer( 'friends_accept_friendship' );
    8181
    82                 if ( friends_accept_friendship( $bp->action_variables[1] ) ) {
     82                if ( friends_accept_friendship( $bp->action_variables[1] ) )
    8383                        bp_core_add_message( __( 'Friendship accepted', 'buddypress' ) );
    84                 } else {
     84                else
    8585                        bp_core_add_message( __( 'Friendship could not be accepted', 'buddypress' ), 'error' );
    86                 }
     86
    8787                bp_core_redirect( $bp->loggedin_user->domain . $bp->current_component . '/' . $bp->current_action );
    8888
    89         } else if ( isset($bp->action_variables) && 'reject' == $bp->action_variables[0] && is_numeric($bp->action_variables[1]) ) {
     89        } elseif ( isset( $bp->action_variables[0] ) && isset( $bp->action_variables[1] ) && 'reject' == $bp->action_variables[0] && is_numeric( $bp->action_variables[1] ) ) {
    9090                /* Check the nonce */
    9191                check_admin_referer( 'friends_reject_friendship' );
    9292
    93                 if ( friends_reject_friendship( $bp->action_variables[1] ) ) {
     93                if ( friends_reject_friendship( $bp->action_variables[1] ) )
    9494                        bp_core_add_message( __( 'Friendship rejected', 'buddypress' ) );
    95                 } else {
     95                else
    9696                        bp_core_add_message( __( 'Friendship could not be rejected', 'buddypress' ), 'error' );
    97                 }
     97
    9898                bp_core_redirect( $bp->loggedin_user->domain . $bp->current_component . '/' . $bp->current_action );
    9999        }
  • trunk/bp-friends/bp-friends-classes.php

    r3300 r3369  
    9393
    9494                $friends = $wpdb->get_results( $wpdb->prepare( "SELECT friend_user_id, initiator_user_id FROM {$bp->friends->table_name} $friend_sql $oc_sql ORDER BY date_created DESC" ) );
     95                $fids = array();
    9596
    9697                for ( $i = 0; $i < count($friends); $i++ ) {
  • trunk/bp-friends/bp-friends-templatetags.php

    r3353 r3369  
    118118        global $members_template;
    119119
    120         if ( null === $members_template->member->is_friend )
     120        if ( !isset( $members_template->member->is_friend ) || null === $members_template->member->is_friend )
    121121                $friend_status = 'not_friends';
    122122        else
  • trunk/bp-groups.php

    r3360 r3369  
    217217        global $bp;
    218218
    219         $group_id = $bp->action_variables[1];
    220 
    221         if ( isset($bp->action_variables) && in_array( 'accept', (array)$bp->action_variables ) && is_numeric($group_id) ) {
     219        $group_id = 0;
     220        if ( isset( $bp->action_variables[1] ) )
     221                $group_id = $bp->action_variables[1];
     222
     223        if ( isset( $bp->action_variables ) && in_array( 'accept', (array)$bp->action_variables ) && is_numeric( $group_id ) ) {
    222224                /* Check the nonce */
    223225                if ( !check_admin_referer( 'groups_accept_invite' ) )
     
    241243                bp_core_redirect( $bp->loggedin_user->domain . $bp->current_component . '/' . $bp->current_action );
    242244
    243         } else if ( isset($bp->action_variables) && in_array( 'reject', (array)$bp->action_variables ) && is_numeric($group_id) ) {
     245        } elseif ( isset( $bp->action_variables ) && in_array( 'reject', (array)$bp->action_variables ) && is_numeric( $group_id ) ) {
    244246                /* Check the nonce */
    245247                if ( !check_admin_referer( 'groups_reject_invite' ) )
    246248                        return false;
    247249
    248                 if ( !groups_reject_invite( $bp->loggedin_user->id, $group_id ) ) {
     250                if ( !groups_reject_invite( $bp->loggedin_user->id, $group_id ) )
    249251                        bp_core_add_message( __('Group invite could not be rejected', 'buddypress'), 'error' );
    250                 } else {
     252                else
    251253                        bp_core_add_message( __('Group invite rejected', 'buddypress') );
    252                 }
    253254
    254255                bp_core_redirect( $bp->loggedin_user->domain . $bp->current_component . '/' . $bp->current_action );
     
    12441245        global $bp, $wp_query;
    12451246
    1246         if ( !bp_is_active( 'activity' ) || $bp->current_component != $bp->groups->slug || !$bp->groups->current_group || $bp->current_action != 'feed' )
     1247        if ( !bp_is_active( 'activity' ) || $bp->current_component != $bp->groups->slug || !isset( $bp->groups->current_group ) || $bp->current_action != 'feed' )
    12471248                return false;
    12481249
  • trunk/bp-groups/bp-groups-classes.php

    r3365 r3369  
    261261                global $wpdb, $bp;
    262262
     263                $pag_sql = '';
    263264                if ( $limit && $page )
    264265                        $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
    265266
     267                $hidden_sql = '';
    266268                if ( !is_user_logged_in() || ( !is_super_admin() && ( $user_id != $bp->loggedin_user->id ) ) )
    267269                        $hidden_sql = "AND g.status != 'hidden'";
    268270
     271                $search_sql = '';
    269272                if ( $search_terms ) {
    270273                        $search_terms = like_escape( $wpdb->escape( $search_terms ) );
     
    282285
    283286                if ( !empty( $populate_extras ) ) {
     287                        $group_ids = array();
    284288                        foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id;
    285289                        $group_ids = $wpdb->escape( join( ',', (array)$group_ids ) );
     
    316320                }
    317321
    318                 $group_ids = array();
    319322                if ( !empty( $populate_extras ) ) {
     323                        $group_ids = array();
    320324                        foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id;
    321325                        $group_ids = $wpdb->escape( join( ',', (array)$group_ids ) );
     
    329333                global $wpdb, $bp;
    330334
     335                $pag_sql = '';
    331336                if ( $limit && $page ) {
    332337                        $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
    333338                }
    334339
     340                $hidden_sql = '';
    335341                if ( !is_user_logged_in() || ( !is_super_admin() && ( $user_id != $bp->loggedin_user->id ) ) )
    336342                        $hidden_sql = "AND g.status != 'hidden'";
    337343
     344                $search_sql = '';
    338345                if ( $search_terms ) {
    339346                        $search_terms = like_escape( $wpdb->escape( $search_terms ) );
     
    351358
    352359                if ( !empty( $populate_extras ) ) {
     360                        $group_ids = array();
    353361                        foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id;
    354362                        $group_ids = $wpdb->escape( join( ',', (array)$group_ids ) );
     
    362370                global $wpdb, $bp;
    363371
     372                $pag_sql = '';
    364373                if ( $limit && $page )
    365374                        $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
    366375
     376                $hidden_sql = '';
    367377                if ( !is_user_logged_in() || ( !is_super_admin() && ( $user_id != $bp->loggedin_user->id ) ) )
    368378                        $hidden_sql = " AND g.status != 'hidden'";
    369379
     380                $search_sql = '';
    370381                if ( $search_terms ) {
    371382                        $search_terms = like_escape( $wpdb->escape( $search_terms ) );
     
    383394
    384395                if ( !empty( $populate_extras ) ) {
     396                        $group_ids = array();
    385397                        foreach ( (array)$paged_groups as $group ) $group_ids[] = $group->id;
    386398                        $group_ids = $wpdb->escape( join( ',', (array)$group_ids ) );
     
    824836                global $wpdb, $bp;
    825837
     838                $pag_sql = '';
    826839                if ( $limit && $page )
    827840                        $pag_sql = $wpdb->prepare( " LIMIT %d, %d", intval( ( $page - 1 ) * $limit), intval( $limit ) );
  • trunk/bp-groups/bp-groups-filters.php

    r3300 r3369  
    6666
    6767        /* Only filter the forum SQL on group pages or on the forums directory */
    68         if ( ( $bp->groups->current_group && 'public' == $bp->groups->current_group->status ) || !$bp->groups->current_group ) {
     68        if ( ( isset( $bp->groups->current_group ) && 'public' == $bp->groups->current_group->status ) || ( !isset( $bp->groups->current_group ) || !$bp->groups->current_group ) ) {
    6969                add_filter( 'get_topics_fields', 'groups_add_forum_fields_sql' );
    7070                add_filter( 'get_topics_index_hint', 'groups_add_forum_tables_sql' );
  • trunk/bp-themes/bp-default/comments.php

    r3300 r3369  
    161161                <?php endif; ?>
    162162
    163                 <?php if ( $numTrackBacks ) : ?>
     163                <?php if ( isset( $numTrackBacks ) && $numTrackBacks ) : ?>
    164164                        <div id="trackbacks">
    165165
  • trunk/bp-themes/bp-default/functions.php

    r3365 r3369  
    3737);
    3838
    39 if ( bp_is_profile_component() && !bp_is_directory() )
     39global $bp;
     40if ( isset( $bp->displayed_user->id ) )
    4041        $params['mention_explain'] = sprintf( __( "%s is a unique identifier for %s that you can type into any message on this site. %s will be sent a notification and a link to your message any time you use it.", 'buddypress' ), '@' . bp_get_displayed_user_username(), bp_get_user_firstname( bp_get_displayed_user_fullname() ), bp_get_user_firstname( bp_get_displayed_user_fullname() ) );
    4142
  • trunk/bp-themes/bp-default/sidebar.php

    r3300 r3369  
    4040                <form name="login-form" id="sidebar-login-form" class="standard-form" action="<?php echo site_url( 'wp-login.php', 'login_post' ) ?>" method="post">
    4141                        <label><?php _e( 'Username', 'buddypress' ) ?><br />
    42                         <input type="text" name="log" id="sidebar-user-login" class="input" value="<?php echo esc_attr(stripslashes($user_login)); ?>" /></label>
     42                        <input type="text" name="log" id="sidebar-user-login" class="input" /></label>
    4343
    4444                        <label><?php _e( 'Password', 'buddypress' ) ?><br />
    45                         <input type="password" name="pwd" id="sidebar-user-pass" class="input" value="" /></label>
     45                        <input type="password" name="pwd" id="sidebar-user-pass" class="input" /></label>
    4646
    4747                        <p class="forgetmenot"><label><input name="rememberme" type="checkbox" id="sidebar-rememberme" value="forever" /> <?php _e( 'Remember Me', 'buddypress' ) ?></label></p>
  • trunk/bp-xprofile.php

    r3365 r3369  
    175175        global $bp;
    176176
    177         do_action( 'xprofile_screen_display_profile', $_GET['new'] );
     177        $new = '';
     178        if ( isset( $_GET['new'] ) )
     179                $new = $_GET['new'];
     180
     181        do_action( 'xprofile_screen_display_profile', $new );
    178182        bp_core_load_template( apply_filters( 'xprofile_template_display_profile', 'members/single/home' ) );
    179183}
     
    345349        global $bp;
    346350
    347         if ( $bp->profile->slug != $bp->current_component || 'change-avatar' != $bp->current_action || 'delete-avatar' != $bp->action_variables[0] )
     351        if ( $bp->profile->slug != $bp->current_component || 'change-avatar' != $bp->current_action || !isset( $bp->action_variables[0] ) || 'delete-avatar' != $bp->action_variables[0] )
    348352                return false;
    349353
  • trunk/bp-xprofile/bp-xprofile-admin.php

    r3300 r3369  
    6868                        if ( $groups ) :
    6969                                foreach ( $groups as $group ) { ?>
    70                                         <li id="group_<?php echo $group->id; ?>"><a href="#tabs-<?php echo $group->id; ?>" class="ui-tab"><?php echo attribute_escape( $group->name ); ?><?php if ( !$group->can_delete ) : ?> <?php _e( '(Core)', 'buddypress'); endif; ?></a></li>
     70                                        <li id="group_<?php echo $group->id; ?>"><a href="#tabs-<?php echo $group->id; ?>" class="ui-tab"><?php echo esc_attr( $group->name ); ?><?php if ( !$group->can_delete ) : ?> <?php _e( '(Core)', 'buddypress'); endif; ?></a></li>
    7171<?php                   }
    7272                        endif; ?>
     
    7676                                foreach ( $groups as $group ) { ?>
    7777                                        <noscript>
    78                                                 <h3><?php echo attribute_escape( $group->name ) ?></h3>
     78                                                <h3><?php echo esc_attr( $group->name ) ?></h3>
    7979                                        </noscript>
    8080                                        <div id="tabs-<?php echo $group->id; ?>" class="tab-wrapper">
    8181                                                <div class="tab-toolbar">
    8282                                                        <div class="tab-toolbar-left">
    83                                                                 <a class="button" href="admin.php?page=bp-profile-setup&amp;group_id=<?php echo attribute_escape( $group->id ); ?>&amp;mode=add_field"><?php _e( 'Add New Field', 'buddypress' ); ?></a>
    84                                                                 <a class="button edit" href="admin.php?page=bp-profile-setup&amp;mode=edit_group&amp;group_id=<?php echo attribute_escape( $group->id ); ?>"><?php _e( 'Edit Group', 'buddypress' ); ?></a>
     83                                                                <a class="button" href="admin.php?page=bp-profile-setup&amp;group_id=<?php echo esc_attr( $group->id ); ?>&amp;mode=add_field"><?php _e( 'Add New Field', 'buddypress' ); ?></a>
     84                                                                <a class="button edit" href="admin.php?page=bp-profile-setup&amp;mode=edit_group&amp;group_id=<?php echo esc_attr( $group->id ); ?>"><?php _e( 'Edit Group', 'buddypress' ); ?></a>
    8585<?php                           if ( $group->can_delete ) : ?>
    86                                                                 <a class="button delete" href="admin.php?page=bp-profile-setup&amp;mode=delete_group&amp;group_id=<?php echo attribute_escape( $group->id ); ?>"><?php _e( 'Delete Group', 'buddypress' ); ?></a>
     86                                                                <a class="button delete" href="admin.php?page=bp-profile-setup&amp;mode=delete_group&amp;group_id=<?php echo esc_attr( $group->id ); ?>"><?php _e( 'Delete Group', 'buddypress' ); ?></a>
    8787<?php                           endif; ?>
    8888                                                        </div>
     
    9191                                                <fieldset id="<?php echo $group->id; ?>" class="connectedSortable field-group">
    9292<?php                           if( $group->description ) : ?>
    93                                                         <legend><?php echo attribute_escape( $group->description ) ?></legend>
     93                                                        <legend><?php echo esc_attr( $group->description ) ?></legend>
    9494<?php                           endif;
    9595
     
    9999                                                        /* Load the field */
    100100                                                        $field = new BP_XProfile_Field( $field->id );
     101
     102                                                        $class = '';
    101103                                                        if ( !$field->can_delete )
    102                                                                 $class .= ' core nodrag';
     104                                                                $class = ' core nodrag';
    103105
    104106                                                        /* This function handles the WYSIWYG profile field
    105107                                                         * display for the xprofile admin setup screen
    106108                                                         */
    107                                                         xprofile_admin_field( $field, $group );
     109                                                        xprofile_admin_field( $field, $group, $class );
    108110
    109111                                                } /* end for */
     
    328330 Handles the WYSIWYG display of each profile field on the edit screen
    329331**************************************************************************/
    330 function xprofile_admin_field( $admin_field, $admin_group ) {
     332function xprofile_admin_field( $admin_field, $admin_group, $class='' ) {
    331333        global $field;
    332334
    333335        $field = $admin_field;
    334336?>
    335                                                 <fieldset id="field_<?php echo attribute_escape( $field->id ); ?>" class="sortable<?php echo ' ' . $field->type; if ( $class ) echo ' ' . $class; ?>">
     337                                                <fieldset id="field_<?php echo esc_attr( $field->id ); ?>" class="sortable<?php echo ' ' . $field->type; if ( $class ) echo ' ' . $class; ?>">
    336338                                                        <legend><?php bp_the_profile_field_name(); ?> <?php if( !$field->can_delete ) : ?> <?php _e( '(Core)', 'buddypress' ); endif; ?> <?php if ( bp_get_the_profile_field_is_required() ) : ?><?php _e( '(required)', 'buddypress' ) ?><?php endif; ?></legend>
    337339                                                        <div class="field-wrapper">
     
    394396<?php } ?>
    395397                                                                <div class="actions">
    396                                                                         <a class="button edit" href="admin.php?page=bp-profile-setup&amp;group_id=<?php echo attribute_escape( $admin_group->id ); ?>&amp;field_id=<?php echo attribute_escape( $field->id ); ?>&amp;mode=edit_field"><?php _e( 'Edit', 'buddypress' ); ?></a>
    397                                                                         <?php if ( !$field->can_delete ) : ?>&nbsp;<?php else : ?><a class="button delete" href="admin.php?page=bp-profile-setup&amp;field_id=<?php echo attribute_escape( $field->id ); ?>&amp;mode=delete_field"><?php _e( 'Delete', 'buddypress' ); ?></a><?php endif; ?>
     398                                                                        <a class="button edit" href="admin.php?page=bp-profile-setup&amp;group_id=<?php echo esc_attr( $admin_group->id ); ?>&amp;field_id=<?php echo esc_attr( $field->id ); ?>&amp;mode=edit_field"><?php _e( 'Edit', 'buddypress' ); ?></a>
     399                                                                        <?php if ( !$field->can_delete ) : ?>&nbsp;<?php else : ?><a class="button delete" href="admin.php?page=bp-profile-setup&amp;field_id=<?php echo esc_attr( $field->id ); ?>&amp;mode=delete_field"><?php _e( 'Delete', 'buddypress' ); ?></a><?php endif; ?>
    398400
    399401                                                                </div>
    400402<?php if ( $field->description ) : ?>
    401                                                                 <p class="description"><?php echo attribute_escape( $field->description ); ?></p>
     403                                                                <p class="description"><?php echo esc_attr( $field->description ); ?></p>
    402404<?php endif; ?>
    403405                                                        </div>
  • trunk/bp-xprofile/bp-xprofile-classes.php

    r3357 r3369  
    9494                extract( $r, EXTR_SKIP );
    9595
     96                $group_id_sql = '';
    9697                if ( $profile_group_id )
    9798                        $group_id_sql = $wpdb->prepare( 'WHERE g.id = %d', $profile_group_id );
     
    258259                global $wpdb, $userdata, $bp;
    259260
     261                $user_id = 0;
    260262                if ( is_null( $user_id ) )
    261263                        $user_id = $userdata->ID;
     
    264266
    265267                if ( $field = $wpdb->get_row( $sql ) ) {
    266                         $this->id                                       = $field->id;
    267                         $this->group_id                         = $field->group_id;
    268                         $this->parent_id                        = $field->parent_id;
    269                         $this->type                                     = $field->type;
    270                         $this->name                                     = stripslashes($field->name);
    271                         $this->description                      = stripslashes($field->description);
    272                         $this->is_required                      = $field->is_required;
    273                         $this->can_delete                       = $field->can_delete;
    274                         $this->field_order                      = $field->field_order;
    275                         $this->option_order                     = $field->option_order;
    276                         $this->order_by                         = $field->order_by;
    277                         $this->is_default_option        = $field->is_default_option;
    278 
    279                         if ( $get_data )
    280                                 $this->data                             = $this->get_field_data( $user_id );
    281 
     268                        $this->id               = $field->id;
     269                        $this->group_id          = $field->group_id;
     270                        $this->parent_id         = $field->parent_id;
     271                        $this->type              = $field->type;
     272                        $this->name              = stripslashes( $field->name );
     273                        $this->description       = stripslashes( $field->description );
     274                        $this->is_required       = $field->is_required;
     275                        $this->can_delete        = $field->can_delete;
     276                        $this->field_order       = $field->field_order;
     277                        $this->option_order      = $field->option_order;
     278                        $this->order_by          = $field->order_by;
     279                        $this->is_default_option = $field->is_default_option;
     280
     281                        if ( $get_data && $user_id )
     282                                $this->data            = $this->get_field_data( $user_id );
    282283                }
    283284        }
  • trunk/bp-xprofile/bp-xprofile-templatetags.php

    r3300 r3369  
    11<?php
    2 
    32/***************************************************************************
    43 * XProfile Data Display Template Tags
     
    257256                global $group;
    258257
     258                $field_ids = '';
    259259                foreach ( (array) $group->fields as $field )
    260260                        $field_ids .= $field->id . ',';
     
    311311                 * value as long as it's not empty and a required field.
    312312                 */
    313                 if ( isset( $_POST['field_' . $field->id] ) && ( $field->data->value != $_POST['field_' . $field->id] ) ) {
     313                if ( isset( $_POST['field_' . $field->id] ) && isset( $field->data->value ) && $field->data->value != $_POST['field_' . $field->id] ) {
    314314                        if ( !empty( $_POST['field_' . $field->id] ) )
    315315                                $field->data->value = $_POST['field_' . $field->id];
    316316                }
    317317
    318                 $field->data->value = bp_unserialize_profile_field( $field->data->value );
    319 
    320                 return apply_filters( 'bp_get_the_profile_field_edit_value', esc_html( $field->data->value ) );
     318                if ( isset( $field->data->value ) )
     319                        return apply_filters( 'bp_get_the_profile_field_edit_value', esc_html( bp_unserialize_profile_field( $field->data->value ) ) );
     320                else
     321                        return apply_filters( 'bp_get_the_profile_field_edit_value', '' );
    321322        }
    322323
     
    677678
    678679function bp_get_user_has_avatar() {
     680        global $bp;
     681
    679682        if ( !bp_core_fetch_avatar( array( 'item_id' => $bp->displayed_user->id, 'no_grav' => true ) ) )
    680683                return false;
     
    697700        ) );
    698701}
    699 
    700702?>
Note: See TracChangeset for help on using the changeset viewer.