Skip to:
Content

BuddyPress.org

Ticket #6525: avatars_members_groups.patch

File avatars_members_groups.patch, 10.9 KB (added by lenasterg, 11 years ago)
  • src/bp-groups/bp-groups-template.php

     
    873873        echo bp_get_group_avatar( $args );
    874874}
    875875        /**
    876          * Return the group avatar while in the groups loop.
     876         * Get a group's avatar.
    877877         *
    878878         * @since BuddyPress (1.0.0)
    879879         *
    880          * @param array|string $args {
    881          *     Array of arguments. See {@link bp_core_fetch_avatar()} for
    882          *     detailed description. Default values that differ from that
    883          *     function are described below.
    884          *
    885          *     @type string $type Default: 'full'.
    886          *     @type string $id   Passed to $css_id parameter.
     880         * @see bp_core_fetch_avatar() For a description of arguments and
     881         *      return values.
     882         * @param array $args  {
     883         *     Arguments are listed here with an explanation of their defaults.
     884         *     For more information about the arguments, see
     885         *     {@link bp_core_fetch_avatar()}.
     886         *     @type string   $alt     Default: 'Group logo of [group name]'.
     887         *     @type string   $class   Default: 'avatar'.
     888         *     @type string   $title   Default: '[group name]'.
     889         *     @type string   $type    Default: 'full'.
     890         *     @type int|bool $width   Default: false.
     891         *     @type int|bool $height Default: false.
     892         *     @type bool $id Passed to $css_id parameter.
    887893         * }
    888          * @return string
     894         * @return string Group avatar string.
    889895         */
    890896        function bp_get_group_avatar( $args = '' ) {
    891897                global $groups_template;
    … …  
    902908                        'height' => false,
    903909                        'class'  => 'avatar',
    904910                        'id'     => false,
    905                         'alt'    => sprintf( __( 'Group logo of %s', 'buddypress' ), $groups_template->group->name )
     911                        'alt'    => sprintf( __( 'Group logo of %s', 'buddypress' ), $groups_template->group->name ),
     912                        'title' => $groups_template->group->name,
    906913                ) );
    907914
    908915                // Fetch the avatar from the folder
    909916                $avatar = bp_core_fetch_avatar( array(
    910917                        'item_id'    => $groups_template->group->id,
    911                         'title'      => $groups_template->group->name,
     918                        'title'      => $r['title'],
    912919                        'avatar_dir' => 'group-avatars',
    913920                        'object'     => 'group',
    914921                        'type'       => $r['type'],
    … …  
    39823989                        'item_id' => $members_template->member->user_id,
    39833990                        'type'    => 'full',
    39843991                        'email'   => $members_template->member->user_email,
    3985                         'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), $members_template->member->display_name )
     3992                        'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), $members_template->member->display_name ),
     3993                        'title'   => $members_template->member->display_name
    39863994                ) );
    39873995
    39883996                /**
    … …  
    40234031                        'item_id' => $members_template->member->user_id,
    40244032                        'type'    => 'thumb',
    40254033                        'email'   => $members_template->member->user_email,
    4026                         'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), $members_template->member->display_name )
     4034                        'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), $members_template->member->display_name ),
     4035                        'title'   => $members_template->member->display_name
    40274036                ) );
    40284037
    40294038                /**
    … …  
    40674076                        'email'   => $members_template->member->user_email,
    40684077                        'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), $members_template->member->display_name ),
    40694078                        'width'   => absint( $width ),
    4070                         'height'  => absint( $height )
     4079                        'height'  => absint( $height ),
     4080                        'title'   => $members_template->member->display_name
    40714081                ) );
    40724082
    40734083                /**
    … …  
    47064716                        'class'   => 'avatar',
    47074717                        'id'      => 'avatar-crop-preview',
    47084718                        'alt'     => __( 'Group photo', 'buddypress' ),
     4719                        'title'   => __( 'Group photo', 'buddypress' ),
    47094720                        'no_grav' => false
    47104721                ), 'get_new_group_avatar' );
    47114722
    … …  
    50875098                        'type'       => $type,
    50885099                        'avatar_dir' => 'group-avatars',
    50895100                        'alt'        => __( 'Group avatar', 'buddypress' ),
     5101                        'title'      => __( 'Group avatar', 'buddypress' ),
    50905102                        'class'      => 'avatar'
    50915103                ) );
    50925104
    … …  
    53825394function bp_group_request_user_avatar_thumb() {
    53835395        global $requests_template;
    53845396
     5397        $user_display_name = bp_core_get_user_displayname( $requests_template->request->user_id );
    53855398        /**
    53865399         * Filters the requesting user's avatar thumbnail.
    53875400         *
    … …  
    53895402         *
    53905403         * @param string $value HTML markup for the user's avatar thumbnail.
    53915404         */
    5392         echo apply_filters( 'bp_group_request_user_avatar_thumb', bp_core_fetch_avatar( array( 'item_id' => $requests_template->request->user_id, 'type' => 'thumb', 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $requests_template->request->user_id ) ) ) ) );
     5405        echo apply_filters( 'bp_group_request_user_avatar_thumb', bp_core_fetch_avatar( array( 'item_id' => $requests_template->request->user_id, 'type' => 'thumb', 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $user_display_name ), 'title'=>$user_display_name ) ) );
    53935406}
    53945407
    53955408function bp_group_request_reject_link() {
    … …  
    56735686                if ( bp_is_active( 'xprofile' ) ) {
    56745687                        $this->invite->user->profile_data = BP_XProfile_ProfileData::get_all_for_user( $user_id );
    56755688                }
     5689                $inv_user_fullname=$this->invite->user->fullname;
    56765690
    5677                 $this->invite->user->avatar       = bp_core_fetch_avatar( array( 'item_id' => $user_id, 'type' => 'full',  'alt' => sprintf( __( 'Profile photo of %s', 'buddypress' ), $this->invite->user->fullname ) ) );
    5678                 $this->invite->user->avatar_thumb = bp_core_fetch_avatar( array( 'item_id' => $user_id, 'type' => 'thumb', 'alt' => sprintf( __( 'Profile photo of %s', 'buddypress' ), $this->invite->user->fullname ) ) );
    5679                 $this->invite->user->avatar_mini  = bp_core_fetch_avatar( array( 'item_id' => $user_id, 'type' => 'thumb', 'alt' => sprintf( __( 'Profile photo of %s', 'buddypress' ), $this->invite->user->fullname ), 'width' => 30, 'height' => 30 ) );
     5691                $this->invite->user->avatar       = bp_core_fetch_avatar( array( 'item_id' => $user_id, 'type' => 'full',  'alt' => sprintf( __( 'Profile photo of %s', 'buddypress' ), $inv_user_fullname ), 'title'=>$inv_user_fullname ) );
     5692                $this->invite->user->avatar_thumb = bp_core_fetch_avatar( array( 'item_id' => $user_id, 'type' => 'thumb', 'alt' => sprintf( __( 'Profile photo of %s', 'buddypress' ), $inv_user_fullname ), 'title'=>$inv_user_fullname ) );
     5693                $this->invite->user->avatar_mini  = bp_core_fetch_avatar( array( 'item_id' => $user_id, 'type' => 'thumb', 'alt' => sprintf( __( 'Profile photo of %s', 'buddypress' ), $inv_user_fullname ), 'title'=>$inv_user_fullname,'width' => 30, 'height' => 30 ) );
    56805694                $this->invite->user->email        = $this->invite->user->user_email;
    56815695                $this->invite->user->user_url     = bp_core_get_user_domain( $user_id, $this->invite->user->user_nicename, $this->invite->user->user_login );
    56825696                $this->invite->user->user_link    = "<a href='{$this->invite->user->user_url}' title='{$this->invite->user->fullname}'>{$this->invite->user->fullname}</a>";
  • src/bp-members/bp-members-template.php

     
    934934         *     @type string   $alt     Default: 'Profile picture of [user name]'.
    935935         *     @type string   $class   Default: 'avatar'.
    936936         *     @type string   $type    Default: 'thumb'.
     937         *     @type string   $title   Default: '[user name]'.
    937938         *     @type int|bool $width   Default: false.
    938939         *     @type int|bool $height  Default: false.
    939940         *     @type bool     $id      Currently unused.
    … …  
    952953                        'height' => false,
    953954                        'class'  => 'avatar',
    954955                        'id'     => false,
    955                         'alt'    => sprintf( __( 'Profile picture of %s', 'buddypress' ), $fullname )
     956                        'alt'    => sprintf( __( 'Profile picture of %s', 'buddypress' ), $fullname ),
     957                        'title' => $fullname,
    956958                );
    957959
    958960                $r = wp_parse_args( $args, $defaults );
    … …  
    966968                 * @param string $value Formatted HTML <img> element,
    967969                 *                      or raw avatar URL based on $html arg.
    968970                 */
    969                 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 ) ) );
     971                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, 'title' => $title ) ) );
    970972        }
    971973
    972974/**
    … …  
    14781480         *     For more information about the arguments, see
    14791481         *     {@link bp_core_fetch_avatar()}.
    14801482         *     @type string   $alt    Default: 'Profile picture of [user name]'.
     1483         *     @type string   $title  Default: ' [user name]'.
    14811484         *     @type bool     $html   Default: true.
    14821485         *     @type string   $type   Default: 'thumb'.
    14831486         *     @type int|bool $width  Default: false.
    … …  
    14931496                        'width'   => false,
    14941497                        'height'  => false,
    14951498                        'html'    => true,
    1496                         'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_loggedin_user_fullname() )
     1499                        'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_loggedin_user_fullname() ),
     1500                        'title'   => bp_get_loggedin_user_fullname()
    14971501                ) );
    14981502
     1503
     1504
    14991505                /**
    15001506                 * Filters the logged in user's avatar.
    15011507                 *
    … …  
    15271533         *     For more information about the arguments, see
    15281534         *     {@link bp_core_fetch_avatar()}.
    15291535         *     @type string   $alt    Default: 'Profile picture of [user name]'.
     1536         *     @type string   $title  Default: '[user name]'.
    15301537         *     @type bool     $html   Default: true.
    15311538         *     @type string   $type   Default: 'thumb'.
    15321539         *     @type int|bool $width  Default: false.
    … …  
    15421549                        'width'   => false,
    15431550                        'height'  => false,
    15441551                        'html'    => true,
    1545                         'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() )
     1552                        'alt'     => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() ),
     1553                        'title'   => bp_get_displayed_user_fullname()
    15461554                ) );
    15471555
    15481556                /**
    … …  
    22622270         *                         bp_core_avatar_full_width().
    22632271         *     @type string $class CSS class. Default: 'avatar'.
    22642272         *     @type string $alt   HTML 'alt' attribute. Default: 'Your Avatar'.
     2273         *     @type string $title HTML 'title' attribute. Default: 'Your Avatar'
    22652274         * }
    22662275         * @return string
    22672276         */
    … …  
    22712280                $defaults = array(
    22722281                        'size' => bp_core_avatar_full_width(),
    22732282                        'class' => 'avatar',
    2274                         'alt' => __( 'Your Profile Photo', 'buddypress' )
     2283                        'alt' => __( 'Your Profile Photo', 'buddypress' ),
     2284                        'title' => __( 'Your Profile Photo', 'buddypress' )
    22752285                );
    22762286
    22772287                $r = wp_parse_args( $args, $defaults );
    … …  
    22862296                                'type'       => 'full',
    22872297                                'width'      => $size,
    22882298                                'height'     => $size,
    2289                                 'alt'        => $alt,
     2299                                'alt'            => $alt,
     2300                                'title'          =>$title,
    22902301                                'class'      => $class
    22912302                        ) );
    22922303