Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/11/2012 05:38:50 PM (13 years ago)
Author:
boonebgorges
Message:

Pinking shears in Core component

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-avatars.php

    r5956 r6022  
    1515function bp_core_set_avatar_constants() {
    1616    global $bp;
    17    
     17
    1818    if ( !defined( 'BP_AVATAR_THUMB_WIDTH' ) )
    1919        define( 'BP_AVATAR_THUMB_WIDTH', 50 );
     
    113113
    114114    /** Set item_id ***********************************************************/
    115    
     115
    116116    if ( empty( $item_id ) ) {
    117117
     
    130130
    131131                break;
    132            
     132
    133133            case 'user'  :
    134134            default      :
     
    145145
    146146    $class = apply_filters( 'bp_core_avatar_class', $class, $item_id, $object, $params );
    147    
     147
    148148    /** Set avatar_dir ********************************************************/
    149149
     
    164164
    165165                break;
    166            
     166
    167167            case 'user'  :
    168168            default      :
     
    181181
    182182    if ( false !== strpos( $alt, '%s' ) || false !== strpos( $alt, '%1$s' ) ) {
    183        
     183
    184184        // Get item name for alt/title tags
    185185        $item_name = '';
     
    194194                $item_name = bp_get_group_name( groups_get_group( array( 'group_id' => $item_id ) ) );
    195195                break;
    196            
     196
    197197            case 'user'  :
    198198            default :
     
    207207    /** Sanity Checks *********************************************************/
    208208
    209     // Get a fallback for the 'alt' parameter   
     209    // Get a fallback for the 'alt' parameter
    210210    if ( empty( $alt ) )
    211211        $alt = __( 'Avatar Image', 'buddypress' );
     
    727727function bp_core_avatar_upload_path() {
    728728    global $bp;
    729    
     729
    730730    // See if the value has already been calculated and stashed in the $bp global
    731731    if ( isset( $bp->avatar->upload_path ) ) {
     
    740740                switch_to_blog( bp_get_root_blog_id() );
    741741            }
    742            
     742
    743743            // Get upload directory information from current site
    744744            $upload_dir = wp_upload_dir();
    745        
     745
    746746            // Directory does not exist and cannot be created
    747747            if ( !empty( $upload_dir['error'] ) ) {
    748748                $basedir = '';
    749        
     749
    750750            } else {
    751751                $basedir = $upload_dir['basedir'];
    752752            }
    753            
     753
    754754            // Will bail if not switched
    755755            restore_current_blog();
    756756        }
    757        
     757
    758758        // Stash in $bp for later use
    759759        $bp->avatar->upload_path = $basedir;
    760760    }
    761    
     761
    762762    return apply_filters( 'bp_core_avatar_upload_path', $basedir );
    763763}
     
    773773function bp_core_avatar_url() {
    774774    global $bp;
    775    
     775
    776776    // See if the value has already been calculated and stashed in the $bp global
    777777    if ( isset( $bp->avatar->url ) ) {
     
    785785            // Get upload directory information from current site
    786786            $upload_dir = wp_upload_dir();
    787        
     787
    788788            // Directory does not exist and cannot be created
    789789            if ( !empty( $upload_dir['error'] ) ) {
    790790                $baseurl = '';
    791        
     791
    792792            } else {
    793793                $baseurl = $upload_dir['baseurl'];
     
    841841function bp_core_avatar_dimension( $type = 'thumb', $h_or_w = 'height' ) {
    842842    global $bp;
    843    
     843
    844844    $dim = isset( $bp->avatar->{$type}->{$h_or_w} ) ? (int) $bp->avatar->{$type}->{$h_or_w} : false;
    845    
     845
    846846    return apply_filters( 'bp_core_avatar_dimension', $dim, $type, $h_or_w );
    847847}
     
    905905function bp_core_avatar_original_max_width() {
    906906    global $bp;
    907    
     907
    908908    return apply_filters( 'bp_core_avatar_original_max_width', (int) $bp->avatar->original_max_width );
    909909}
     
    919919function bp_core_avatar_original_max_filesize() {
    920920    global $bp;
    921    
     921
    922922    return apply_filters( 'bp_core_avatar_original_max_filesize', (int) $bp->avatar->original_max_filesize );
    923923}
     
    933933function bp_core_avatar_default() {
    934934    global $bp;
    935    
     935
    936936    return apply_filters( 'bp_core_avatar_default', $bp->avatar->full->default );
    937937}
     
    947947function bp_core_avatar_default_thumb() {
    948948    global $bp;
    949    
     949
    950950    return apply_filters( 'bp_core_avatar_thumb', $bp->avatar->thumb->default );
    951951}
Note: See TracChangeset for help on using the changeset viewer.