If you’re using this with Buddypress, you could do something like placing the following code in a text-widget in the sidebar/ whatever
<?php
global $bp;
$user_id = $bp->displayed_user->id;
if ( $user_id != 0 ) {
_e($points = Badgearoo::instance()->api->get_user_points( $user_id ));
} else {
_e( 'Invalid member profile.', 'badgearoo' );
}
?>
It displays the points for the logged in user and uses Badgearoos api to get it. You can make the WordPress text widgets accept php with
function php_execute($html){
if(strpos($html,"<"."?php")!==false){ ob_start(); eval("?".">".$html);
$html=ob_get_contents();
ob_end_clean();
}
return $html;
}
add_filter('widget_text','php_execute',100);
-
This reply was modified 8 years, 4 months ago by Jonas.