Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/11/2012 03:21:00 AM (13 years ago)
Author:
johnjamesjacoby
Message:

Replace direct references to $bp user fullname and user_login with their functional equivalents, and kill off some $bp global usage in the process. See #3994, #3989.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-template.php

    r5684 r5705  
    142142        }
    143143
    144         $this->full_name = $bp->displayed_user->fullname;
     144        $this->full_name = bp_get_displayed_user_fullname();
    145145
    146146        // Fetch parent content for activity comments so we do not have to query in the loop
     
    324324        // determine which user_id applies
    325325        if ( empty( $user_id ) )
    326             $user_id = ( bp_displayed_user_id() ) ? bp_displayed_user_id() : bp_loggedin_user_id();
     326            $user_id = bp_displayed_user_id() ? bp_displayed_user_id() : bp_loggedin_user_id();
    327327
    328328        // are we displaying user specific activity?
     
    360360                    break;
    361361                case 'mentions':
    362                     $user_nicename    = ( bp_displayed_user_id() ) ? $bp->displayed_user->userdata->user_nicename : $bp->loggedin_user->userdata->user_nicename;
    363                     $user_login       = ( bp_displayed_user_id() ) ? $bp->displayed_user->userdata->user_login : $bp->loggedin_user->userdata->user_login;
    364                     $search_terms     = '@' . bp_core_get_username( $user_id, $user_nicename, $user_login ) . '<'; // Start search at @ symbol and stop search at closing tag delimiter.
     362
     363                    // Start search at @ symbol and stop search at closing tag delimiter.
     364                    $search_terms     = '@' . bp_core_get_username( $user_id ) . '<';
    365365                    $display_comments = 'stream';
    366366                    $user_id = 0;
     
    371371
    372372    // Do not exceed the maximum per page
    373     if ( !empty( $max ) && ( (int)$per_page > (int)$max ) )
     373    if ( !empty( $max ) && ( (int) $per_page > (int) $max ) )
    374374        $per_page = $max;
    375375
     
    385385
    386386    // If specific activity items have been requested, override the $hide_spam argument. This prevents backpat errors with AJAX.
    387     if ( !empty( $include ) && 'ham_only' == $spam )
     387    if ( !empty( $include ) && ( 'ham_only' == $spam ) )
    388388        $spam = 'all';
    389389
     
    22902290            return false;
    22912291
    2292         return apply_filters( 'bp_get_send_public_message_link', wp_nonce_url( bp_loggedin_user_domain() . bp_get_activity_slug() . '/?r=' . bp_core_get_username( bp_displayed_user_id(), $bp->displayed_user->userdata->user_nicename, $bp->displayed_user->userdata->user_login ) ) );
     2292        return apply_filters( 'bp_get_send_public_message_link', wp_nonce_url( bp_loggedin_user_domain() . bp_get_activity_slug() . '/?r=' . bp_core_get_username( bp_displayed_user_id(), bp_get_displayed_user_username(), $bp->displayed_user->userdata->user_login ) ) );
    22932293    }
    22942294
Note: See TracChangeset for help on using the changeset viewer.