Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/25/2011 08:58:56 PM (14 years ago)
Author:
johnjamesjacoby
Message:

Rename new 'bp-users' component to 'bp-members' for consistency through-out project.
Core, Messages, and Friends Components now use the BP_Component class.
Split Friends and Messages components into smaller files.
Change references to 'profile' to 'xprofile' through-out project for consistency.
Introduce 'bp_actions' and 'bp_screens' standard hooks to replace the usage of 'wp' through-out project.
Move component loader sequence into bp-core-bootstrap.php,
Move old root_component action into 1.3 deprecated file.

Location:
trunk/bp-members
Files:
1 copied
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/bp-members/bp-members-functions.php

    r3916 r3917  
    130130 * @package BuddyPress Core
    131131 * @param $username str Username to check.
    132  * @return false on no match
    133  * @return int the user ID of the matched user.
    134  */
    135 function bp_core_get_random_member() {
    136     global $bp;
    137 
    138     if ( isset( $_GET['random-member'] ) ) {
    139         $user = bp_core_get_users( array( 'type' => 'random', 'per_page' => 1 ) );
    140         bp_core_redirect( bp_core_get_user_domain( $user['users'][0]->id ) );
    141     }
    142 }
    143 add_action( 'wp', 'bp_core_get_random_member' );
    144 
    145 /**
    146  * Returns the user_id for a user based on their username.
    147  *
    148  * @package BuddyPress Core
    149  * @param $username str Username to check.
    150132 * @global $wpdb WordPress DB access object.
    151133 * @return false on no match
     
    242224    // Check $username for empty spaces and default to nicename if found
    243225    if ( strstr( $username, ' ' ) )
    244         $username = bp_users_get_user_nicename( $user_id );
     226        $username = bp_members_get_user_nicename( $user_id );
    245227
    246228    // Add this to cache
     
    265247 * @return str the username of the matched user.
    266248 */
    267 function bp_users_get_user_nicename( $user_id ) {
     249function bp_members_get_user_nicename( $user_id ) {
    268250    global $bp;
    269251
    270     if ( !$user_nicename = wp_cache_get( 'bp_users_user_nicename_' . $user_id, 'bp' ) ) {
     252    if ( !$user_nicename = wp_cache_get( 'bp_members_user_nicename_' . $user_id, 'bp' ) ) {
    271253        $update_cache = true;
    272254
     
    303285    // Add this to cache
    304286    if ( true == $update_cache && !empty( $user_nicename ) )
    305         wp_cache_set( 'bp_users_user_nicename_' . $user_id, $user_nicename, 'bp' );
    306 
    307     return apply_filters( 'bp_users_get_user_nicename', $user_nicename );
     287        wp_cache_set( 'bp_members_user_nicename_' . $user_id, $user_nicename, 'bp' );
     288
     289    return apply_filters( 'bp_members_get_user_nicename', $user_nicename );
    308290}
    309291
     
    399381
    400382    if ( !$fullname = wp_cache_get( 'bp_user_fullname_' . $user_id, 'bp' ) ) {
    401         if ( bp_is_active( 'profile' ) ) {
     383        if ( bp_is_active( 'xprofile' ) ) {
    402384            $fullname = xprofile_get_field_data( stripslashes( $bp->site_options['bp-xprofile-fullname-field-name'] ), $user_id );
    403385
     
    640622add_action( 'bp_make_spam_user', 'bp_core_remove_data' );
    641623
    642 function bp_users_can_edit_settings() {
     624function bp_members_can_edit_settings() {
    643625    if ( bp_is_my_profile() )
    644626        return true;
Note: See TracChangeset for help on using the changeset viewer.