Skip to:
Content

BuddyPress.org

Changeset 3443 for trunk/bp-core.php


Ignore:
Timestamp:
11/18/2010 09:31:44 PM (16 years ago)
Author:
djpaul
Message:

Use WordPress' gravatar settings. See #2712.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core.php

    r3442 r3443  
    7373        $current_user = wp_get_current_user();
    7474
    75         /* Get the base database prefix */
     75        // Get the base database prefix
    7676        $bp->table_prefix = bp_core_get_table_prefix();
    7777
    78         /* The domain for the root of the site where the main blog resides */
     78        // The domain for the root of the site where the main blog resides
    7979        $bp->root_domain = bp_core_get_root_domain();
    8080
    81         /* The names of the core WordPress pages used to display BuddyPress content */
     81        // The names of the core WordPress pages used to display BuddyPress content
    8282        $bp->pages = $bp_pages;
    8383
    84         /* Set up the members id and active components entry */
     84        // Set up the members id and active components entry
    8585        $bp->members->id = 'members';
    8686        $bp->members->slug = $bp->pages->members->slug;
    8787        $bp->active_components[$bp->members->slug] = $bp->members->id;
    8888
    89         /* The user ID of the user who is currently logged in. */
     89        // The user ID of the user who is currently logged in.
    9090        $bp->loggedin_user->id = $current_user->ID;
    9191
    92         /* The domain for the user currently logged in. eg: http://domain.com/members/andy */
     92        // The domain for the user currently logged in. eg: http://domain.com/members/andy
    9393        $bp->loggedin_user->domain = bp_core_get_user_domain( $bp->loggedin_user->id );
    9494
    95         /* The core userdata of the user who is currently logged in. */
     95        // The core userdata of the user who is currently logged in.
    9696        $bp->loggedin_user->userdata = bp_core_get_core_userdata( $bp->loggedin_user->id );
    9797
    98         /* is_super_admin() hits the DB on single WP installs, so we need to get this separately so we can call it in a loop. */
     98        // is_super_admin() hits the DB on single WP installs, so we need to get this separately so we can call it in a loop.
    9999        $bp->loggedin_user->is_super_admin = is_super_admin();
    100100        $bp->loggedin_user->is_site_admin  = $bp->loggedin_user->is_super_admin; // deprecated 1.2.6
    101101
    102         /* The user id of the user currently being viewed, set in /bp-core/bp-core-catchuri.php */
     102        // The user id of the user currently being viewed, set in /bp-core/bp-core-catchuri.php
    103103        $bp->displayed_user->id = $displayed_user_id;
    104104
    105         /* The domain for the user currently being displayed */
     105        // The domain for the user currently being displayed
    106106        $bp->displayed_user->domain = bp_core_get_user_domain( $bp->displayed_user->id );
    107107
    108         /* The core userdata of the user who is currently being displayed */
     108        // The core userdata of the user who is currently being displayed
    109109        $bp->displayed_user->userdata = bp_core_get_core_userdata( $bp->displayed_user->id );
    110110
    111         /* The component being used eg: http://domain.com/members/andy/ [profile] */
     111        // The component being used eg: http://domain.com/members/andy/ [profile]
    112112        $bp->current_component = $current_component; // type: string
    113113
    114         /* The current action for the component eg: http://domain.com/members/andy/profile/ [edit] */
     114        // The current action for the component eg: http://domain.com/members/andy/profile/ [edit]
    115115        $bp->current_action = $current_action; // type: string
    116116
    117         /* The action variables for the current action eg: http://domain.com/members/andy/profile/edit/ [group] / [6] */
     117        // The action variables for the current action eg: http://domain.com/members/andy/profile/edit/ [group] / [6]
    118118        $bp->action_variables = $action_variables; // type: array
    119119
    120         /* Only used where a component has a sub item, e.g. groups: http://domain.com/members/andy/groups/ [my-group] / home - manipulated in the actual component not in catch uri code.*/
     120        // Only used where a component has a sub item, e.g. groups: http://domain.com/members/andy/groups/ [my-group] / home - manipulated in the actual component not in catch uri code.
    121121        $bp->current_item = ''; // type: string
    122122
    123         /* Used for overriding the 2nd level navigation menu so it can be used to display custom navigation for an item (for example a group) */
     123        // Used for overriding the 2nd level navigation menu so it can be used to display custom navigation for an item (for example a group)
    124124        $bp->is_single_item = false;
    125125
    126         /* The default component to use if none are set and someone visits: http://domain.com/members/andy */
     126        // The default component to use if none are set and someone visits: http://domain.com/members/andy
    127127        if ( !defined( 'BP_DEFAULT_COMPONENT' ) ) {
    128128                if ( isset( $bp->pages->activity ) )
     
    134134        }
    135135
    136         /* Fetches all of the core database based BuddyPress settings in one foul swoop */
     136        // Fetches all of the core database based BuddyPress settings in one foul swoop
    137137        $bp->site_options = bp_core_get_site_options();
    138138
    139         /* Sets up the array container for the component navigation rendered by bp_get_nav() */
     139        // Sets up the array container for the component navigation rendered by bp_get_nav()
    140140        $bp->bp_nav = array();
    141141
    142         /* Sets up the array container for the component options navigation rendered by bp_get_options_nav() */
     142        // Sets up the array container for the component options navigation rendered by bp_get_options_nav()
    143143        $bp->bp_options_nav = array();
    144144
    145         /* Contains an array of all the active components. The key is the slug, value the internal ID of the component */
     145        // Contains an array of all the active components. The key is the slug, value the internal ID of the component
    146146        $bp->active_components = array();
    147147
    148         /* Fetches the default Gravatar image to use if the user/group/blog has no avatar or gravatar */
    149         $default_grav = isset( $bp->site_options['user-avatar-default'] ) ? $bp->site_options['user-avatar-default'] : 'wavatar';
    150         $bp->grav_default->user  = apply_filters( 'bp_user_gravatar_default', $default_grav );
    151         $bp->grav_default->group = apply_filters( 'bp_group_gravatar_default', 'identicon' );
    152         $bp->grav_default->blog  = apply_filters( 'bp_blog_gravatar_default', 'identicon' );
    153 
    154         /* Fetch the full name for the logged in and current user */
     148        // Fetches the default Gravatar image to use if the user/group/blog has no avatar or gravatar
     149        $bp->grav_default->user  = apply_filters( 'bp_user_gravatar_default',  $bp->site_options['avatar_default'] );
     150        $bp->grav_default->group = apply_filters( 'bp_group_gravatar_default', $bp->grav_default->user );
     151        $bp->grav_default->blog  = apply_filters( 'bp_blog_gravatar_default',  $bp->grav_default->user );
     152
     153        // Fetch the full name for the logged in and current user
    155154        $bp->loggedin_user->fullname  = bp_core_get_user_displayname( $bp->loggedin_user->id );
    156155        $bp->displayed_user->fullname = bp_core_get_user_displayname( $bp->displayed_user->id );
     
    162161        $bp->is_item_admin = bp_user_has_access();
    163162
    164         /* Used to determine if the logged in user is a moderator for the current content. */
     163        // Used to determine if the logged in user is a moderator for the current content.
    165164        $bp->is_item_mod = false;
    166165
     
    15831582                'hide-loggedout-adminbar',
    15841583
    1585                 /* Useful WordPress settings used often */
    1586                 'user-avatar-default',
     1584                // Useful WordPress settings used often
     1585                'avatar_default',
    15871586                'tags_blog_id',
    15881587                'registration',
Note: See TracChangeset for help on using the changeset viewer.