Skip to:
Content
Pages
Categories
Search
Top
Bottom

Checking if user has an update or not,

  • Avatar of murasaki
    murasaki
    Participant

    @iamsincere

    Ok, what im trying to do is simple:

    ` if ( bp_activity_latest_update() ) :
    then show the update
    else
    then show this`

    basically, it’s for the new users who obviously haven’t posted an update yet.

    i figured it was something simple, anyone have any ideas?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Avatar of murasaki
    murasaki
    Participant

    @iamsincere

    or is that the wrong tag?

    Avatar of Boone Gorges
    Boone Gorges
    Keymaster

    @boonebgorges

    Try
    `if ( bp_get_activity_latest_update() )
    bp_activity_latest_update(); //then show the update
    else
    // then show this`

    Avatar of murasaki
    murasaki
    Participant

    @iamsincere

    thanks alot boone! lol…i thought no one would EVER answer me lol.

    your a life saver :P

    Avatar of murasaki
    murasaki
    Participant

    @iamsincere

    Im haveing a problem lol. its only working on the members profile page, i want it to show on all pages. Its in the side bar, well, the idea is to show your latest post in the sidebar

    Avatar of Boone Gorges
    Boone Gorges
    Keymaster

    @boonebgorges

    Yeah, without a $user_id argument, it’ll only work on profile pages. See bp-activity/bp-activity-templatetags.php bp_activity_latest_update().

    Try:
    `if ( bp_get_activity_latest_update( bp_loggedin_user_id() ) )
    bp_activity_latest_update( bp_loggedin_user_id() ); //then show the update
    else
    // then show this`

    Avatar of murasaki
    murasaki
    Participant

    @iamsincere

    :) ha! there we go, and we’re in business! thanks again boone, i appreciate it

    Where do i put the code??

    Avatar of thecorkboard
    thecorkboard
    Participant

    @thecorkboard

    I’d like to preface the update (it it’s available ) with:
    ‘and the latest update was:

    Wrapping the update in italics and breaking the update from the preceeding “‘member’ was active 3 minutes ago”

    I’ve tried some echos but it’s breaking for some reason unknown.

    Ideas?

    Avatar of thecorkboard
    thecorkboard
    Participant

    @thecorkboard

    I was able to preface the update if it existed with this:

    $latest_update = bp_get_activity_latest_update();
    if ( bp_get_activity_latest_update() )
    echo “and the latest update was:
    $latest_update “;
    else

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

You must be logged in to reply to this topic.