Search Results for 'bp_core_fetch_avatar'
-
AuthorSearch Results
-
November 24, 2013 at 12:42 am #174707
In reply to: Buddypress on Mobile / Hide admin access
mattg123
Participant@pjbursnall , I wouldn’t say that it is pretty easy here
<?php global $current_user; get_currentuserinfo(); $display = $current_user->display_name; $login = $current_user->user_login; $userid = $current_user->ID; $home = get_home_url(); ?>add that above your custom drop-down then its pretty simple just echo out the username, url etc
<li class="li-fourth"><a href="<?php echo $home . '/members/' . $login . '/activity/mentions'; ?>">Mentions</a></li>EDIT –
Oh the other bit you’d have to google for is the avatar but here
<?php echo bp_core_fetch_avatar( array('item_id' => $userid, 'type' => 'full', 'width' => 100,'height' => 100));?>
You’ll want to adjust the width/height accordinglySeptember 4, 2013 at 3:28 pm #170843In reply to: How to disable Gravatar completely?
aleciri83
Participantadd_filter('bp_core_fetch_avatar_no_grav', '__return_true');August 30, 2013 at 9:17 am #170656In reply to: Post author Profile link
Hugo Ashmore
Participantto get the authors BP account url you could try:
bp_core_get_user_domain( get_the_author_meta( ‘ID’ )
In the same vein you should be able to grab the BP avatar:
bp_core_fetch_avatar( array(‘item_id’ => get_the_author_meta( ‘ID’ )
August 20, 2013 at 7:35 am #170090In reply to: Always use full size Avatar
Hugo Ashmore
ParticipantPlease do not advise the editing of core files this is poor practise and never recommended.
You describe the default args there, the correct means of changing those is when using bp_core_fetch_avatar() to pass it an array of values.
In templates adjust the various avatar calls using similar principle
July 9, 2013 at 10:31 am #167801mathieu.urstein
Participantthank you the problem was the quotes 😉
July 9, 2013 at 2:32 am #167789modemlooper
Moderator<?php $userid = bp_loggedin_user_id(); $avatarurl = bp_core_fetch_avatar( array( ‘item_id’ => $userid, ‘html’ => false ) ); echo $avatarurl; ?>rewrite the quote marks, if you cut and paste it can have funky formatting. If you want to display the avatar instead of getting link:
<?php $userid = bp_loggedin_user_id(); echo bp_core_fetch_avatar( array( ‘item_id’ => $userid) ); ?>July 9, 2013 at 1:26 am #167787mathieu.urstein
Participantthank you @modemlooper
I did :
$userid = bp_loggedin_user_id(); $avatarurl = bp_core_fetch_avatar( array( ‘item_id’ => $userid, ‘html’ => false ) );But the problem is still the same,
what did I do wrong?Thanks.
July 8, 2013 at 11:28 pm #167778modemlooper
Moderator$id = //pass the id of a user
bp_core_fetch_avatar( array( ‘item_id’ => $id, ‘html’ => false ) );If you are not on a user page then you must tell it what id of the avatar to get.
bp_displayed_user_id
bp_loggedin_user_idJune 25, 2013 at 5:23 am #166817In reply to: Getting the large avatar
mattg123
Participant@applegateian, henries code should work, but as you’ve experienced it won’t change the current size of the avatars. I also believe bp has thumbnail avatars and “full” the smaller “thumbnail” the ones wordpress uses is 50px and the larger(which can be grabbed with bp_core_fetch_avatar) are 150px by 150px.
bp_core_fetch_avatar( array( 'item_id' => $userid, 'type' => 'full', 'width' => 150, 'height' => 150 ));That will display the “full” avatar.
June 24, 2013 at 4:36 pm #166754In reply to: Getting the large avatar
Henry
MemberBuddyPress seems to attempt to filter get_avatar() – see bp_core_fetch_avatar_filter(). I did bring this issue up a while ago at WordPress Trac but the call was closed.
https://core.trac.wordpress.org/ticket/24596
Wonder if anyone thinks it’s worthy of a BP Trac ticket?
June 24, 2013 at 10:36 am #166723In reply to: Getting the large avatar
applegateian
ParticipantAh ok thanks, this code doesn’t seem to return anything, can you help me with the error?
<a href="/community/members/<?php echo get_the_author_meta('user_login') ?>"> <?php echo bp_core_fetch_avatar ( get_the_author_meta('user_email'), $size = '192' ); ?> </a>June 23, 2013 at 11:38 pm #166683In reply to: Getting the large avatar
mattg123
ParticipantYou’re using wordpress’s
get_avatar,bp_core_fetch_avataris what you’re looking forJune 8, 2013 at 7:54 pm #165607In reply to: How to check if member has avatar ?
funmi omoba
Participant@megainfo, @shanebp, please what am I missing.
I put the below code in my functions.php
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; }and this in my header.php
<?php global $bp; if( !bp_get_user_has_avatar()) : ?> <div class="no-pic"> <strong>Alert !</strong> You have no profile Pic, Clik here to add one now. <button class="close" data-dismiss="alert">×</button> </div> <?php endif;It work but the alert is not closing when i try to close it
May 5, 2013 at 6:31 pm #163466In reply to: [Resolved] Distorted Avatar
robgha01
ParticipantThancks 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
shanebp
ModeratorIn 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 Abakumov
Moderator@grimbog
Is there any ETA when it will be ready for testing?February 4, 2013 at 3:02 pm #152346Lawrence
ParticipantJust 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?
modemlooper
Moderatorbp_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 #151583Norm
ParticipantWould 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 #146282knaveenchand
ParticipantInterestingly, 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 #146281knaveenchand
Participant@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
m1000
ParticipantYes, 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 Lister
ModeratorJust 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 #143551modemlooper
Moderatorecho 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@info
Participantthis 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.
-
AuthorSearch Results