Advertisement
Guest User

r-a-y

a guest
Jul 16th, 2010
850
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. function my_default_get_group_avatar($avatar) {
  2. global $bp, $groups_template;
  3.  
  4. if( strpos($avatar,'group-avatars') ) {
  5. return $avatar;
  6. }
  7. else {
  8. $custom_avatar = 'YOUR LINK TO YOUR AVATAR HERE';
  9.  
  10. if($bp->current_action == "" || $bp->current_action == "my-groups" || $bp->current_action == "invites" ) {
  11. if ( $bp->current_component == BP_FORUMS_SLUG ) {
  12. $width = "20";
  13. $height = "20";
  14. }
  15. else {
  16. $width = BP_AVATAR_THUMB_WIDTH;
  17. $height = BP_AVATAR_THUMB_HEIGHT;
  18. }
  19.  
  20. return '<img width="'.$width.'" height="'.$height.'" src="'.$custom_avatar.'" class="avatar" alt="" />';
  21. }
  22. else
  23. return '<img width="'.BP_AVATAR_FULL_WIDTH.'" src="'.$custom_avatar.'" class="avatar" alt="' . attribute_escape( $groups_template->group->name ) . '" />';
  24. }
  25. }
  26. add_filter( 'bp_get_group_avatar', 'my_default_get_group_avatar');
  27. add_filter( 'bp_get_the_topic_object_avatar', 'my_default_get_group_avatar');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement