UserPro Forums
  • Create new topic
  • Forums
    • No replies topics
    • Newest topics
    • Forum statistics
  • Account
    • Lost password
    • Register
    • Login
  • Documentation
  • Back to main site

Community Forums

User To User Support Forum/Forums/Tutorials / Integrations / How-to/Display social bar of logged user

Display social bar of logged user

bbPress
  • 11 years, 3 months ago AvatarAdriano Maia
    Participant

    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?

    11 years, 3 months ago Avataradmin
    Keymaster

    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!

    11 years, 3 months ago AvatarAdriano Maia
    Participant

    Thanks!!! 🙂

    11 years, 3 months ago Avataradmin
    Keymaster

    You’re welcome.

    11 years, 3 months ago Avatarpbg2013
    Participant

    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 🙁

    11 years, 3 months ago Avataradmin
    Keymaster

    $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..)

    11 years, 3 months ago Avatarpbg2013
    Participant

    Great! Thanks!

    echo $userpro->show_social_bar_clean( bbp_get_reply_author_id(), ‘userpro-icons’ );

    This works.

    11 years, 3 months ago Avataradmin
    Keymaster

    You’re welcome!

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.

Disclaimer

This forum is 100% free and USER to USER support only. Technical support staff doesn’t monitor this forum actively.

If you are a customer and want to get technical support from our staff please submit a technical support ticket here: UserPRO Technical Support

Recent Topics

  • change password rule
  • messy layout and signup not working
  • creating better layout
  • Custom Badges AddOn Plugin here
  • Green Trust Cash APplication

About forum

Here you can find help from UserPro plugin developers and other UserPro fellow users. Please be polite and ask your questions. NO SPAM!

Search Forums

Follow us

  • facebook
  • twitter
  • youtube
© Copyright UserPro