Ticket #6525: avatars_members_groups.patch
| File avatars_members_groups.patch, 10.9 KB (added by , 11 years ago) |
|---|
-
src/bp-groups/bp-groups-template.php
873 873 echo bp_get_group_avatar( $args ); 874 874 } 875 875 /** 876 * Return the group avatar while in the groups loop.876 * Get a group's avatar. 877 877 * 878 878 * @since BuddyPress (1.0.0) 879 879 * 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. 887 893 * } 888 * @return string 894 * @return string Group avatar string. 889 895 */ 890 896 function bp_get_group_avatar( $args = '' ) { 891 897 global $groups_template; … … 902 908 'height' => false, 903 909 'class' => 'avatar', 904 910 '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, 906 913 ) ); 907 914 908 915 // Fetch the avatar from the folder 909 916 $avatar = bp_core_fetch_avatar( array( 910 917 'item_id' => $groups_template->group->id, 911 'title' => $ groups_template->group->name,918 'title' => $r['title'], 912 919 'avatar_dir' => 'group-avatars', 913 920 'object' => 'group', 914 921 'type' => $r['type'], … … 3982 3989 'item_id' => $members_template->member->user_id, 3983 3990 'type' => 'full', 3984 3991 '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 3986 3994 ) ); 3987 3995 3988 3996 /** … … 4023 4031 'item_id' => $members_template->member->user_id, 4024 4032 'type' => 'thumb', 4025 4033 '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 4027 4036 ) ); 4028 4037 4029 4038 /** … … 4067 4076 'email' => $members_template->member->user_email, 4068 4077 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $members_template->member->display_name ), 4069 4078 'width' => absint( $width ), 4070 'height' => absint( $height ) 4079 'height' => absint( $height ), 4080 'title' => $members_template->member->display_name 4071 4081 ) ); 4072 4082 4073 4083 /** … … 4706 4716 'class' => 'avatar', 4707 4717 'id' => 'avatar-crop-preview', 4708 4718 'alt' => __( 'Group photo', 'buddypress' ), 4719 'title' => __( 'Group photo', 'buddypress' ), 4709 4720 'no_grav' => false 4710 4721 ), 'get_new_group_avatar' ); 4711 4722 … … 5087 5098 'type' => $type, 5088 5099 'avatar_dir' => 'group-avatars', 5089 5100 'alt' => __( 'Group avatar', 'buddypress' ), 5101 'title' => __( 'Group avatar', 'buddypress' ), 5090 5102 'class' => 'avatar' 5091 5103 ) ); 5092 5104 … … 5382 5394 function bp_group_request_user_avatar_thumb() { 5383 5395 global $requests_template; 5384 5396 5397 $user_display_name = bp_core_get_user_displayname( $requests_template->request->user_id ); 5385 5398 /** 5386 5399 * Filters the requesting user's avatar thumbnail. 5387 5400 * … … 5389 5402 * 5390 5403 * @param string $value HTML markup for the user's avatar thumbnail. 5391 5404 */ 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 ) ) ); 5393 5406 } 5394 5407 5395 5408 function bp_group_request_reject_link() { … … 5673 5686 if ( bp_is_active( 'xprofile' ) ) { 5674 5687 $this->invite->user->profile_data = BP_XProfile_ProfileData::get_all_for_user( $user_id ); 5675 5688 } 5689 $inv_user_fullname=$this->invite->user->fullname; 5676 5690 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 ) ); 5680 5694 $this->invite->user->email = $this->invite->user->user_email; 5681 5695 $this->invite->user->user_url = bp_core_get_user_domain( $user_id, $this->invite->user->user_nicename, $this->invite->user->user_login ); 5682 5696 $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
934 934 * @type string $alt Default: 'Profile picture of [user name]'. 935 935 * @type string $class Default: 'avatar'. 936 936 * @type string $type Default: 'thumb'. 937 * @type string $title Default: '[user name]'. 937 938 * @type int|bool $width Default: false. 938 939 * @type int|bool $height Default: false. 939 940 * @type bool $id Currently unused. … … 952 953 'height' => false, 953 954 'class' => 'avatar', 954 955 'id' => false, 955 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $fullname ) 956 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $fullname ), 957 'title' => $fullname, 956 958 ); 957 959 958 960 $r = wp_parse_args( $args, $defaults ); … … 966 968 * @param string $value Formatted HTML <img> element, 967 969 * or raw avatar URL based on $html arg. 968 970 */ 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 ) ) ); 970 972 } 971 973 972 974 /** … … 1478 1480 * For more information about the arguments, see 1479 1481 * {@link bp_core_fetch_avatar()}. 1480 1482 * @type string $alt Default: 'Profile picture of [user name]'. 1483 * @type string $title Default: ' [user name]'. 1481 1484 * @type bool $html Default: true. 1482 1485 * @type string $type Default: 'thumb'. 1483 1486 * @type int|bool $width Default: false. … … 1493 1496 'width' => false, 1494 1497 'height' => false, 1495 1498 '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() 1497 1501 ) ); 1498 1502 1503 1504 1499 1505 /** 1500 1506 * Filters the logged in user's avatar. 1501 1507 * … … 1527 1533 * For more information about the arguments, see 1528 1534 * {@link bp_core_fetch_avatar()}. 1529 1535 * @type string $alt Default: 'Profile picture of [user name]'. 1536 * @type string $title Default: '[user name]'. 1530 1537 * @type bool $html Default: true. 1531 1538 * @type string $type Default: 'thumb'. 1532 1539 * @type int|bool $width Default: false. … … 1542 1549 'width' => false, 1543 1550 'height' => false, 1544 1551 '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() 1546 1554 ) ); 1547 1555 1548 1556 /** … … 2262 2270 * bp_core_avatar_full_width(). 2263 2271 * @type string $class CSS class. Default: 'avatar'. 2264 2272 * @type string $alt HTML 'alt' attribute. Default: 'Your Avatar'. 2273 * @type string $title HTML 'title' attribute. Default: 'Your Avatar' 2265 2274 * } 2266 2275 * @return string 2267 2276 */ … … 2271 2280 $defaults = array( 2272 2281 'size' => bp_core_avatar_full_width(), 2273 2282 'class' => 'avatar', 2274 'alt' => __( 'Your Profile Photo', 'buddypress' ) 2283 'alt' => __( 'Your Profile Photo', 'buddypress' ), 2284 'title' => __( 'Your Profile Photo', 'buddypress' ) 2275 2285 ); 2276 2286 2277 2287 $r = wp_parse_args( $args, $defaults ); … … 2286 2296 'type' => 'full', 2287 2297 'width' => $size, 2288 2298 'height' => $size, 2289 'alt' => $alt, 2299 'alt' => $alt, 2300 'title' =>$title, 2290 2301 'class' => $class 2291 2302 ) ); 2292 2303
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)