[buddypress-dev] suggestion: profile avatar functions
David J. Bisset
dbisset at dimensionmedia.com
Wed May 28 04:39:35 GMT 2008
just checked in the latest BuddyPress version tonight. One thing I noticed:
function the_profile_picture() {
global $coreuser_id;
echo xprofile_get_avatar($coreuser_id, 2);
}
Any reason why we can't have a function to pull the thumbnail?
function the_profile_picture_thumbnail() {
global $coreuser_id;
echo xprofile_get_avatar($coreuser_id, 1);
}
Also I want to be able to tell if the user has uploaded an avatar so I
can place an "add photo/avatar" button on my template. Right now, I'm
doing that by created the above function and adding this to my code:
<?php if (the_profile_picture_thumbnail(true) == XPROFILE_DEFAULT_AVATAR) {
<div class="addphoto">
<div class="icon"><a href="#"><img src="<?php
bloginfo('stylesheet_directory'); ?>/images/buttons/add_plus.gif"
alt="" /></a></div>
<div class="phrase"><a href="#">Add Photo</a></div>
<br clear="all" />
</div> <!-- add photo -->
<? } ?>
Is there a better way? Hopefully you can see why I would desire to
know if the user uploaded an avatar.
--
David Bisset
Director of Web Development
Dimension Media, Inc.
www.dimensionmedia.com
http://www.linkedin.com/in/davidbisset
More information about the buddypress-dev
mailing list