Search Results for 'bp_core_fetch_avatar'
-
AuthorSearch Results
-
May 5, 2013 at 6:31 pm #163466
In reply to: [Resolved] Distorted Avatar
robgha01ParticipantThancks that solved it! 😀
if ( $sl_options['show_avatar'] ) { if( function_exists('bp_core_fetch_avatar') ) { echo bp_core_fetch_avatar( array( 'item_id' => $current_user->ID, 'type' => 'full' ) ); } else { echo get_avatar( $current_user->ID, $sl_options['avatar_size'] ); } }
May 5, 2013 at 2:51 pm #163456In reply to: [Resolved] Distorted Avatar
shanebpModeratorIn that plugin, you need to replace
echo get_avatar( $current_user->ID, $sl_options['avatar_size'] );
with this:
echo bp_core_fetch_avatar( array( 'item_id' => $current_user->ID, 'type' => 'full' ) );
February 11, 2013 at 7:50 am #152811Slava AbakumovModerator@grimbog
Is there any ETA when it will be ready for testing?February 4, 2013 at 3:02 pm #152346LawrenceParticipantJust seen some activity on this… again, really sorry that things have been on a bit of a pause, but luckily I still have all the code and a basic website so I’ll review everything again with the latest version of wordpress and buddypress and see if I can get this thing published at long last!
January 24, 2013 at 11:53 pm #151687In reply to: Were is avatar information stored in the database?
modemlooperModeratorbp_core_fetch_avatar() is where the magic happens
http://phpxref.ftwr.co.uk/buddypress/bp-core/bp-core-avatars.php.source.html#l86
January 23, 2013 at 10:28 pm #151583NormParticipantWould love to test this. I’ve got a site for kids and could see this being a really fun feature.
December 1, 2012 at 3:00 pm #146282knaveenchandParticipantInterestingly, buddypress default theme does not accept avatar from social networks when used with WordPress Social Login plugin. I wish I could provide a random avatar for such cases where buddypress does not accept the avatar provided by social networks.
There ain’t any active plugins that can produce random avatars. I believe that the plugin that @Lawrence talks will go a long way if it is in public domain. Hence, I request him to offer us some download links to his work. Thanks.
December 1, 2012 at 2:56 pm #146281knaveenchandParticipant@Lawrence: have you been able to complete this plugin? Can you please provide a download link as I am interested to use this plugin. Thanks.
November 30, 2012 at 12:03 pm #146194In reply to: Square member avatar and horizontal group thumbnail
m1000ParticipantYes, I have tried to crop avatar with and without CTL, SHIFT or Command key.
Right now I have following settings in the bp-core-avatars.php
For function bp_core_set_avatar_constants
if ( !defined( 'BP_AVATAR_FULL_WIDTH' ) )
define( 'BP_AVATAR_FULL_WIDTH', 215 );if ( !defined( 'BP_AVATAR_FULL_HEIGHT' ) )
define( 'BP_AVATAR_FULL_HEIGHT', 135 );
and for function bp_core_fetch_avatar:
'width' => 150, // Custom width (int)
'height' => 150, // Custom height (int)
The result is I can’t make avatars 150x150px (problem with crop) – http://imm.io/NrNw
Like I said, I want to have 215×135 (horizontal) group thumbnails so I modified bp_core_set_avatar_constants but unfortunately member avatars have also 215×135 while I want 150×150 size.
November 28, 2012 at 9:48 am #146003Tammie ListerModeratorJust to be clear, what you are trying to do is display like the user avatar and other details on the author page? You can’t just use member-header as that looks at the ‘current user’. In this case the author page doesn’t have the right information for those calls to work.
What I’d suggest is you get the userid and use functions like these:
bp_core_fetch_avatar( array( 'item_id'=>$userid, 'width'=>150));
echo bp_core_get_username($userid);
bp_last_activity( $userid );
That way you’re creating the member-header yourself. You could even have a template part to do this and just call that in the right place.
October 17, 2012 at 6:19 am #143551modemlooperModeratorecho bp_core_fetch_avatar( ‘item_id=’.get_post_author_id() );
August 27, 2012 at 10:08 am #140351In reply to: How to check if member has avatar ?
meg@infoParticipantthis was work for me
/**
* Check if the current user has an uploaded avatar
* @return boolean
*/
function current_user_has_avatar() {
global $bp;
if ( bp_core_fetch_avatar( array( 'item_id' => $bp->loggedin_user->id, 'no_grav' => true,'html'=> false ) ) != bp_core_avatar_default() )
return true;
return false;
}
thanks for answers.
August 27, 2012 at 10:02 am #140349meg@infoParticipantHi,
Check this
/**
* Check if the current user has an uploaded avatar
* @return boolean
*/
function current_user_has_avatar() {
global $bp;
if ( bp_core_fetch_avatar( array( 'item_id' => $bp->loggedin_user->id, 'no_grav' => true,'html'=> false ) ) != bp_core_avatar_default() )
return true;
return false;
}
August 8, 2012 at 4:51 pm #138846In reply to: bp_core_fetch_avatar issue after 1.6 update
odiggyParticipantThanks Roger!
August 8, 2012 at 3:39 pm #138837In reply to: bp_core_fetch_avatar issue after 1.6 update
Paul Wong-GibbsKeymasterConfirmed. Thanks for investigating.
August 8, 2012 at 3:31 pm #138835In reply to: bp_core_fetch_avatar issue after 1.6 update
Paul Wong-GibbsKeymasterAh hah. Hopefully we can get someone to test reversing that change on the Salutation theme; we may be on to a winner. Thanks Roger
August 8, 2012 at 3:12 pm #138833In reply to: bp_core_fetch_avatar issue after 1.6 update
Roger CoathupParticipantI suspect that it is this ‘fix’ that has broken the functionality: https://buddypress.trac.wordpress.org/ticket/4215
August 6, 2012 at 11:21 am #138476In reply to: BuddyPress 1.6 is now available
GeordeeParticipantI had to make this fix after the update
In bp-core-avatars.php I commented out
`return apply_filters( ‘bp_core_fetch_avatar’, ‘<img src="' . `
onward and added
`return apply_filters( ‘bp_core_fetch_avatar_url’, $gravatar );`Also commented
`return apply_filters( ‘bp_core_fetch_avatar’, ‘<img src="' .`
and added
`return apply_filters( ‘bp_core_fetch_avatar_url’, $avatar_url );`Not sure whether this is correct or not, but my site works.
I do not see any other issue.
June 24, 2012 at 5:16 am #136310In reply to: bp_ functions in wordpress strict page
modemlooperModeratorbp_displayed_user_avatar only works on a members profile page use bp_core_fetch_avatar
not all functions work out of their components
May 8, 2012 at 6:10 pm #134179In reply to: How to check if member has avatar ?
meg@infoParticipantThanks @shanebp for answer,
I wanted a clean solution (just function from buddyrpess) but – .
Any way, here is my function, i used bp_core_avatar_default() to return the default avatar.
/**
* Check if the current user has an uploaded avatar
* @return boolean
*/
function current_user_has_avatar() {
global $bp;
if ( bp_core_fetch_avatar( array( 'item_id' => $bp->loggedin_user->id, 'no_grav' => true,'html'=> false ) ) != bp_core_avatar_default() )
return true;
return false;
}
Hope this help some one.
Closed.May 8, 2012 at 1:34 pm #134167In reply to: How to check if member has avatar ?
shanebpModeratorSo it will always be true due to the default avatar.
There might be an existing BP method to ignore both grav and default, but I don’t know what it is.
So you could string-check, something like this:
`
function user_has_avatar() {
global $bp;$avatar = bp_core_fetch_avatar( array( ‘item_id’ => $bp->loggedin_user->id, ‘no_grav’ => true, ‘html’=>false) );
$pos = strpos($avatar, ‘mystery-man’);
if ($pos === false) return true;return false;
}
`May 8, 2012 at 12:03 pm #134166In reply to: How to check if member has avatar ?
meg@infoParticipantHere is my code
This my code in functions.php
function user_has_avatar() {
global $bp;
if ( !bp_core_fetch_avatar( array( 'item_id' => $bp->loggedin_user->id, 'no_grav' => true ) ) )
return false;
return true;
}
I try to check this in header.php,
// test one with bp_get_user_has_avatar function
global $bp;
if( !bp_get_user_has_avatar()) :
// echo html message warning
endif;
// test two with user_has_avatar function
if( !user_has_avatar() ) :
// echo html message warning
endif;
bp_core_fetch_avatar( array( ‘item_id’ => $bp->loggedin_user->id, ‘no_grav’ => true, ‘html’=>false )
return this string :http://localhost/wordpress-buddypulse/wp-content/plugins/buddypress/bp-core/images/mystery-man.jpg
and not false like describe in buddypress docs ( when no_grav is true function will return false if no avatar is added)
bp_get_user_has_avatar() is used in memberssingleprofilechange-avtar.php , mybe i need to call a funtion to load the data of current member or somthing like that…
Thanks advance @shanebp for help
May 3, 2012 at 11:49 pm #133945In reply to: link to avatar by id
shanebpModeratorWhy would you want to link to an avatar?
If you mean show their avatar as a link to their profile…
Then if you know what that person’s user_id is… say as $that_member_id`
$avatar=bp_core_fetch_avatar(array(“item_id”=>$that_member_id,”type”=>”thumb”,”height”=>32,”width”=>32));
$avatar_link = “” . $avatar . ““;
echo $avatar_link;
`May 2, 2012 at 4:24 pm #133865In reply to: How do I insert the big avatar?
adambundyMemberI found a solution for this. Hope it helps someone. Note that I am fetching the value of $user_id earlier in my loop.
`if ( function_exists(‘bp_core_fetch_avatar’) ) {
echo apply_filters( ‘bp_post_author_avatar’, bp_core_fetch_avatar( array( ‘item_id’ => $user_id, ‘type’ => ‘full’, ‘width’ => 120, ‘height’ => 120 ) ) );
} else if ( function_exists(‘get_avatar’) ) {
get_avatar( $user_id, $size = ‘120’);
}`April 30, 2012 at 5:42 pm #133763In reply to: Using BuddyPress Avatars with wp_list_comments()
craftcoreParticipantThanks for the tip, Paul! I have nice crisp avatars now; not a blurry pixel in sight!
Strangely, calling get_avatar() still resulted in blurry pics. When I used the bp_core_fetch_avatar function, it worked perfectly.
(See image of the results side by side: https://twitter.com/#!/pangepange/status/197016926789181441/photo/1/large )
The function didn’t work as is, but when I changed item_id to “$comment->user_id”, the avatars worked on my theme.
`<?php if ( function_exists( 'bp_core_fetch_avatar' ) ) :
echo bp_core_fetch_avatar( array(
‘item_id’ => $comment->user_id,
‘type’ => ‘full’,
‘width’ => 75,
‘height’ => 75
));
endif;
?>`Thanks so much for the help!
-
AuthorSearch Results