Skip to:
Content

BuddyPress.org

Ticket #3806: 3806.01.patch

File 3806.01.patch, 7.2 KB (added by boonebgorges, 14 years ago)
  • bp-activity/bp-activity-loader.php

    diff --git bp-activity/bp-activity-loader.php bp-activity/bp-activity-loader.php
    index e0f8e4e..8298ca9 100644
    class BP_Activity_Component extends BP_Component { 
    308308                        } else {
    309309                                $bp->bp_options_avatar = bp_core_fetch_avatar( array(
    310310                                        'item_id' => bp_displayed_user_id(),
    311                                         'type'    => 'thumb'
     311                                        'type'    => 'thumb',
     312                                        'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), $bp->displayed_user->fullname ),
     313                                        'title'  => sprintf( __( 'Profile picture of %s', 'buddypress' ), $bp->displayed_user->fullname )
    312314                                ) );
    313315                                $bp->bp_options_title  = $bp->displayed_user->fullname;
    314316                        }
  • bp-activity/bp-activity-template.php

    diff --git bp-activity/bp-activity-template.php bp-activity/bp-activity-template.php
    index fff15d1..fb91665 100644
    function bp_activity_avatar( $args = '' ) { 
    898898                $type_default = bp_is_single_activity() ? 'full' : 'thumb';
    899899
    900900                $defaults = array(
    901                         'alt'     => __( 'Profile picture of %s', 'buddypress' ),
     901                        'alt'     => '',
    902902                        'class'   => 'avatar',
    903903                        'email'   => false,
    904904                        'type'    => $type_default,
    function bp_activity_secondary_avatar( $args = '' ) { 
    991991                        case 'groups' :
    992992                                $object = 'group';
    993993                                $item_id = $activities_template->activity->item_id;
     994                                $item = groups_get_group( array( 'group_id' => $item_id ) );
    994995
    995996                                if ( empty( $alt ) )
    996                                         $alt = __( 'Group logo of %s', 'buddypress' );
     997                                        $alt = sprintf( __( 'Group logo of %s', 'buddypress' ), $item->name );
    997998
    998999                                break;
    9991000                        case 'blogs' :
    function bp_activity_secondary_avatar( $args = '' ) { 
    10091010                                $item_id = $activities_template->activity->secondary_item_id;
    10101011
    10111012                                if ( empty( $alt ) )
    1012                                         $alt = __( 'Profile picture of %s', 'buddypress' );
     1013                                        $alt = sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $item_id ) );
    10131014
    10141015                                break;
    10151016                        default :
    function bp_activity_secondary_avatar( $args = '' ) { 
    10181019                                $email = $activities_template->activity->user_email;
    10191020
    10201021                                if ( !$alt )
    1021                                         $alt = __( 'Profile picture of %s', 'buddypress' );
     1022                                        $alt = sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $item_id ) );
    10221023
    10231024                                break;
    10241025                }
  • bp-core/bp-core-avatars.php

    diff --git bp-core/bp-core-avatars.php bp-core/bp-core-avatars.php
    index f5a50f7..ea2969b 100644
    function bp_core_fetch_avatar( $args = '' ) { 
    146146        // Get item name for alt/title tags
    147147        $item_name = '';
    148148
     149        if ( !$title )
     150                $title = $alt;
     151
    149152        // Don't do this query if we don't have to
    150153        if ( !$alt || !$title ) {
    151154                if ( 'user' == $object )
    function bp_core_fetch_avatar_filter( $avatar, $user, $size, $default, $alt = '' 
    598601                return !empty( $avatar ) ? $avatar : $default;
    599602
    600603        if ( !$alt )
    601                 $alt = __( 'Avatar of %s', 'buddypress' );
     604                $alt = sprintf( __( 'Avatar of %s', 'buddypress' ), bp_core_get_user_displayname( $id ) );
    602605
    603606        // Let BuddyPress handle the fetching of the avatar
    604607        $bp_avatar = bp_core_fetch_avatar( array( 'item_id' => $id, 'width' => $size, 'height' => $size, 'alt' => $alt ) );
  • bp-core/bp-core-classes.php

    diff --git bp-core/bp-core-classes.php bp-core/bp-core-classes.php
    index bd25902..43006d4 100644
    class BP_Core_User { 
    169169                wp_cache_set( 'bp_user_email_' . $this->id, $this->email, 'bp' );
    170170                wp_cache_set( 'bp_user_url_' . $this->id, $this->user_url, 'bp' );
    171171
    172                 $this->avatar       = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'full'  ) );
    173                 $this->avatar_thumb = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'thumb' ) );
    174                 $this->avatar_mini  = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'thumb', 'width' => 30, 'height' => 30 ) );
     172                $this->avatar       = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'full', 'alt' => $this->fullname  ) );
     173                $this->avatar_thumb = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'thumb', 'alt' => $this->fullname ) );
     174                $this->avatar_mini  = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'thumb', 'width' => 30, 'height' => 30, 'alt' => $this->fullname ) );
    175175                $this->last_active  = bp_core_get_last_activity( bp_get_user_meta( $this->id, 'last_activity', true ), __( 'active %s', 'buddypress' ) );
    176176        }
    177177
  • bp-forums/bp-forums-template.php

    diff --git bp-forums/bp-forums-template.php bp-forums/bp-forums-template.php
    index ef39f17..2ccb550 100644
    function bp_the_topic_poster_avatar( $args = '' ) { 
    488488                        'type'   => 'thumb',
    489489                        'width'  => false,
    490490                        'height' => false,
    491                         'alt'    => __( 'Profile picture of %s', 'buddypress' )
     491                        'alt'    => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $forum_template->topic->topic_poster ) )
    492492                );
    493493
    494494                $r = wp_parse_args( $args, $defaults );
  • bp-members/bp-members-template.php

    diff --git bp-members/bp-members-template.php bp-members/bp-members-template.php
    index ca10291..311224e 100644
    function bp_member_avatar( $args = '' ) { 
    481481                        'height' => false,
    482482                        'class' => 'avatar',
    483483                        'id' => false,
    484                         'alt' => __( 'Profile picture of %s', 'buddypress' )
     484                        'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $members_template->member->display_name ),
     485                        'title' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $members_template->member->display_name )
    485486                );
    486487
    487488                $r = wp_parse_args( $args, $defaults );
    488489                extract( $r, EXTR_SKIP );
    489490
    490                 return apply_filters( 'bp_get_member_avatar', bp_core_fetch_avatar( array( 'item_id' => $members_template->member->id, 'type' => $type, 'alt' => $alt, 'css_id' => $id, 'class' => $class, 'width' => $width, 'height' => $height, 'email' => $members_template->member->user_email ) ) );
     491                return apply_filters( 'bp_get_member_avatar', bp_core_fetch_avatar( array( 'item_id' => $members_template->member->id, 'type' => $type, 'alt' => $alt, 'title' => $title, 'css_id' => $id, 'class' => $class, 'width' => $width, 'height' => $height, 'email' => $members_template->member->user_email ) ) );
    491492        }
    492493
    493494function bp_member_permalink() {
    function bp_loggedin_user_avatar( $args = '' ) { 
    777778                        'width'  => false,
    778779                        'height' => false,
    779780                        'html'   => true,
    780                         'alt'    => __( 'Profile picture of %s', 'buddypress' )
     781                        'alt'    => sprintf( __( 'Profile picture of %s', 'buddypress' ), $bp->loggedin_user->fullname ),
     782                        'title'  => sprintf( __( 'Profile picture of %s', 'buddypress' ), $bp->loggedin_user->fullname )
    781783                );
    782784
    783785                $r = wp_parse_args( $args, $defaults );
    784786                extract( $r, EXTR_SKIP );
    785787
    786                 return apply_filters( 'bp_get_loggedin_user_avatar', bp_core_fetch_avatar( array( 'item_id' => bp_loggedin_user_id(), 'type' => $type, 'width' => $width, 'height' => $height, 'html' => $html, 'alt' => $alt ) ) );
     788                return apply_filters( 'bp_get_loggedin_user_avatar', bp_core_fetch_avatar( array( 'item_id' => bp_loggedin_user_id(), 'type' => $type, 'width' => $width, 'height' => $height, 'html' => $html, 'alt' => $alt, 'title' => $title ) ) );
    787789        }
    788790
    789791function bp_displayed_user_avatar( $args = '' ) {