Skip to:
Content

BuddyPress.org

Changeset 5019


Ignore:
Timestamp:
08/20/2011 02:33:05 PM (15 years ago)
Author:
boonebgorges
Message:

Load the full-size avatar image on activity permalink pages. Refactor avatar height/width fallbacks to make the code clearer. Fixes #3500. Props Jonnyauk

Location:
trunk
Files:
2 edited

Legend:

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

    r4989 r5019  
    566566                global $activities_template, $bp;
    567567
     568                // On activity permalink pages, default to the full-size avatar
     569                $type_default = bp_is_single_activity() ? 'full' : 'thumb';
     570
    568571                $defaults = array(
    569572                        'alt'     => __( 'Profile picture of %s', 'buddypress' ),
    570573                        'class'   => 'avatar',
    571574                        'email'   => false,
    572                         'type'    => 'thumb',
     575                        'type'    => $type_default,
    573576                        'user_id' => false
    574577                );
     
    577580                extract( $r, EXTR_SKIP );
    578581
    579                 if ( !isset( $height ) && !isset( $width ) ) {  // Backpat
    580                         if ( 'full' == $type || ( 'thumb' == $type && bp_is_single_activity() ) ) {
    581                                 $height = $bp->avatar->full->height;
    582                                 $width  = $bp->avatar->full->width;
    583 
    584                         } elseif ( 'thumb' == $type ) {
    585                                 $height = $bp->avatar->thumb->height;
    586                                 $width  = $bp->avatar->thumb->width;
     582                if ( !isset( $height ) && !isset( $width ) ) {
     583                        // Backpat
     584                        if ( isset( $bp->avatar->full->height ) || isset( $bp->avatar->thumb->height ) ) {
     585                                $height = ( 'full' == $type ) ? $bp->avatar->full->height : $bp->avatar->thumb->height;
     586                        } else {
     587                                $height = 20;
    587588                        }
     589
     590                        // Backpat
     591                        if ( isset( $bp->avatar->full->width ) || isset( $bp->avatar->thumb->width ) ) {
     592                                $width = ( 'full' == $type ) ? $bp->avatar->full->width : $bp->avatar->thumb->width;
     593                        } else {
     594                                $width = 20;
     595                        }
     596
    588597                }
    589 
    590                 // Backpat
    591                 if ( !isset( $width ) )
    592                         $width = 20;
    593 
    594                 if ( !isset( $height ) )
    595                         $height = 20;
    596598
    597599                // Within the loop, we the current activity should be set first to the
  • trunk/bp-themes/bp-default/activity/entry.php

    r4961 r5019  
    1919                <a href="<?php bp_activity_user_link(); ?>">
    2020
    21                         <?php bp_activity_avatar( 'type=thumb' ); ?>
     21                        <?php bp_activity_avatar(); ?>
    2222
    2323                </a>
Note: See TracChangeset for help on using the changeset viewer.