Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

r-a-y

By: a guest on Jul 16th, 2010  |  syntax: None  |  size: 0.93 KB  |  views: 591  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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');