Ticket #4333: 4333.05.patch
File 4333.05.patch, 72.6 KB (added by , 12 years ago) |
---|
-
bp-activity/bp-activity-loader.php
299 299 * @global object $bp BuddyPress global settings 300 300 * @uses bp_is_activity_component() 301 301 * @uses bp_is_my_profile() 302 * @uses bp_ core_fetch_avatar()302 * @uses bp_get_displayed_user_avatar() 303 303 */ 304 304 function setup_title() { 305 305 global $bp; … … 309 309 if ( bp_is_my_profile() ) { 310 310 $bp->bp_options_title = __( 'My Activity', 'buddypress' ); 311 311 } else { 312 $bp->bp_options_avatar = bp_core_fetch_avatar( array( 313 'item_id' => bp_displayed_user_id(), 314 'type' => 'thumb', 315 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() ) 316 ) ); 312 $bp->bp_options_avatar = bp_get_displayed_user_avatar(); 317 313 $bp->bp_options_title = bp_get_displayed_user_fullname(); 318 314 } 319 315 } -
bp-activity/bp-activity-template.php
943 943 * 944 944 * @since BuddyPress (1.1) 945 945 * 946 * @param array $args optional946 * @param array $args Avatar args {@link bp_core_fetch_avatar()} 947 947 * 948 948 * @global object $activities_template {@link BP_Activity_Template} 949 949 * @global object $bp BuddyPress global settings … … 956 956 * 957 957 * @return string User avatar 958 958 */ 959 function bp_get_activity_avatar( $args = '') {960 global $activities_template , $bp;959 function bp_get_activity_avatar( $args = array() ) { 960 global $activities_template; 961 961 962 $bp = buddypress(); 963 962 964 // On activity permalink pages, default to the full-size avatar 963 965 $type_default = bp_is_single_activity() ? 'full' : 'thumb'; 964 966 … … 970 972 971 973 $alt_default = isset( $dn_default ) ? sprintf( __( 'Profile picture of %s', 'buddypress' ), $activities_template->activity->display_name ) : __( 'Profile picture', 'buddypress' ); 972 974 973 $ defaults =array(975 $params = wp_parse_args( $args, array( 974 976 'alt' => $alt_default, 975 'class' => 'avatar',976 'email' => false,977 977 'type' => $type_default, 978 ' user_id' => false979 ) ;978 'item_id' => false 979 ) ); 980 980 981 $r = wp_parse_args( $args, $defaults ); 982 extract( $r, EXTR_SKIP ); 983 984 if ( !isset( $height ) && !isset( $width ) ) { 981 if ( !isset( $params['height'] ) && !isset( $params['width'] ) ) { 985 982 // Backpat 986 983 if ( isset( $bp->avatar->full->height ) || isset( $bp->avatar->thumb->height ) ) { 987 $ height = ( 'full' == $type) ? $bp->avatar->full->height : $bp->avatar->thumb->height;984 $params['height'] = ( 'full' == $params['type'] ) ? $bp->avatar->full->height : $bp->avatar->thumb->height; 988 985 } else { 989 $ height= 20;986 $params['height'] = 20; 990 987 } 991 988 992 989 // Backpat 993 990 if ( isset( $bp->avatar->full->width ) || isset( $bp->avatar->thumb->width ) ) { 994 $ width = ( 'full' == $type) ? $bp->avatar->full->width : $bp->avatar->thumb->width;991 $params['width'] = ( 'full' == $params['type'] ) ? $bp->avatar->full->width : $bp->avatar->thumb->width; 995 992 } else { 996 $ width= 20;993 $params['width'] = 20; 997 994 } 998 995 999 996 } … … 1003 1000 $current_activity_item = isset( $activities_template->activity->current_comment ) ? $activities_template->activity->current_comment : $activities_template->activity; 1004 1001 1005 1002 // Primary activity avatar is always a user, but can be modified via a filter 1006 $ object= apply_filters( 'bp_get_activity_avatar_object_' . $current_activity_item->component, 'user' );1007 $ item_id = $user_id ? $user_id: $current_activity_item->user_id;1008 $ item_id = apply_filters( 'bp_get_activity_avatar_item_id', $item_id);1003 $params['object'] = apply_filters( 'bp_get_activity_avatar_object_' . $current_activity_item->component, 'user' ); 1004 $params['item_id'] = $params['item_id'] ? $params['item_id'] : $current_activity_item->user_id; 1005 $params['item_id'] = apply_filters( 'bp_get_activity_avatar_item_id', $params['item_id'] ); 1009 1006 1010 1007 // If this is a user object pass the users' email address for Gravatar so we don't have to refetch it. 1011 if ( 'user' == $ object && empty( $user_id ) && empty( $email) && isset( $activities_template->activity->user_email ) )1012 $ email= $current_activity_item->user_email;1008 if ( 'user' == $params['object'] && empty( $params['item_id'] ) && empty( $params['email'] ) && isset( $activities_template->activity->user_email ) ) 1009 $params['email'] = $current_activity_item->user_email; 1013 1010 1014 return apply_filters( 'bp_get_activity_avatar', bp_core_fetch_avatar( array( 'item_id' => $item_id, 'object' => $object, 'type' => $type, 'alt' => $alt, 'class' => $class, 'width' => $width, 'height' => $height, 'email' => $email )) );1011 return apply_filters( 'bp_get_activity_avatar', bp_core_fetch_avatar( $params ) ); 1015 1012 } 1016 1013 1017 1014 /** … … 1044 1041 * 1045 1042 * @return string The secondary avatar 1046 1043 */ 1047 function bp_get_activity_secondary_avatar( $args = '') {1044 function bp_get_activity_secondary_avatar( $args = array() ) { 1048 1045 global $activities_template; 1049 1046 1050 $r = wp_parse_args( $args, array( 1051 'alt' => '', 1052 'type' => 'thumb', 1047 /** 1048 * The 'linked' and 'link_class' parameters are only used for this function. 1049 * They will have no effect elsewhere. 1050 */ 1051 $params = wp_parse_args( $args, array( 1053 1052 'width' => 20, 1054 1053 'height' => 20, 1055 'class' => 'avatar',1056 1054 'link_class' => '', 1057 1055 'linked' => true, 1058 'email' => false1059 1056 ) ); 1060 extract( $r, EXTR_SKIP );1061 1057 1058 // Make sure link is set if needed 1059 if ( !empty( $params['linked'] ) ) 1060 $link = ''; 1061 1062 1062 // Set item_id and object (default to user) 1063 1063 switch ( $activities_template->activity->component ) { 1064 1064 case 'groups' : 1065 $ object= 'group';1066 $ item_id= $activities_template->activity->item_id;1065 $params['object'] = 'group'; 1066 $params['item_id'] = $activities_template->activity->item_id; 1067 1067 1068 1068 // Only if groups is active 1069 1069 if ( bp_is_active( 'groups' ) ) { 1070 $group = groups_get_group( $ item_id);1070 $group = groups_get_group( $params['item_id'] ); 1071 1071 $link = bp_get_group_permalink( $group ); 1072 1072 $name = $group->name; 1073 1073 } else { … … 1075 1075 } 1076 1076 1077 1077 if ( empty( $alt ) ) { 1078 $ alt= __( 'Group logo', 'buddypress' );1078 $params['alt'] = __( 'Group logo', 'buddypress' ); 1079 1079 1080 1080 if ( ! empty( $name ) ) { 1081 $ alt= sprintf( __( 'Group logo of %s', 'buddypress' ), $name );1081 $params['alt'] = sprintf( __( 'Group logo of %s', 'buddypress' ), $name ); 1082 1082 } 1083 1083 } 1084 1084 1085 1085 break; 1086 1086 case 'blogs' : 1087 $ object= 'blog';1088 $ item_id= $activities_template->activity->item_id;1089 $link = home_url();1087 $params['object'] = 'blog'; 1088 $params['item_id'] = $activities_template->activity->item_id; 1089 $link = home_url(); 1090 1090 1091 if ( empty( $ alt) ) {1092 $ alt = sprintf( __( 'Profile picture of the author of the site %s', 'buddypress' ), get_blog_option( $item_id, 'blogname' ) );1091 if ( empty( $params['alt'] ) ) { 1092 $params['alt'] = sprintf( __( 'Profile picture of the author of the site %s', 'buddypress' ), get_blog_option( $params['item_id'], 'blogname' ) ); 1093 1093 } 1094 1094 1095 1095 break; 1096 1096 case 'friends' : 1097 $ object= 'user';1098 $ item_id= $activities_template->activity->secondary_item_id;1099 $link = bp_core_get_userlink( $item_id);1097 $params['object'] = 'user'; 1098 $params['item_id'] = $activities_template->activity->secondary_item_id; 1099 $link = bp_core_get_userlink( $params['item_id'] ); 1100 1100 1101 if ( empty( $ alt) ) {1102 $ alt= sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $activities_template->activity->secondary_item_id ) );1101 if ( empty( $params['alt'] ) ) { 1102 $params['alt'] = sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $activities_template->activity->secondary_item_id ) ); 1103 1103 } 1104 1104 1105 1105 break; 1106 1106 default : 1107 $ object= 'user';1108 $ item_id= $activities_template->activity->user_id;1109 $ email= $activities_template->activity->user_email;1110 $link = bp_core_get_userlink( $item_id);1107 $params['object'] = 'user'; 1108 $params['item_id'] = $activities_template->activity->user_id; 1109 $params['email'] = $activities_template->activity->user_email; 1110 $link = bp_core_get_userlink( $params['item_id'] ); 1111 1111 1112 if ( empty( $ alt) ) {1113 $ alt= sprintf( __( 'Profile picture of %s', 'buddypress' ), $activities_template->activity->display_name );1112 if ( empty( $params['alt'] ) ) { 1113 $params['alt'] = sprintf( __( 'Profile picture of %s', 'buddypress' ), $activities_template->activity->display_name ); 1114 1114 } 1115 1115 1116 1116 break; 1117 1117 } 1118 1118 1119 1119 // Allow object, item_id, and link to be filtered 1120 $ object = apply_filters( 'bp_get_activity_secondary_avatar_object_' . $activities_template->activity->component, $object);1121 $ item_id = apply_filters( 'bp_get_activity_secondary_avatar_item_id', $item_id);1120 $params['object'] = apply_filters( 'bp_get_activity_secondary_avatar_object_' . $activities_template->activity->component, $params['object'] ); 1121 $params['item_id'] = apply_filters( 'bp_get_activity_secondary_avatar_item_id', $params['item_id'] ); 1122 1122 1123 1123 // If we have no item_id or object, there is no avatar to display 1124 if ( empty( $ item_id ) || empty( $object) ) {1124 if ( empty( $params['item_id'] ) || empty( $params['object'] ) ) { 1125 1125 return false; 1126 1126 } 1127 1127 1128 1128 // Get the avatar 1129 $avatar = bp_core_fetch_avatar( array( 1130 'item_id' => $item_id, 1131 'object' => $object, 1132 'type' => $type, 1133 'alt' => $alt, 1134 'class' => $class, 1135 'width' => $width, 1136 'height' => $height, 1137 'email' => $email 1138 ) ); 1129 $avatar = bp_core_fetch_avatar( $params ); 1139 1130 1140 if ( !empty( $ linked) ) {1131 if ( !empty( $params['linked'] ) ) { 1141 1132 $link = apply_filters( 'bp_get_activity_secondary_avatar_link', $link, $activities_template->activity->component ); 1142 1133 1143 return sprintf( '<a href="% s" class="%s">%s</a>',1134 return sprintf( '<a href="%1$s" class="%2$s">%3$s</a>', 1144 1135 $link, 1145 $ link_class,1136 $params['link_class'], 1146 1137 apply_filters( 'bp_get_activity_secondary_avatar', $avatar ) 1147 1138 ); 1148 1139 } … … 2565 2556 * @since BuddyPress (1.7) 2566 2557 */ 2567 2558 function bp_activity_comments_user_avatars( $args = array() ) { 2568 $defaults = array(2569 'height' => false,2570 'html' => true,2571 'type' => 'thumb',2572 'width' => false,2573 );2574 2559 2575 $args = wp_parse_args( $args, $defaults );2576 extract( $args, EXTR_SKIP );2577 2578 2560 // Get the user IDs of everyone who has left a comment to the current activity item 2579 2561 $user_ids = bp_activity_get_comments_user_ids(); 2580 2562 2581 2563 $output = array(); 2582 2564 foreach ( (array) $user_ids as $user_id ) { 2583 $profile_link = bp_core_get_user_domain( $user_id ); 2584 $image_html = bp_core_fetch_avatar( array( 'item_id' => $user_id, 'height' => $height, 'html' => $html, 'type' => $type, 'width' => $width, ) ); 2565 $args['item_id'] = $user_id; 2566 $image_html = bp_core_fetch_avatar( $args ); 2567 $profile_link = bp_core_get_user_domain( $user_id ); 2585 2568 2586 2569 $output[] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $profile_link ), $image_html ); 2587 2570 } -
bp-blogs/bp-blogs-loader.php
203 203 // If we are not viewing the logged in user, set up the current 204 204 // users avatar and name 205 205 } else { 206 $bp->bp_options_avatar = bp_core_fetch_avatar( array( 207 'item_id' => bp_displayed_user_id(), 208 'type' => 'thumb', 209 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() ) 210 ) ); 206 $bp->bp_options_avatar = bp_get_displayed_user_avatar(); 211 207 $bp->bp_options_title = bp_get_displayed_user_fullname(); 212 208 } 213 209 } -
bp-blogs/bp-blogs-template.php
270 270 return apply_filters( 'bp_get_blogs_pagination_links', $blogs_template->pag_links ); 271 271 } 272 272 273 function bp_blog_avatar( $args = '') {273 function bp_blog_avatar( $args = array() ) { 274 274 echo bp_get_blog_avatar( $args ); 275 275 } 276 function bp_get_blog_avatar( $args = '') {276 function bp_get_blog_avatar( $args = array() ) { 277 277 global $blogs_template; 278 278 279 $ defaults =array(279 $params = wp_parse_args( $args, array( 280 280 'type' => 'full', 281 'width' => false,282 'height' => false,283 'class' => 'avatar',284 'id' => false,285 281 'alt' => sprintf( __( 'Profile picture of site author %s', 'buddypress' ), bp_core_get_user_displayname( $blogs_template->blog->admin_user_id ) ), 286 'no_grav' => true 287 ) ;282 'no_grav' => true, 283 ) ); 288 284 289 $r = wp_parse_args( $args, $defaults ); 290 extract( $r, EXTR_SKIP ); 285 // These cannot be overridden. They are specifically required by the function 286 $params['item_id'] = $blogs_template->blog->admin_user_id; 287 $params['email'] = $blogs_template->blog->admin_user_email; 291 288 292 289 /*** 293 290 * In future BuddyPress versions you will be able to set the avatar for a blog. … … 297 294 * This filter is deprecated as of BuddyPress 1.5 and may be removed in a future version. 298 295 * Use the 'bp_get_blog_avatar' filter instead. 299 296 */ 300 $avatar = apply_filters( 'bp_get_blog_avatar_' . $blogs_template->blog->blog_id, bp_core_fetch_avatar( array( 'item_id' => $blogs_template->blog->admin_user_id, 'type' => $type, 'alt' => $alt, 'width' => $width, 'height' => $height, 'class' => $class, 'email' => $blogs_template->blog->admin_user_email )) );297 $avatar = apply_filters( 'bp_get_blog_avatar_' . $blogs_template->blog->blog_id, bp_core_fetch_avatar( $params ) ); 301 298 302 return apply_filters( 'bp_get_blog_avatar', $avatar, $blogs_template->blog->blog_id, array( 'item_id' => $blogs_template->blog->admin_user_id, 'type' => $type, 'alt' => $alt, 'width' => $width, 'height' => $height, 'class' => $class, 'email' => $blogs_template->blog->admin_user_email ));299 return apply_filters( 'bp_get_blog_avatar', $avatar, $blogs_template->blog->blog_id, $params ); 303 300 } 304 301 305 302 function bp_blog_permalink() { -
bp-core/bp-core-avatars.php
103 103 104 104 $bp = buddypress(); 105 105 106 // Set a few default variables107 $def_object = 'user';108 $def_type = 'thumb';109 $def_class = 'avatar';110 111 106 // Set the default variables array 112 107 $params = wp_parse_args( $args, array( 113 108 'item_id' => false, 114 'object' => $def_object,// user/group/blog/custom type (if you use filters)115 'type' => $def_type,// thumb or full109 'object' => 'user', // user/group/blog/custom type (if you use filters) 110 'type' => 'thumb', // thumb or full 116 111 'avatar_dir' => false, // Specify a custom avatar directory for your object 117 112 'width' => false, // Custom width (int) 118 113 'height' => false, // Custom height (int) 119 'class' => $def_class,// Custom <img> class (string)114 'class' => 'avatar', // Custom <img> class (string) 120 115 'css_id' => false, // Custom <img> ID (string) 121 116 'alt' => '', // Custom <img> alt (string) 122 117 'email' => false, // Pass the user email (for gravatar) to prevent querying the DB for it … … 327 322 // Return it wrapped in an <img> element 328 323 if ( true === $html ) { 329 324 return apply_filters( 'bp_core_fetch_avatar', '<img src="' . $avatar_url . '" class="' . esc_attr( $class ) . '"' . $css_id . $html_width . $html_height . $html_alt . $title . ' />', $params, $item_id, $avatar_dir, $css_id, $html_width, $html_height, $avatar_folder_url, $avatar_folder_dir ); 330 325 331 326 // ...or only the URL 332 327 } else { 333 328 return apply_filters( 'bp_core_fetch_avatar_url', $avatar_url ); … … 375 370 376 371 // Filter gravatar vars 377 372 $email = apply_filters( 'bp_core_gravatar_email', $email, $item_id, $object ); 378 $gravatar = apply_filters( 'bp_gravatar_url', $host ) . md5( strtolower( $email ) ) . '?d=' . $default_grav. '&s=' . $grav_size;373 $gravatar = apply_filters( 'bp_gravatar_url', $host ) . md5( strtolower( trim( $email ) ) ) . '?d=' . urlencode( $default_grav ) . '&s=' . $grav_size; 379 374 380 375 // Gravatar rating; http://bit.ly/89QxZA 381 $rating = get_option( 'avatar_rating');376 $rating = strtolower( get_option( 'avatar_rating' ) ); 382 377 if ( ! empty( $rating ) ) { 383 378 $gravatar .= "&r={$rating}"; 384 379 } -
bp-core/bp-core-classes.php
711 711 wp_cache_set( 'bp_user_url_' . $this->id, $this->user_url, 'bp' ); 712 712 713 713 $this->avatar = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'type' => 'full', 'alt' => sprintf( __( 'Avatar of %s', 'buddypress' ), $this->fullname ) ) ); 714 $this->avatar_thumb = bp_core_fetch_avatar( array( 'item_id' => $this->id, ' type' => 'thumb', 'alt' => sprintf( __( 'Avatar of %s', 'buddypress' ), $this->fullname ) ) );715 $this->avatar_mini = bp_core_fetch_avatar( array( 'item_id' => $this->id, ' type' => 'thumb', 'alt' => sprintf( __( 'Avatar of %s', 'buddypress' ), $this->fullname ), 'width' => 30, 'height' => 30 ) );714 $this->avatar_thumb = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'alt' => sprintf( __( 'Avatar of %s', 'buddypress' ), $this->fullname ) ) ); 715 $this->avatar_mini = bp_core_fetch_avatar( array( 'item_id' => $this->id, 'alt' => sprintf( __( 'Avatar of %s', 'buddypress' ), $this->fullname ), 'width' => 30, 'height' => 30 ) ); 716 716 $this->last_active = bp_core_get_last_activity( bp_get_user_meta( $this->id, 'last_activity', true ), __( 'active %s', 'buddypress' ) ); 717 717 } 718 718 -
bp-core/bp-core-template.php
95 95 global $comment; 96 96 97 97 if ( function_exists( 'bp_core_fetch_avatar' ) ) 98 echo apply_filters( 'bp_comment_author_avatar', bp_core_fetch_avatar( array( 'item_id' => $comment->user_id, ' type' => 'thumb', 'alt' => sprintf( __( 'Avatar of %s', 'buddypress' ), bp_core_get_user_displayname( $comment->user_id ) ) ) ) );98 echo apply_filters( 'bp_comment_author_avatar', bp_core_fetch_avatar( array( 'item_id' => $comment->user_id, 'alt' => sprintf( __( 'Avatar of %s', 'buddypress' ), bp_core_get_user_displayname( $comment->user_id ) ) ) ) ); 99 99 else if ( function_exists('get_avatar') ) 100 100 get_avatar(); 101 101 } … … 104 104 global $post; 105 105 106 106 if ( function_exists( 'bp_core_fetch_avatar' ) ) 107 echo apply_filters( 'bp_post_author_avatar', bp_core_fetch_avatar( array( 'item_id' => $post->post_author, ' type' => 'thumb', 'alt' => sprintf( __( 'Avatar of %s', 'buddypress' ), bp_core_get_user_displayname( $post->post_author ) ) ) ) );107 echo apply_filters( 'bp_post_author_avatar', bp_core_fetch_avatar( array( 'item_id' => $post->post_author, 'alt' => sprintf( __( 'Avatar of %s', 'buddypress' ), bp_core_get_user_displayname( $post->post_author ) ) ) ) ); 108 108 else if ( function_exists('get_avatar') ) 109 109 get_avatar(); 110 110 } -
bp-forums/bp-forums-loader.php
206 206 if ( bp_is_my_profile() ) { 207 207 $bp->bp_options_title = __( 'Forums', 'buddypress' ); 208 208 } else { 209 $bp->bp_options_avatar = bp_core_fetch_avatar( array( 210 'item_id' => bp_displayed_user_id(), 211 'type' => 'thumb', 212 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() ) 213 ) ); 209 $bp->bp_options_avatar = bp_get_displayed_user_avatar(); 214 210 $bp->bp_options_title = bp_get_displayed_user_fullname(); 215 211 } 216 212 } -
bp-forums/bp-forums-template.php
474 474 return apply_filters( 'bp_get_the_topic_poster_id', $forum_template->topic->topic_poster ); 475 475 } 476 476 477 function bp_the_topic_poster_avatar( $args = '') {477 function bp_the_topic_poster_avatar( $args = array() ) { 478 478 echo bp_get_the_topic_poster_avatar( $args ); 479 479 } 480 function bp_get_the_topic_poster_avatar( $args = '') {480 function bp_get_the_topic_poster_avatar( $args = array() ) { 481 481 global $forum_template; 482 482 483 $defaults = array( 484 'type' => 'thumb', 485 'width' => false, 486 'height' => false, 487 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $forum_template->topic->topic_poster ) ) 488 ); 483 $params = wp_parse_args( $args, array( 484 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $forum_template->topic->topic_poster ) ) 485 ) ); 489 486 490 $r = wp_parse_args( $args, $defaults );491 extract( $r, EXTR_SKIP );487 // This cannot be overridden. It is specifically required by the function 488 $params['item_id'] = $forum_template->topic->topic_poster; 492 489 493 return apply_filters( 'bp_get_the_topic_poster_avatar', bp_core_fetch_avatar( array( 'item_id' => $forum_template->topic->topic_poster, 'type' => $type, 'width' => $width, 'height' => $height, 'alt' => $alt )) );490 return apply_filters( 'bp_get_the_topic_poster_avatar', bp_core_fetch_avatar( $params ) ); 494 491 } 495 492 496 493 function bp_the_topic_poster_name() { … … 569 566 return apply_filters( 'bp_get_the_topic_last_poster_name', '<a href="' . $domain . '">' . $forum_template->topic->topic_last_poster_displayname . '</a>' ); 570 567 } 571 568 572 function bp_the_topic_object_avatar( $args = '') {569 function bp_the_topic_object_avatar( $args = array() ) { 573 570 echo bp_get_the_topic_object_avatar( $args ); 574 571 } 575 function bp_get_the_topic_object_avatar( $args = '') {572 function bp_get_the_topic_object_avatar( $args = array() ) { 576 573 global $forum_template; 577 574 578 575 if ( !isset( $forum_template->topic->object_id ) ) 579 576 return false; 580 577 581 $defaults = array( 582 'type' => 'thumb', 583 'width' => false, 584 'height' => false, 585 'alt' => __( 'Group logo for %s', 'buddypress' ) 586 ); 578 $params = wp_parse_args( $args, array( 579 'alt' => __( 'Group logo for %s', 'buddypress' ) 580 ) ); 587 581 588 $r = wp_parse_args( $args, $defaults );589 extract( $r, EXTR_SKIP );582 // This cannot be overridden. It is specifically required by the function 583 $params['item_id'] = $forum_template->topic->object_id; 590 584 591 return apply_filters( 'bp_get_the_topic_object_avatar', bp_core_fetch_avatar( array( 'item_id' => $forum_template->topic->object_id, 'type' => $type, 'object' => 'group', 'width' => $width, 'height' => $height, 'alt' => $alt )) );585 return apply_filters( 'bp_get_the_topic_object_avatar', bp_core_fetch_avatar( $params ) ); 592 586 } 593 587 594 function bp_the_topic_last_poster_avatar( $args = '') {588 function bp_the_topic_last_poster_avatar( $args = array() ) { 595 589 echo bp_get_the_topic_last_poster_avatar( $args ); 596 590 } 597 function bp_get_the_topic_last_poster_avatar( $args = '') {591 function bp_get_the_topic_last_poster_avatar( $args = array() ) { 598 592 global $forum_template; 599 593 600 $defaults = array( 601 'type' => 'thumb', 602 'width' => false, 603 'height' => false, 604 'alt' => __( 'Profile picture of %s', 'buddypress' ) 605 ); 594 $params = wp_parse_args( $args, array( 595 'alt' => __( 'Profile picture of %s', 'buddypress' ) 596 ) ); 606 597 607 $r = wp_parse_args( $args, $defaults ); 608 extract( $r, EXTR_SKIP ); 598 // These cannot be overridden. They are specifically required by the function 599 $params['item_id'] = $forum_template->topic->topic_last_poster; 600 $params['email'] = $forum_template->topic->topic_last_poster_email; 609 601 610 return apply_filters( 'bp_get_the_topic_last_poster_avatar', bp_core_fetch_avatar( array( 'email' => $forum_template->topic->topic_last_poster_email, 'item_id' => $forum_template->topic->topic_last_poster, 'type' => $type, 'width' => $width, 'height' => $height, 'alt' => $alt )) );602 return apply_filters( 'bp_get_the_topic_last_poster_avatar', bp_core_fetch_avatar( $params ) ); 611 603 } 612 604 613 605 function bp_the_topic_start_time() { … … 1187 1179 return apply_filters( 'bp_get_the_topic_post_css_class', trim( $class ) ); 1188 1180 } 1189 1181 1190 function bp_the_topic_post_poster_avatar( $args = '') {1182 function bp_the_topic_post_poster_avatar( $args = array() ) { 1191 1183 echo bp_get_the_topic_post_poster_avatar( $args ); 1192 1184 } 1193 function bp_get_the_topic_post_poster_avatar( $args = '') {1185 function bp_get_the_topic_post_poster_avatar( $args = array() ) { 1194 1186 global $topic_template; 1195 1187 1196 $defaults = array( 1197 'type' => 'thumb', 1198 'width' => 20, 1188 $params = wp_parse_args( $args, array( 1189 'width' => 20, 1199 1190 'height' => 20, 1200 'alt' => __( 'Profile picture of %s', 'buddypress' )1201 ) ;1191 'alt' => __( 'Profile picture of %s', 'buddypress' ) 1192 ) ); 1202 1193 1203 $r = wp_parse_args( $args, $defaults );1204 extract( $r, EXTR_SKIP );1194 // This cannot be overridden. It is specifically required by the function 1195 $params['item_id'] = $topic_template->post->poster_id; 1205 1196 1206 return apply_filters( 'bp_get_the_topic_post_poster_avatar', bp_core_fetch_avatar( array( 'item_id' => $topic_template->post->poster_id, 'type' => $type, 'width' => $width, 'height' => $height, 'alt' => $alt )) );1197 return apply_filters( 'bp_get_the_topic_post_poster_avatar', bp_core_fetch_avatar( $params ) ); 1207 1198 } 1208 1199 1209 1200 function bp_the_topic_post_poster_name() { -
bp-friends/bp-friends-loader.php
206 206 if ( bp_is_my_profile() ) { 207 207 $bp->bp_options_title = __( 'Friendships', 'buddypress' ); 208 208 } else { 209 $bp->bp_options_avatar = bp_core_fetch_avatar( array( 210 'item_id' => bp_displayed_user_id(), 211 'type' => 'thumb', 212 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() ) 213 ) ); 214 $bp->bp_options_title = bp_get_displayed_user_fullname(); 209 $bp->bp_options_avatar = bp_get_displayed_user_avatar(); 210 $bp->bp_options_title = bp_get_displayed_user_fullname(); 215 211 } 216 212 } 217 213 -
bp-friends/bp-friends-template.php
75 75 <?php for ( $i = 0, $count = count( $friend_ids ); $i < $count; ++$i ) { ?> 76 76 77 77 <li> 78 <a href="<?php echo bp_core_get_user_domain( $friend_ids[$i] ) ?>"><?php echo bp_core_fetch_avatar( array( 'item_id' => $friend_ids[$i] , 'type' => 'thumb') ) ?></a>78 <a href="<?php echo bp_core_get_user_domain( $friend_ids[$i] ) ?>"><?php echo bp_core_fetch_avatar( array( 'item_id' => $friend_ids[$i] ) ) ?></a> 79 79 <h5><?php echo bp_core_get_userlink($friend_ids[$i]) ?></h5> 80 80 </li> 81 81 … … 122 122 <?php for ( $i = 0, $count = count( $user_ids['users'] ); $i < $count; ++$i ) { ?> 123 123 124 124 <li> 125 <a href="<?php echo bp_core_get_user_domain( $user_ids['users'][$i]->id ) ?>"><?php echo bp_core_fetch_avatar( array( 'item_id' => $user_ids['users'][$i]->id , 'type' => 'thumb') ) ?></a>125 <a href="<?php echo bp_core_get_user_domain( $user_ids['users'][$i]->id ) ?>"><?php echo bp_core_fetch_avatar( array( 'item_id' => $user_ids['users'][$i]->id ) ) ?></a> 126 126 <h5><?php echo bp_core_get_userlink( $user_ids['users'][$i]->id ) ?></h5> 127 127 128 128 <?php if ( bp_is_active( 'xprofile' ) ) { ?> -
bp-groups/bp-groups-admin.php
770 770 <td class="uname-column"> 771 771 <a href="<?php echo $user_link ?>"><?php echo bp_core_fetch_avatar( array( 772 772 'item_id' => $type_user->user_id, 773 'width' => '32',774 'height' => '32'775 ) ) ?></a>773 'width' => 32, 774 'height' => 32 775 ) ); ?></a> 776 776 777 777 <?php echo bp_core_get_userlink( $type_user->user_id ) ?> 778 778 </td> … … 1232 1232 1233 1233 // Get group name and avatar 1234 1234 $avatar = bp_core_fetch_avatar( array( 1235 'item_id' => $item['id'], 1236 'object' => 'group', 1237 'type' => 'thumb', 1238 'avatar_dir' => 'group-avatars', 1239 'alt' => sprintf( __( 'Group logo of %s', 'buddypress' ), $item['name'] ), 1240 'width' => '32', 1241 'height' => '32', 1242 'title' => $item['name'] 1235 'item_id' => $item['id'], 1236 'object' => 'group', 1237 'alt' => sprintf( __( 'Group logo of %s', 'buddypress' ), $item['name'] ), 1238 'width' => 32, 1239 'height' => 32, 1240 'title' => $item['name'] 1243 1241 ) ); 1244 1242 1245 1243 $content = apply_filters_ref_array( 'bp_get_group_name', array( $item['name'], $item ) ); -
bp-groups/bp-groups-loader.php
566 566 567 567 } else if ( !bp_is_my_profile() && !bp_is_single_item() ) { 568 568 569 $bp->bp_options_avatar = bp_core_fetch_avatar( array( 570 'item_id' => bp_displayed_user_id(), 571 'type' => 'thumb', 572 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() ) 573 ) ); 574 $bp->bp_options_title = bp_get_displayed_user_fullname(); 569 $bp->bp_options_avatar = bp_get_displayed_user_avatar(); 570 $bp->bp_options_title = bp_get_displayed_user_fullname(); 575 571 576 572 // We are viewing a single group, so set up the 577 573 // group navigation menu using the $this->current_group global. 578 574 } else if ( bp_is_single_item() ) { 579 575 $bp->bp_options_title = $this->current_group->name; 580 576 $bp->bp_options_avatar = bp_core_fetch_avatar( array( 581 'item_id' => $this->current_group->id, 582 'object' => 'group', 583 'type' => 'thumb', 584 'avatar_dir' => 'group-avatars', 585 'alt' => __( 'Group Avatar', 'buddypress' ) 577 'item_id' => $this->current_group->id, 578 'object' => 'group', 579 'alt' => __( 'Group Avatar', 'buddypress' ) 586 580 ) ); 587 581 if ( empty( $bp->bp_options_avatar ) ) { 588 582 $bp->bp_options_avatar = '<img src="' . esc_attr( $group->avatar_full ) . '" class="avatar" alt="' . esc_attr( $group->name ) . '" />'; -
bp-groups/bp-groups-template.php
479 479 return apply_filters( 'bp_get_group_status', $group->status ); 480 480 } 481 481 482 function bp_group_avatar( $args = '') {482 function bp_group_avatar( $args = array() ) { 483 483 echo bp_get_group_avatar( $args ); 484 484 } 485 function bp_get_group_avatar( $args = '') {486 global $ bp, $groups_template;485 function bp_get_group_avatar( $args = array() ) { 486 global $groups_template; 487 487 488 $defaults = array( 489 'type' => 'full', 490 'width' => false, 491 'height' => false, 492 'class' => 'avatar', 493 'id' => false, 494 'alt' => sprintf( __( 'Group logo of %s', 'buddypress' ), $groups_template->group->name ) 495 ); 488 $params = wp_parse_args( $args, array( 489 'type' => 'full', 490 'title' => $groups_template->group->name, 491 'alt' => sprintf( __( 'Group logo of %s', 'buddypress' ), $groups_template->group->name ) 492 ) ); 496 493 497 $r = wp_parse_args( $args, $defaults ); 498 extract( $r, EXTR_SKIP ); 494 // These cannot be overridden. They are specifically required by the function 495 $params['item_id'] = $groups_template->group->id; 496 $params['object'] = 'group'; 499 497 500 / * Fetch the avatar from the folder, if not provide backwards compat. */501 if ( !$avatar = bp_core_fetch_avatar( array( 'item_id' => $groups_template->group->id, 'object' => 'group', 'type' => $type, 'avatar_dir' => 'group-avatars', 'alt' => $alt, 'css_id' => $id, 'class' => $class, 'width' => $width, 'height' => $height, 'title' => $groups_template->group->name, 'alt' => $alt )) )498 // Fetch the avatar from the folder, if not provide backwards compat. 499 if ( !$avatar = bp_core_fetch_avatar( $params ) ) 502 500 $avatar = '<img src="' . esc_attr( $groups_template->group->avatar_thumb ) . '" class="avatar" alt="' . esc_attr( $groups_template->group->name ) . '" />'; 503 501 504 502 return apply_filters( 'bp_get_group_avatar', $avatar ); … … 651 649 652 650 return apply_filters( 'bp_get_group_date_created', bp_core_time_since( strtotime( $group->date_created ) ) ); 653 651 } 654 652 655 653 function bp_group_creator_username( $group = false ) { 656 654 echo bp_get_group_creator_username( $group ); 657 655 } 658 656 function bp_get_group_creator_username( $group = false ) { 659 657 global $groups_template; 660 658 661 659 if ( empty( $group ) ) 662 660 $group =& $groups_template->group; 663 661 664 662 return apply_filters( 'bp_get_group_creator_username', bp_core_get_user_displayname( $group->creator_id ) ); 665 } 663 } 666 664 667 665 function bp_group_creator_id( $group = false ) { 668 666 echo bp_get_group_creator_id( $group ); 669 667 } 670 668 function bp_get_group_creator_id( $group = false ) { 671 669 global $groups_template; 672 670 673 671 if ( empty( $group ) ) 674 672 $group =& $groups_template->group; 675 673 676 674 return apply_filters( 'bp_get_group_creator_id', $group->creator_id ); 677 } 675 } 678 676 679 677 function bp_group_creator_permalink( $group = false ) { 680 678 echo bp_get_group_creator_permalink( $group ); … … 686 684 $group =& $groups_template->group; 687 685 688 686 return apply_filters( 'bp_get_group_creator_permalink', bp_core_get_user_domain( $group->creator_id ) ); 689 } 687 } 690 688 691 689 function bp_is_group_creator( $group = false, $user_id = 0 ) { 692 690 global $groups_template; 693 691 694 692 if ( empty( $group ) ) 695 693 $group =& $groups_template->group; 696 694 697 695 if ( empty( $user_id ) ) 698 696 $user_id = bp_loggedin_user_id(); 699 697 … … 709 707 if ( empty( $group ) ) 710 708 $group =& $groups_template->group; 711 709 712 $defaults = array( 713 'type' => 'full', 714 'width' => false, 715 'height' => false, 716 'class' => 'avatar', 717 'id' => false, 718 'alt' => sprintf( __( 'Group creator avatar of %s', 'buddypress' ), bp_core_get_user_displayname( $group->creator_id ) ) 719 ); 710 $params = wp_parse_args( $args, array( 711 'type' => 'full', 712 'alt' => sprintf( __( 'Group creator avatar of %s', 'buddypress' ), bp_core_get_user_displayname( $group->creator_id ) ) 713 ) ); 720 714 721 $r = wp_parse_args( $args, $defaults );722 extract( $r, EXTR_SKIP );715 // This cannot be overrridden. It is specifically required by the function 716 $params['item_id'] = $group->creator_id; 723 717 724 $avatar = bp_core_fetch_avatar( array( 'item_id' => $group->creator_id, 'type' => $type, 'css_id' => $id, 'class' => $class, 'width' => $width, 'height' => $height, 'alt' => $alt ) ); 725 726 return apply_filters( 'bp_get_group_creator_avatar', $avatar ); 718 return apply_filters( 'bp_get_group_creator_avatar', bp_core_fetch_avatar( $params ) ); 727 719 } 728 720 729 721 730 722 function bp_group_is_admin() { 731 723 return bp_is_item_admin(); 732 724 } … … 1197 1189 1198 1190 <li> 1199 1191 1200 <?php echo bp_core_fetch_avatar( array( 'item_id' => $admin->user_id, ' type' => 'thumb', 'width' => 30, 'height' => 30, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $admin->user_id ) ) ) ) ?>1192 <?php echo bp_core_fetch_avatar( array( 'item_id' => $admin->user_id, 'width' => 30, 'height' => 30, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $admin->user_id ) ) ) ) ?> 1201 1193 1202 1194 <h5> 1203 1195 … … 1213 1205 1214 1206 <li> 1215 1207 1216 <?php echo bp_core_fetch_avatar( array( 'item_id' => $admin->user_id, ' type' => 'thumb', 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $admin->user_id ) ) ) ) ?>1208 <?php echo bp_core_fetch_avatar( array( 'item_id' => $admin->user_id, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $admin->user_id ) ) ) ) ?> 1217 1209 1218 1210 <h5><?php echo bp_core_get_userlink( $admin->user_id ) ?></h5> 1219 1211 <span class="activity"> … … 1262 1254 1263 1255 <li> 1264 1256 1265 <?php echo bp_core_fetch_avatar( array( 'item_id' => $mod->user_id, ' type' => 'thumb', 'width' => 30, 'height' => 30, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $mod->user_id ) ) ) ) ?>1257 <?php echo bp_core_fetch_avatar( array( 'item_id' => $mod->user_id, 'width' => 30, 'height' => 30, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $mod->user_id ) ) ) ) ?> 1266 1258 1267 1259 <h5> 1268 1260 <?php echo bp_core_get_userlink( $mod->user_id ); ?> … … 1278 1270 1279 1271 <li> 1280 1272 1281 <?php echo bp_core_fetch_avatar( array( 'item_id' => $mod->user_id, ' type' => 'thumb', 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $mod->user_id ) ) ) ) ?>1273 <?php echo bp_core_fetch_avatar( array( 'item_id' => $mod->user_id, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $mod->user_id ) ) ) ) ?> 1282 1274 1283 1275 <h5><?php echo bp_core_get_userlink( $mod->user_id ) ?></h5> 1284 1276 … … 1998 1990 function bp_get_group_member_avatar_thumb() { 1999 1991 global $members_template; 2000 1992 2001 return apply_filters( 'bp_get_group_member_avatar_thumb', bp_core_fetch_avatar( array( 'item_id' => $members_template->member->user_id, ' type' => 'thumb', 'email' => $members_template->member->user_email, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $members_template->member->display_name ) ) ) );1993 return apply_filters( 'bp_get_group_member_avatar_thumb', bp_core_fetch_avatar( array( 'item_id' => $members_template->member->user_id, 'email' => $members_template->member->user_email, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $members_template->member->display_name ) ) ) ); 2002 1994 } 2003 1995 2004 1996 function bp_group_member_avatar_mini( $width = 30, $height = 30 ) { … … 2007 1999 function bp_get_group_member_avatar_mini( $width = 30, $height = 30 ) { 2008 2000 global $members_template; 2009 2001 2010 return apply_filters( 'bp_get_group_member_avatar_mini', bp_core_fetch_avatar( array( 'item_id' => $members_template->member->user_id, ' type' => 'thumb', 'width' => $width, 'height' => $height, 'email' => $members_template->member->user_email, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $members_template->member->display_name ) ) ) );2002 return apply_filters( 'bp_get_group_member_avatar_mini', bp_core_fetch_avatar( array( 'item_id' => $members_template->member->user_id, 'width' => $width, 'height' => $height, 'email' => $members_template->member->user_email, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $members_template->member->display_name ) ) ) ); 2011 2003 } 2012 2004 2013 2005 function bp_group_member_name() { … … 2344 2336 return apply_filters( 'bp_get_new_group_status', $bp->groups->current_group->status ); 2345 2337 } 2346 2338 2347 function bp_new_group_avatar( $args = '') {2339 function bp_new_group_avatar( $args = array() ) { 2348 2340 echo bp_get_new_group_avatar( $args ); 2349 2341 } 2350 function bp_get_new_group_avatar( $args = '' ) { 2351 global $bp; 2342 function bp_get_new_group_avatar( $args = array() ) { 2343 $params = wp_parse_args( $args, array( 2344 'type' => 'full', 2345 'css_id' => 'avatar-crop-preview', 2346 'alt' => __( 'Group avatar', 'buddypress' ) 2347 ) ); 2352 2348 2353 $defaults = array( 2354 'type' => 'full', 2355 'width' => false, 2356 'height' => false, 2357 'class' => 'avatar', 2358 'id' => 'avatar-crop-preview', 2359 'alt' => __( 'Group avatar', 'buddypress' ), 2360 'no_grav' => false 2361 ); 2349 // This cannot be overridden. It is specifically required by the function 2350 $params['item_id'] = buddypress()->groups->current_group->id; 2362 2351 2363 $r = wp_parse_args( $args, $defaults ); 2364 extract( $r, EXTR_SKIP ); 2365 2366 return apply_filters( 'bp_get_new_group_avatar', bp_core_fetch_avatar( array( 'item_id' => $bp->groups->current_group->id, 'object' => 'group', 'type' => $type, 'avatar_dir' => 'group-avatars', 'alt' => $alt, 'width' => $width, 'height' => $height, 'class' => $class, 'no_grav' => $no_grav ) ) ); 2352 return apply_filters( 'bp_get_new_group_avatar', bp_core_fetch_avatar( $params ) ); 2367 2353 } 2368 2354 2369 2355 function bp_group_creation_previous_link() { … … 2593 2579 } 2594 2580 2595 2581 function bp_get_group_has_avatar() { 2596 global $bp; 2597 2598 if ( !empty( $_FILES ) || !bp_core_fetch_avatar( array( 'item_id' => $bp->groups->current_group->id, 'object' => 'group', 'no_grav' => true ) ) ) 2582 if ( !empty( $_FILES ) || !bp_core_fetch_avatar( array( 'item_id' => buddypress()->groups->current_group->id, 'object' => 'group', 'no_grav' => true ) ) ) 2599 2583 return false; 2600 2584 2601 2585 return true; … … 2755 2739 function bp_group_request_user_avatar_thumb() { 2756 2740 global $requests_template; 2757 2741 2758 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 ) ) ) ) );2742 echo apply_filters( 'bp_group_request_user_avatar_thumb', bp_core_fetch_avatar( array( 'item_id' => $requests_template->request->user_id, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $requests_template->request->user_id ) ) ) ) ); 2759 2743 } 2760 2744 2761 2745 function bp_group_request_reject_link() { -
bp-members/bp-members-loader.php
192 192 if ( bp_is_my_profile() ) { 193 193 $bp->bp_options_title = __( 'You', 'buddypress' ); 194 194 } elseif( bp_is_user() ) { 195 $bp->bp_options_avatar = bp_core_fetch_avatar( array( 196 'item_id' => bp_displayed_user_id(), 197 'type' => 'thumb', 198 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() ) 199 ) ); 200 $bp->bp_options_title = bp_get_displayed_user_fullname(); 195 $bp->bp_options_avatar = bp_get_displayed_user_avatar(); 196 $bp->bp_options_title = bp_get_displayed_user_fullname(); 201 197 } 202 198 203 199 parent::setup_title(); -
bp-members/bp-members-template.php
502 502 return apply_filters( 'bp_member_is_loggedin_user', bp_loggedin_user_id() == $members_template->member->id ? true : false ); 503 503 } 504 504 505 function bp_member_avatar( $args = '') {505 function bp_member_avatar( $args = array() ) { 506 506 echo apply_filters( 'bp_member_avatar', bp_get_member_avatar( $args ) ); 507 507 } 508 function bp_get_member_avatar( $args = '') {508 function bp_get_member_avatar( $args = array() ) { 509 509 global $members_template; 510 510 511 511 $fullname = !empty( $members_template->member->fullname ) ? $members_template->member->fullname : $members_template->member->display_name; 512 512 513 $defaults = array( 514 'type' => 'thumb', 515 'width' => false, 516 'height' => false, 517 'class' => 'avatar', 518 'id' => false, 519 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $fullname ) 520 ); 513 $params = wp_parse_args( $args, array( 514 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), $fullname ) 515 ) ); 521 516 522 $r = wp_parse_args( $args, $defaults ); 523 extract( $r, EXTR_SKIP ); 517 // These cannot be overridden. They are specifically required by the function 518 $params['item_id'] = $members_template->member->id; 519 $params['email'] = $members_template->member->user_email; 524 520 525 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 )) );521 return apply_filters( 'bp_get_member_avatar', bp_core_fetch_avatar( $params ) ); 526 522 } 527 523 528 524 function bp_member_permalink() { … … 806 802 807 803 /** Avatars *******************************************************************/ 808 804 809 function bp_loggedin_user_avatar( $args = '' ) { 805 /** 806 * Output logged in user avatar. 807 * 808 * @since BuddyPress (1.1) 809 * 810 * @param array $args Avatar args {@link bp_core_fetch_avatar()} 811 * Passing the 'item_id' or 'email' args will have no effect 812 * as they will be overwritten by bp_loggedin_user_id() 813 * and bp_get_loggedin_user_email(), respectively. 814 * 815 * @uses bp_get_loggedin_user_avatar() 816 */ 817 function bp_loggedin_user_avatar( $args = array() ) { 810 818 echo bp_get_loggedin_user_avatar( $args ); 811 819 } 812 function bp_get_loggedin_user_avatar( $args = '' ) { 820 /** 821 * Return logged in user avatar. 822 * 823 * @since BuddyPress (1.1) 824 * 825 * @param array $args Avatar args {@link bp_core_fetch_avatar()} 826 * Passing the 'item_id' or 'email' args will have no effect 827 * as they will be overwritten by bp_loggedin_user_id() 828 * and bp_get_loggedin_user_email(), respectively. 829 * 830 * @global object $bp BuddyPress global settings 831 * @uses bp_loggedin_user_id() 832 * @uses bp_get_loggedin_user_email() 833 * @uses apply_filters() to call 'bp_get_loggedin_user_avatar' hook 834 * 835 * @return string Logged in user avatar 836 */ 837 function bp_get_loggedin_user_avatar( $args = array() ) { 813 838 814 $defaults = array( 815 'type' => 'thumb', 816 'width' => false, 817 'height' => false, 818 'html' => true, 819 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_loggedin_user_fullname() ) 820 ); 839 // Setup default args 840 $params = wp_parse_args( $args, array( 841 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_loggedin_user_fullname() ) 842 ) ); 821 843 822 $r = wp_parse_args( $args, $defaults ); 823 extract( $r, EXTR_SKIP ); 844 // These cannot be overridden. They are specifically required by the function 845 $params['item_id'] = bp_loggedin_user_id(); 846 $params['email'] = bp_get_loggedin_user_email(); 824 847 825 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 )) );848 return apply_filters( 'bp_get_loggedin_user_avatar', bp_core_fetch_avatar( $params ) ); 826 849 } 827 850 828 function bp_displayed_user_avatar( $args = '' ) { 851 /** 852 * Output displayed user avatar. 853 * 854 * @since BuddyPress (1.1) 855 * 856 * @param array $args Avatar args {@link bp_core_fetch_avatar()} 857 * Passing the 'item_id' or 'email' args will have no effect 858 * as they will be overwritten by bp_displayed_user_id() 859 * and bp_get_displayed_user_email(), respectively. 860 * 861 * @uses bp_get_displayed_user_avatar() 862 */ 863 function bp_displayed_user_avatar( $args = array() ) { 829 864 echo bp_get_displayed_user_avatar( $args ); 830 865 } 831 function bp_get_displayed_user_avatar( $args = '' ) { 866 /** 867 * Return displayed user avatar. 868 * 869 * @since BuddyPress (1.1) 870 * 871 * @param array $args Avatar args {@link bp_core_fetch_avatar()} 872 * Passing the 'item_id' or 'email' args will have no effect 873 * as they will be overwritten by bp_displayed_user_id() 874 * and bp_get_displayed_user_email(), respectively. 875 * 876 * @global object $bp BuddyPress global settings 877 * @uses bp_displayed_user_id() 878 * @uses bp_get_displayed_user_email() 879 * @uses apply_filters() to call 'bp_get_displayed_user_avatar' hook 880 * 881 * @return string Displayed in user avatar 882 */ 883 function bp_get_displayed_user_avatar( $args = array() ) { 832 884 833 $defaults = array( 834 'type' => 'thumb', 835 'width' => false, 836 'height' => false, 837 'html' => true, 838 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() ) 839 ); 885 // Setup default args 886 $params = wp_parse_args( $args, array( 887 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() ) 888 ) ); 840 889 841 $r = wp_parse_args( $args, $defaults ); 842 extract( $r, EXTR_SKIP ); 890 // These cannot be overridden. They are specifically required by the function 891 $params['item_id'] = bp_displayed_user_id(); 892 $params['email'] = bp_get_displayed_user_email(); 843 893 844 return apply_filters( 'bp_get_displayed_user_avatar', bp_core_fetch_avatar( array( 'item_id' => bp_displayed_user_id(), 'type' => $type, 'width' => $width, 'height' => $height, 'html' => $html, 'alt' => $alt )) );894 return apply_filters( 'bp_get_displayed_user_avatar', bp_core_fetch_avatar( $params ) ); 845 895 } 846 896 897 /** 898 * Output logged in user email. 899 * 900 * @since BuddyPress (1.7) 901 * 902 * @uses bp_get_loggedin_user_email() 903 */ 904 function bp_loggedin_user_email() { 905 echo bp_get_loggedin_user_email(); 906 } 907 /** 908 * Return logged in user email. 909 * 910 * @since BuddyPress (1.7) 911 * 912 * @global object $bp BuddyPress global settings 913 * @uses bp_get_loggedin_user_email() 914 * @uses apply_filters() to call 'bp_get_loggedin_user_email' hook 915 * 916 * @return string Logged in user email 917 */ 918 function bp_get_loggedin_user_email() { 919 $bp = buddypress(); 920 921 // Setup default 922 $retval = ''; 923 924 // If displayed user exists, return email address 925 if ( isset( $bp->loggedin_user->userdata->user_email ) ) 926 $retval = $bp->loggedin_user->userdata->user_email; 927 928 return apply_filters( 'bp_get_loggedin_user_email', esc_attr( $retval ) ); 929 } 930 931 /** 932 * Output displayed in user email. 933 * 934 * @since BuddyPress (1.5) 935 * 936 * @uses bp_get_displayed_user_email 937 */ 847 938 function bp_displayed_user_email() { 848 939 echo bp_get_displayed_user_email(); 849 940 } 941 /** 942 * Return displayed in user email. 943 * 944 * @since BuddyPress (1.5) 945 * 946 * @global object $bp BuddyPress global settings 947 * @uses bp_get_displayed_user_email() 948 * @uses apply_filters() to call 'bp_get_displayed_user_email' hook 949 * 950 * @return string Displayed user email 951 */ 850 952 function bp_get_displayed_user_email() { 851 global $bp;953 $bp = buddypress(); 852 954 853 955 // If displayed user exists, return email address 854 956 if ( isset( $bp->displayed_user->userdata->user_email ) ) … … 1017 1119 */ 1018 1120 function bp_has_custom_activation_page() { 1019 1121 static $has_page = false; 1020 1122 1021 1123 if ( empty( $has_page ) ) 1022 1124 $has_page = bp_get_activate_slug() && bp_locate_template( array( 'registration/activate.php', 'members/activate.php', 'activate.php' ), false ); 1023 1125 … … 1133 1235 return $bp->signup->step; 1134 1236 } 1135 1237 1136 function bp_signup_avatar( $args = '') {1238 function bp_signup_avatar( $args = array() ) { 1137 1239 echo bp_get_signup_avatar( $args ); 1138 1240 } 1139 function bp_get_signup_avatar( $args = '') {1140 global $bp;1241 function bp_get_signup_avatar( $args = array() ) { 1242 $bp = buddypress(); 1141 1243 1142 $defaults = array( 1143 'size' => bp_core_avatar_full_width(), 1144 'class' => 'avatar', 1145 'alt' => __( 'Your Avatar', 'buddypress' ) 1146 ); 1244 $params = wp_parse_args( $args, array( 1245 'size' => bp_core_avatar_full_width(), 1246 'alt' => __( 'Your Avatar', 'buddypress' ), 1247 'class' => 'avatar', 1248 'type' => 'full', 1249 'avatar_dir' => 'avatars/signups', 1250 'object' => 'signup' 1251 ) ); 1147 1252 1148 $r = wp_parse_args( $args, $defaults );1149 extract( $r, EXTR_SKIP );1150 1151 1253 // Avatar DIR is found 1152 1254 if ( $signup_avatar_dir = bp_get_signup_avatar_dir_value() ) { 1153 $gravatar_img = bp_core_fetch_avatar( array( 1154 'item_id' => $signup_avatar_dir, 1155 'object' => 'signup', 1156 'avatar_dir' => 'avatars/signups', 1157 'type' => 'full', 1158 'width' => $size, 1159 'height' => $size, 1160 'alt' => $alt, 1161 'class' => $class 1162 ) ); 1255 // This cannot be overridden. It is specifically required by the function 1256 $params['item_id'] = $signup_avatar_dir; 1163 1257 1258 $gravatar_img = bp_core_fetch_avatar( $params ); 1259 1164 1260 // No avatar DIR was found 1165 1261 } else { 1166 1262 … … 1175 1271 // Create 1176 1272 $gravatar_url = apply_filters( 'bp_gravatar_url', 'http://www.gravatar.com/avatar/' ); 1177 1273 $md5_lcase_email = md5( strtolower( bp_get_signup_email_value() ) ); 1178 $gravatar_img = '<img src="' . $gravatar_url . $md5_lcase_email . '?d=' . $default_grav . '&s=' . $ size . '" width="' . $size . '" height="' . $size . '" alt="' . $alt . '" class="' . $class. '" />';1274 $gravatar_img = '<img src="' . $gravatar_url . $md5_lcase_email . '?d=' . $default_grav . '&s=' . $params['size'] . '" width="' . $params['size'] . '" height="' . $params['size'] . '" alt="' . $params['alt'] . '" class="' . $params['class'] . '" />'; 1179 1275 } 1180 1276 1181 return apply_filters( 'bp_get_signup_avatar', $gravatar_img, $ args );1277 return apply_filters( 'bp_get_signup_avatar', $gravatar_img, $params ); 1182 1278 } 1183 1279 1184 1280 function bp_signup_allowed() { -
bp-messages/bp-messages-loader.php
258 258 if ( bp_is_my_profile() ) { 259 259 $bp->bp_options_title = __( 'My Messages', 'buddypress' ); 260 260 } else { 261 $bp->bp_options_avatar = bp_core_fetch_avatar( array( 262 'item_id' => bp_displayed_user_id(), 263 'type' => 'thumb', 264 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() ) 265 ) ); 266 $bp->bp_options_title = bp_get_displayed_user_fullname(); 261 $bp->bp_options_avatar = bp_get_displayed_user_avatar(); 262 $bp->bp_options_title = bp_get_displayed_user_fullname(); 267 263 } 268 264 } 269 265 -
bp-messages/bp-messages-template.php
317 317 return apply_filters( 'bp_get_message_thread_last_post_date', bp_format_time( strtotime( $messages_template->thread->last_message_date ) ) ); 318 318 } 319 319 320 function bp_message_thread_avatar( ) {321 echo bp_get_message_thread_avatar( );320 function bp_message_thread_avatar( $args = array() ) { 321 echo bp_get_message_thread_avatar( $args ); 322 322 } 323 function bp_get_message_thread_avatar( ) {323 function bp_get_message_thread_avatar( $args = array() ) { 324 324 global $messages_template; 325 325 326 return apply_filters( 'bp_get_message_thread_avatar', bp_core_fetch_avatar( array( 'item_id' => $messages_template->thread->last_sender_id, 'type' => 'thumb', 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $messages_template->thread->last_sender_id ) ) ) ) ); 326 $params = wp_parse_args( $args, array( 327 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_core_get_user_displayname( $messages_template->thread->last_sender_id ) ) 328 ) ); 329 330 // This cannot be overridden. It is specifically required by the function 331 $params['item_id'] = $messages_template->thread->last_sender_id; 332 333 return apply_filters( 'bp_get_message_thread_avatar', bp_core_fetch_avatar( $params ) ); 327 334 } 328 335 329 336 function bp_total_unread_messages_count() { … … 672 679 673 680 <li id="un-<?php echo esc_attr( $recipient ); ?>" class="friend-tab"> 674 681 <span><?php 675 echo bp_core_fetch_avatar( array( 'item_id' => $user_id, ' type' => 'thumb', 'width' => 15, 'height' => 15 ) );682 echo bp_core_fetch_avatar( array( 'item_id' => $user_id, 'width' => 15, 'height' => 15 ) ); 676 683 echo bp_core_get_userlink( $user_id ); 677 684 ?></span> 678 685 </li> … … 863 870 return apply_filters( 'bp_get_the_thread_message_alt_class', $class ); 864 871 } 865 872 866 function bp_the_thread_message_sender_avatar( $args = '') {873 function bp_the_thread_message_sender_avatar( $args = array() ) { 867 874 echo bp_get_the_thread_message_sender_avatar_thumb( $args ); 868 875 } 869 function bp_get_the_thread_message_sender_avatar_thumb( $args = '') {876 function bp_get_the_thread_message_sender_avatar_thumb( $args = array() ) { 870 877 global $thread_template; 871 878 872 $defaults = array( 873 'type' => 'thumb', 874 'width' => false, 875 'height' => false, 876 ); 879 $params = wp_parse_args( $args, array( 880 'alt' => bp_core_get_user_displayname( $thread_template->message->sender_id ) 881 ) ); 877 882 878 $r = wp_parse_args( $args, $defaults );879 extract( $r, EXTR_SKIP );883 // This cannot be overridden. It is specifically required by the function 884 $params['item_id'] = $thread_template->message->sender_id; 880 885 881 return apply_filters( 'bp_get_the_thread_message_sender_avatar_thumb', bp_core_fetch_avatar( array( 'item_id' => $thread_template->message->sender_id, 'type' => $type, 'width' => $width, 'height' => $height, 'alt' => bp_core_get_user_displayname( $thread_template->message->sender_id ) )) );886 return apply_filters( 'bp_get_the_thread_message_sender_avatar_thumb', bp_core_fetch_avatar( $params ) ); 882 887 } 883 888 884 889 function bp_the_thread_message_sender_link() { -
bp-templates/bp-legacy/buddypress/groups/single/admin.php
87 87 </label> 88 88 </div> 89 89 90 <hr /> 91 92 <h4><?php _e( 'Group Invitations', 'buddypress' ); ?></h4> 90 <hr /> 93 91 94 < p><?php _e( 'Which members of this group are allowed to invite others?', 'buddypress' ); ?></p>92 <h4><?php _e( 'Group Invitations', 'buddypress' ); ?></h4> 95 93 96 <div class="radio"> 97 <label> 98 <input type="radio" name="group-invite-status" value="members"<?php bp_group_show_invite_status_setting( 'members' ); ?> /> 99 <strong><?php _e( 'All group members', 'buddypress' ); ?></strong> 100 </label> 94 <p><?php _e( 'Which members of this group are allowed to invite others?', 'buddypress' ); ?></p> 101 95 102 <label> 103 <input type="radio" name="group-invite-status" value="mods"<?php bp_group_show_invite_status_setting( 'mods' ); ?> /> 104 <strong><?php _e( 'Group admins and mods only', 'buddypress' ); ?></strong> 96 <div class="radio"> 97 <label> 98 <input type="radio" name="group-invite-status" value="members"<?php bp_group_show_invite_status_setting( 'members' ); ?> /> 99 <strong><?php _e( 'All group members', 'buddypress' ); ?></strong> 105 100 </label> 106 107 <label>108 <input type="radio" name="group-invite-status" value="admins"<?php bp_group_show_invite_status_setting( 'admins' ); ?> />109 <strong><?php _e( 'Group admins only', 'buddypress' ); ?></strong>110 </label>111 </div>112 101 113 <hr /> 102 <label> 103 <input type="radio" name="group-invite-status" value="mods"<?php bp_group_show_invite_status_setting( 'mods' ); ?> /> 104 <strong><?php _e( 'Group admins and mods only', 'buddypress' ); ?></strong> 105 </label> 114 106 107 <label> 108 <input type="radio" name="group-invite-status" value="admins"<?php bp_group_show_invite_status_setting( 'admins' ); ?> /> 109 <strong><?php _e( 'Group admins only', 'buddypress' ); ?></strong> 110 </label> 111 </div> 112 113 <hr /> 114 115 115 <?php do_action( 'bp_after_group_settings_admin' ); ?> 116 116 117 117 <p><input type="submit" value="<?php _e( 'Save Changes', 'buddypress' ); ?>" id="save" name="save" /></p> … … 172 172 <?php if ( bp_is_group_admin_screen( 'manage-members' ) ) : ?> 173 173 174 174 <?php do_action( 'bp_before_group_manage_members_admin' ); ?> 175 175 176 176 <div class="bp-widget"> 177 177 <h4><?php _e( 'Administrators', 'buddypress' ); ?></h4> 178 178 179 179 <?php if ( bp_has_members( '&include='. bp_group_admin_ids() ) ) : ?> 180 180 181 181 <ul id="admins-list" class="item-list single-line"> 182 182 183 183 <?php while ( bp_members() ) : bp_the_member(); ?> 184 184 <li> 185 <?php echo bp_core_fetch_avatar( array( 'item_id' => bp_get_member_user_id(), ' type' => 'thumb', 'width' => 30, 'height' => 30, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_member_name() ) ) ); ?>185 <?php echo bp_core_fetch_avatar( array( 'item_id' => bp_get_member_user_id(), 'width' => 30, 'height' => 30, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_member_name() ) ) ); ?> 186 186 <h5> 187 187 <a href="<?php bp_member_permalink(); ?>"> <?php bp_member_name(); ?></a> 188 188 <?php if ( count( bp_group_admin_ids( false, 'array' ) ) > 1 ) : ?> 189 189 <span class="small"> 190 190 <a class="button confirm admin-demote-to-member" href="<?php bp_group_member_demote_link( bp_get_member_user_id() ); ?>"><?php _e( 'Demote to Member', 'buddypress' ); ?></a> 191 </span> 191 </span> 192 192 <?php endif; ?> 193 </h5> 193 </h5> 194 194 </li> 195 195 <?php endwhile; ?> 196 196 197 197 </ul> 198 198 199 199 <?php endif; ?> 200 200 201 201 </div> 202 202 203 203 <?php if ( bp_group_has_moderators() ) : ?> 204 204 <div class="bp-widget"> 205 <h4><?php _e( 'Moderators', 'buddypress' ); ?></h4> 206 205 <h4><?php _e( 'Moderators', 'buddypress' ); ?></h4> 206 207 207 <?php if ( bp_has_members( '&include=' . bp_group_mod_ids() ) ) : ?> 208 208 <ul id="mods-list" class="item-list single-line"> 209 210 <?php while ( bp_members() ) : bp_the_member(); ?> 209 210 <?php while ( bp_members() ) : bp_the_member(); ?> 211 211 <li> 212 <?php echo bp_core_fetch_avatar( array( 'item_id' => bp_get_member_user_id(), ' type' => 'thumb', 'width' => 30, 'height' => 30, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_member_name() ) ) ); ?>212 <?php echo bp_core_fetch_avatar( array( 'item_id' => bp_get_member_user_id(), 'width' => 30, 'height' => 30, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_member_name() ) ) ); ?> 213 213 <h5> 214 214 <a href="<?php bp_member_permalink(); ?>"> <?php bp_member_name(); ?></a> 215 215 <span class="small"> 216 216 <a href="<?php bp_group_member_promote_admin_link( array( 'user_id' => bp_get_member_user_id() ) ); ?>" class="button confirm mod-promote-to-admin" title="<?php _e( 'Promote to Admin', 'buddypress' ); ?>"><?php _e( 'Promote to Admin', 'buddypress' ); ?></a> 217 217 <a class="button confirm mod-demote-to-member" href="<?php bp_group_member_demote_link( bp_get_member_user_id() ); ?>"><?php _e( 'Demote to Member', 'buddypress' ); ?></a> 218 </span> 219 </h5> 220 </li> 221 <?php endwhile; ?> 222 218 </span> 219 </h5> 220 </li> 221 <?php endwhile; ?> 222 223 223 </ul> 224 224 225 225 <?php endif; ?> 226 226 </div> 227 227 <?php endif ?> -
bp-templates/bp-legacy/buddypress/members/single/member-header.php
14 14 <div id="item-header-avatar"> 15 15 <a href="<?php bp_displayed_user_link(); ?>"> 16 16 17 <?php bp_displayed_user_avatar( 'type=full'); ?>17 <?php bp_displayed_user_avatar( array( 'type' => 'full' ) ); ?> 18 18 19 19 </a> 20 20 </div><!-- #item-header-avatar --> -
bp-templates/bp-legacy/buddypress-functions.php
117 117 if ( bp_is_active( 'groups' ) ) { 118 118 add_action( 'bp_group_header_actions', 'bp_group_join_button', 5 ); 119 119 add_action( 'bp_group_header_actions', 'bp_group_new_topic_button', 20 ); 120 add_action( 'bp_directory_groups_actions', 'bp_group_join_button' ); 120 add_action( 'bp_directory_groups_actions', 'bp_group_join_button' ); 121 121 } 122 122 123 123 // Blog button 124 124 if ( bp_is_active( 'blogs' ) ) 125 add_action( 'bp_directory_blogs_actions', 'bp_blogs_visit_blog_button' ); 125 add_action( 'bp_directory_blogs_actions', 'bp_blogs_visit_blog_button' ); 126 126 127 127 } 128 128 … … 295 295 public function localize_scripts() { 296 296 297 297 } 298 298 299 299 /** 300 300 * Add secondary avatar image to this activity stream's record, if supported. 301 301 * … … 1173 1173 1174 1174 // Note that the final line break acts as a delimiter for the 1175 1175 // autocomplete javascript and thus should not be removed 1176 echo '<span id="link-' . $username . '" href="' . bp_core_get_user_domain( $user_id ) . '"></span>' . bp_core_fetch_avatar( array( 'item_id' => $user_id, ' type' => 'thumb', 'width' => 15, 'height' => 15, 'alt' => $ud->display_name ) ) . ' ' . bp_core_get_user_displayname( $user_id ) . ' (' . $username . ')' . "\n";1176 echo '<span id="link-' . $username . '" href="' . bp_core_get_user_domain( $user_id ) . '"></span>' . bp_core_fetch_avatar( array( 'item_id' => $user_id, 'width' => 15, 'height' => 15, 'alt' => $ud->display_name ) ) . ' ' . bp_core_get_user_displayname( $user_id ) . ' (' . $username . ')' . "\n"; 1177 1177 } 1178 1178 } 1179 1179 -
bp-themes/bp-default/_inc/ajax.php
279 279 280 280 if ( bp_has_activities ( 'include=' . $activity_id ) ) { 281 281 while ( bp_activities() ) { 282 bp_the_activity(); 282 bp_the_activity(); 283 283 locate_template( array( 'activity/entry.php' ), true ); 284 284 } 285 285 } … … 352 352 * 353 353 * @return mixed String on error, void on success 354 354 * @since BuddyPress (1.2) 355 */ 355 */ 356 356 function bp_dtheme_delete_activity() { 357 357 // Bail if not a POST action 358 358 if ( 'POST' !== strtoupper( $_SERVER['REQUEST_METHOD'] ) ) … … 610 610 else 611 611 echo '<a id="friend-' . $_POST['fid'] . '" class="remove" rel="remove" title="' . __( 'Cancel Friendship Request', 'buddypress' ) . '" href="' . wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/cancel/' . (int) $_POST['fid'] . '/', 'friends_withdraw_friendship' ) . '" class="requested">' . __( 'Cancel Friendship Request', 'buddypress' ) . '</a>'; 612 612 613 } elseif ( 'pending' == BP_Friends_Friendship::check_is_friend( bp_loggedin_user_id(), (int) $_POST['fid'] ) ) { 613 } elseif ( 'pending' == BP_Friends_Friendship::check_is_friend( bp_loggedin_user_id(), (int) $_POST['fid'] ) ) { 614 614 check_ajax_referer( 'friends_withdraw_friendship' ); 615 615 616 616 if ( friends_withdraw_friendship( bp_loggedin_user_id(), (int) $_POST['fid'] ) ) … … 914 914 915 915 // Note that the final line break acts as a delimiter for the 916 916 // autocomplete javascript and thus should not be removed 917 echo '<span id="link-' . $username . '" href="' . bp_core_get_user_domain( $user_id ) . '"></span>' . bp_core_fetch_avatar( array( 'item_id' => $user_id, ' type' => 'thumb', 'width' => 15, 'height' => 15, 'alt' => $ud->display_name ) ) . ' ' . bp_core_get_user_displayname( $user_id ) . ' (' . $username . ')' . "\n";917 echo '<span id="link-' . $username . '" href="' . bp_core_get_user_domain( $user_id ) . '"></span>' . bp_core_fetch_avatar( array( 'item_id' => $user_id, 'width' => 15, 'height' => 15, 'alt' => $ud->display_name ) ) . ' ' . bp_core_get_user_displayname( $user_id ) . ' (' . $username . ')' . "\n"; 918 918 } 919 919 } 920 920 -
bp-themes/bp-default/groups/single/admin.php
87 87 </label> 88 88 </div> 89 89 90 <hr /> 91 92 <h4><?php _e( 'Group Invitations', 'buddypress' ); ?></h4> 90 <hr /> 93 91 94 < p><?php _e( 'Which members of this group are allowed to invite others?', 'buddypress' ); ?></p>92 <h4><?php _e( 'Group Invitations', 'buddypress' ); ?></h4> 95 93 96 <div class="radio"> 97 <label> 98 <input type="radio" name="group-invite-status" value="members"<?php bp_group_show_invite_status_setting( 'members' ); ?> /> 99 <strong><?php _e( 'All group members', 'buddypress' ); ?></strong> 100 </label> 94 <p><?php _e( 'Which members of this group are allowed to invite others?', 'buddypress' ); ?></p> 101 95 102 <label> 103 <input type="radio" name="group-invite-status" value="mods"<?php bp_group_show_invite_status_setting( 'mods' ); ?> /> 104 <strong><?php _e( 'Group admins and mods only', 'buddypress' ); ?></strong> 96 <div class="radio"> 97 <label> 98 <input type="radio" name="group-invite-status" value="members"<?php bp_group_show_invite_status_setting( 'members' ); ?> /> 99 <strong><?php _e( 'All group members', 'buddypress' ); ?></strong> 105 100 </label> 106 107 <label>108 <input type="radio" name="group-invite-status" value="admins"<?php bp_group_show_invite_status_setting( 'admins' ); ?> />109 <strong><?php _e( 'Group admins only', 'buddypress' ); ?></strong>110 </label>111 </div>112 101 113 <hr /> 102 <label> 103 <input type="radio" name="group-invite-status" value="mods"<?php bp_group_show_invite_status_setting( 'mods' ); ?> /> 104 <strong><?php _e( 'Group admins and mods only', 'buddypress' ); ?></strong> 105 </label> 114 106 107 <label> 108 <input type="radio" name="group-invite-status" value="admins"<?php bp_group_show_invite_status_setting( 'admins' ); ?> /> 109 <strong><?php _e( 'Group admins only', 'buddypress' ); ?></strong> 110 </label> 111 </div> 112 113 <hr /> 114 115 115 <?php do_action( 'bp_after_group_settings_admin' ); ?> 116 116 117 117 <p><input type="submit" value="<?php _e( 'Save Changes', 'buddypress' ); ?>" id="save" name="save" /></p> … … 172 172 <?php if ( bp_is_group_admin_screen( 'manage-members' ) ) : ?> 173 173 174 174 <?php do_action( 'bp_before_group_manage_members_admin' ); ?> 175 175 176 176 <div class="bp-widget"> 177 177 <h4><?php _e( 'Administrators', 'buddypress' ); ?></h4> 178 178 179 179 <?php if ( bp_has_members( '&include='. bp_group_admin_ids() ) ) : ?> 180 180 181 181 <ul id="admins-list" class="item-list single-line"> 182 182 183 183 <?php while ( bp_members() ) : bp_the_member(); ?> 184 184 <li> 185 <?php echo bp_core_fetch_avatar( array( 'item_id' => bp_get_member_user_id(), ' type' => 'thumb', 'width' => 30, 'height' => 30, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_member_name() ) ) ); ?>185 <?php echo bp_core_fetch_avatar( array( 'item_id' => bp_get_member_user_id(), 'width' => 30, 'height' => 30, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_member_name() ) ) ); ?> 186 186 <h5> 187 187 <a href="<?php bp_member_permalink(); ?>"> <?php bp_member_name(); ?></a> 188 188 <?php if ( count( bp_group_admin_ids( false, 'array' ) ) > 1 ) : ?> 189 189 <span class="small"> 190 190 <a class="button confirm admin-demote-to-member" href="<?php bp_group_member_demote_link( bp_get_member_user_id() ); ?>"><?php _e( 'Demote to Member', 'buddypress' ); ?></a> 191 </span> 191 </span> 192 192 <?php endif; ?> 193 </h5> 193 </h5> 194 194 </li> 195 195 <?php endwhile; ?> 196 196 197 197 </ul> 198 198 199 199 <?php endif; ?> 200 200 201 201 </div> 202 202 203 203 <?php if ( bp_group_has_moderators() ) : ?> 204 204 <div class="bp-widget"> 205 <h4><?php _e( 'Moderators', 'buddypress' ); ?></h4> 206 205 <h4><?php _e( 'Moderators', 'buddypress' ); ?></h4> 206 207 207 <?php if ( bp_has_members( '&include=' . bp_group_mod_ids() ) ) : ?> 208 208 <ul id="mods-list" class="item-list single-line"> 209 210 <?php while ( bp_members() ) : bp_the_member(); ?> 209 210 <?php while ( bp_members() ) : bp_the_member(); ?> 211 211 <li> 212 <?php echo bp_core_fetch_avatar( array( 'item_id' => bp_get_member_user_id(), ' type' => 'thumb', 'width' => 30, 'height' => 30, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_member_name() ) ) ); ?>212 <?php echo bp_core_fetch_avatar( array( 'item_id' => bp_get_member_user_id(), 'width' => 30, 'height' => 30, 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_member_name() ) ) ); ?> 213 213 <h5> 214 214 <a href="<?php bp_member_permalink(); ?>"> <?php bp_member_name(); ?></a> 215 215 <span class="small"> 216 216 <a href="<?php bp_group_member_promote_admin_link( array( 'user_id' => bp_get_member_user_id() ) ); ?>" class="button confirm mod-promote-to-admin" title="<?php _e( 'Promote to Admin', 'buddypress' ); ?>"><?php _e( 'Promote to Admin', 'buddypress' ); ?></a> 217 217 <a class="button confirm mod-demote-to-member" href="<?php bp_group_member_demote_link( bp_get_member_user_id() ); ?>"><?php _e( 'Demote to Member', 'buddypress' ); ?></a> 218 </span> 219 </h5> 220 </li> 221 <?php endwhile; ?> 222 218 </span> 219 </h5> 220 </li> 221 <?php endwhile; ?> 222 223 223 </ul> 224 224 225 225 <?php endif; ?> 226 226 </div> 227 227 <?php endif ?> -
bp-themes/bp-default/members/single/member-header.php
14 14 <div id="item-header-avatar"> 15 15 <a href="<?php bp_displayed_user_link(); ?>"> 16 16 17 <?php bp_displayed_user_avatar( 'type=full'); ?>17 <?php bp_displayed_user_avatar( array( 'type' => 'full' ) ); ?> 18 18 19 19 </a> 20 20 </div><!-- #item-header-avatar --> -
bp-xprofile/bp-xprofile-loader.php
271 271 if ( bp_is_my_profile() ) { 272 272 $bp->bp_options_title = __( 'My Profile', 'buddypress' ); 273 273 } else { 274 $bp->bp_options_avatar = bp_core_fetch_avatar( array( 275 'item_id' => bp_displayed_user_id(), 276 'type' => 'thumb', 277 'alt' => sprintf( __( 'Profile picture of %s', 'buddypress' ), bp_get_displayed_user_fullname() ) 278 ) ); 274 $bp->bp_options_avatar = bp_get_displayed_user_avatar(); 279 275 $bp->bp_options_title = bp_get_displayed_user_fullname(); 280 276 } 281 277 }