Plugin: Achievements

Join this plugin group to follow comments, support topics and reviews.

Show points for user (8 posts)

Started 1 year, 2 months ago by: driz

  • On my website I want to show the points a user has next to their avatar in posts and comments throughout the site. How could I do this? Thanks

  • Any updates? Just to clarify I’m wanting to show the points of the author of a post within the loop, so where it says there name and shows there avatar I would also like to show the points. Thanks.

  • e.g. code:

    <h3><?php printf( __( '<strong>%s</strong>', 'buddypress' ), bp_core_get_userlink( $post->post_author ) ) ?></h3>
    
    <div class="avatar">
        		<a class="user" title="<?php the_author(); ?>" href="<?php bloginfo('url'); ?>/members/<?php echo get_the_author_meta('user_login') ?>/"><?php echo get_avatar( get_the_author_meta('user_email'), $size = '48' ); ?></a>
        	</div>
    
        	<ul class="author-options">
        		<li class="points"><a title="Points" href="<?php bloginfo('url'); ?>/members/<?php echo get_the_author_meta('user_login') ?>/achievements/">0</a></li>
        	</ul>

    I want to change that 0 to the number of points the user has!

  • Profile picture of Paul Gibbs Paul Gibbs said 1 year, 2 months ago:

    <?php global $bp; dpa_member_achievements_score( $bp->displayed_user->id ); ?>

  • It wouldn’t be displayed_user as it’s in the loop and NOT on a member page so therefore would be something like author_meta right?

  • This works global $bp; dpa_member_achievements_score( get_the_author_meta('id') );

  • Profile picture of Caderial Caderial said 10 months, 1 week ago:

    Where might i put this code?

  • Profile picture of Paul Gibbs Paul Gibbs said 10 months, 1 week ago:

    Wherever you want it.