Skip to:
Content
Pages
Categories
Search
Top
Bottom

Display bbsocialize Funtion Twice

  • Hi,

    I can not figure out what is causing one function in a plugin I am trying to make (modify) to cancel out another function from the same plugin on the same page.

    OK, did that make sense.

    Here are my examples.

    bbSocialize – IF (and this is only an example) I want to display all the information from bbSocialize at the top of the profile and at the bottom of the profile, then it is ONLY displayed at the top (canceling the one one the bottom).

    Avatar Upload – I can put the code in to display my avatar as many times as I want and it shows all of them.

    I am not understanding why the bbSocialize code or functions are causing the second one to cancel out.

    That is basically my problem.

    I have modified bbSocialize in the sense that I have added A LOT to it including customizable fields. What I would like to do is have 2 or 3 functions pulling out certain information so that instead of all that info (or whatever you choose) being displayed in one area, you could break it up on the profile page and put some up top, some down on bottom, some in the middle or possibly floating to the right…..whatever. And of course the main function would be available to display all your selections.

    I hope I made that clear enough.

    Almost like the functions are not closing properly — but I really don’t know.

    Ok, here is the basic bbsocialize funtion to display on the profile page.

    // The following function can be used to display profiles on user-profile-page
    function get_socialize() {
    global $user_id, $bb_current_user, $bb_socialize;

    $user_id = bb_get_user( $user_id );

    $bb_twitter = $user_id->social_twitter;

    echo '<div class="socialize_wrap">';
    if ( $bb_socialize['twitter'] == true ) { if ( !empty( $bb_twitter ) ) { echo '<dd><img src="'.$bb_socialize['images_url'].'/bb_twitter.png" width="16" height="16" border="0" /> <a href="http://twitter.com/'.$bb_twitter.'" title="User Twitter account" rel="'.$bb_socialize['links_rel'].'"><span>'.$bb_twitter.'</span></a></dd>'; } }

    echo '</div>';
    }

Viewing 2 replies - 1 through 2 (of 2 total)

  • _ck_
    Participant

    @_ck_

    It’s because you are destroying $user_id

    This is wrong:

    $user_id = bb_get_user( $user_id );
    $bb_twitter = $user_id->social_twitter;

    You should do:

    $user = bb_get_user( $user_id );
    $bb_twitter = $user->social_twitter;

    $user_id holds the id number, not the entire user object.

    _ck_,

    Thank you for a fast reply.

    And you were right!! That fixed it.

    This is my first time attempting to play with a plugin (except for some poking around with syle and “stuff”). Still, if I was paying attention I probably would have caught that!

    Thanks again, I appreciate it!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar