Skip to:
Content

BuddyPress.org

Changeset 5473


Ignore:
Timestamp:
12/09/2011 04:50:49 PM (13 years ago)
Author:
johnjamesjacoby
Message:

Add some brackets and whitespace to avatar and core slug functions to improve readability.

Location:
trunk
Files:
2 edited

Legend:

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

    r5470 r5473  
    3232
    3333    if ( !defined( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE' ) ) {
    34         if ( !isset( $bp->site_options['fileupload_maxk'] ) )
     34        if ( !isset( $bp->site_options['fileupload_maxk'] ) ) {
    3535            define( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', 5120000 ); // 5mb
    36         else
     36        } else {
    3737            define( 'BP_AVATAR_ORIGINAL_MAX_FILESIZE', $bp->site_options['fileupload_maxk'] * 1024 );
     38        }
    3839    }
    3940
     
    4849function bp_core_set_avatar_globals() {
    4950    global $bp;
    50    
     51
    5152    // Dimensions
    5253    $bp->avatar->thumb->width      = BP_AVATAR_THUMB_WIDTH;
     
    5455    $bp->avatar->full->width       = BP_AVATAR_FULL_WIDTH;
    5556    $bp->avatar->full->height      = BP_AVATAR_FULL_HEIGHT;
    56    
     57
    5758    // Upload maximums
    5859    $bp->avatar->original_max_width    = BP_AVATAR_ORIGINAL_MAX_WIDTH;
    5960    $bp->avatar->original_max_filesize = BP_AVATAR_ORIGINAL_MAX_FILESIZE;
    60    
     61
    6162    // Defaults
    62     $bp->avatar->thumb->default        = BP_AVATAR_DEFAULT_THUMB;
    63     $bp->avatar->full->default     = BP_AVATAR_DEFAULT;
    64    
     63    $bp->avatar->thumb->default = BP_AVATAR_DEFAULT_THUMB;
     64    $bp->avatar->full->default  = BP_AVATAR_DEFAULT;
     65
    6566    // These have to be set on page load in order to avoid infinite filter loops at runtime
    66     $bp->avatar->upload_path      = bp_core_avatar_upload_path();
    67     $bp->avatar->url           = bp_core_avatar_url();
    68    
     67    $bp->avatar->upload_path = bp_core_avatar_upload_path();
     68    $bp->avatar->url         = bp_core_avatar_url();
     69
    6970    do_action( 'bp_core_set_avatar_globals' );
    7071}
  • trunk/bp-members/bp-members-functions.php

    r5330 r5473  
    4040
    4141    // No custom members slug
    42     if ( !defined( 'BP_MEMBERS_SLUG' ) )
    43         if ( !empty( $bp->pages->members ) )
     42    if ( !defined( 'BP_MEMBERS_SLUG' ) ) {
     43        if ( !empty( $bp->pages->members ) ) {
    4444            define( 'BP_MEMBERS_SLUG', $bp->pages->members->slug );
    45         else
     45        } else {
    4646            define( 'BP_MEMBERS_SLUG', 'members' );
     47        }
     48    }
    4749
    4850    // No custom registration slug
    49     if ( !defined( 'BP_REGISTER_SLUG' ) )
    50         if ( !empty( $bp->pages->register ) )
     51    if ( !defined( 'BP_REGISTER_SLUG' ) ) {
     52        if ( !empty( $bp->pages->register ) ) {
    5153            define( 'BP_REGISTER_SLUG', $bp->pages->register->slug );
    52         else
     54        } else {
    5355            define( 'BP_REGISTER_SLUG', 'register' );
     56        }
     57    }
    5458
    5559    // No custom activation slug
    56     if ( !defined( 'BP_ACTIVATION_SLUG' ) )
    57         if ( !empty( $bp->pages->activate ) )
     60    if ( !defined( 'BP_ACTIVATION_SLUG' ) ) {
     61        if ( !empty( $bp->pages->activate ) ) {
    5862            define( 'BP_ACTIVATION_SLUG', $bp->pages->activate->slug );
    59         else
     63        } else {
    6064            define( 'BP_ACTIVATION_SLUG', 'activate' );
    61 
    62 }
    63 add_action( 'bp_setup_globals', 'bp_core_define_slugs' );
     65        }
     66    }
     67}
     68add_action( 'bp_setup_late_globals', 'bp_core_define_slugs' );
    6469
    6570/**
Note: See TracChangeset for help on using the changeset viewer.