-
Hi!
When i’m editing the view.php i can use: echo $userpro->show_social_bar( $args, $user_id, ‘userpro-icons’ );But when i’m another page, how can i display the social bar of a logged user?
To use/show the social icons outside view.php you can use the integratable version (with easy API method)
here is an example: echo $this->show_social_bar_clean( ‘user_id’ );
That’s it! This is an example already used in bbPress forum integration, you can integrate the social icons bar anywhere you want via the UserPro API function above. If you want to use a wrapper (custom div wrapping) do it like this:
echo $userpro->show_social_bar_clean( $user_id, ‘userpro-icons’ );
Thanks, hope that helps!
Hi. I added this code to my bbpress loop-single-reply.php but the social icons are not showing up?
<?php
/* Integrating UserPro */
global $userpro;
$link = preg_replace(“/(?<=href=(\”|’))[^\”‘]+(?=(\”|’))/”, $userpro->permalink( bbp_get_reply_author_id() ),
bbp_get_reply_author_link( array( ‘sep’ => ‘<br />’, ‘show_role’ => false ) ) );
echo $link . userpro_show_badges( bbp_get_reply_author_id() );
echo $userpro->show_social_bar_clean( $user_id, ‘userpro-icons’ );
?>What am I doing wrong? It only shows the verified badge and flag. I copied the files from your integration thread. My forum is not looking like yours 🙁
$user_id should be bbp_get_reply_author_id() remember user_id is dynamic, so you need to adapt it depending on how your user ID is stored (bbpress, buddypress, etc..)
Great! Thanks!
echo $userpro->show_social_bar_clean( bbp_get_reply_author_id(), ‘userpro-icons’ );
This works.
You must be logged in to reply to this topic.