Group Mods

  • Profile picture of @mercime
  • Profile picture of r-a-y
  • Profile picture of Hugo

Checking if user has an update or not, (10 posts)

Started 1 year, 5 months ago by: murasaki

  • Profile picture of murasaki murasaki said 1 year, 5 months ago:

    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?

  • Profile picture of murasaki murasaki said 1 year, 4 months ago:

    or is that the wrong tag?

  • Profile picture of Boone Gorges Boone Gorges said 1 year, 4 months ago:

    Try

    if ( bp_get_activity_latest_update() )
           bp_activity_latest_update(); //then show the update
    else
           // then show this
  • Profile picture of murasaki murasaki said 1 year, 4 months ago:

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

    your a life saver :P

  • Profile picture of murasaki murasaki said 1 year, 4 months ago:

    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

  • Profile picture of Boone Gorges Boone Gorges said 1 year, 4 months ago:

    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
  • Profile picture of murasaki murasaki said 1 year, 4 months ago:

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

  • Profile picture of 7h0masr0ss 7h0masr0ss said 11 months, 2 weeks ago:

    Where do i put the code??

  • Profile picture of thecorkboard thecorkboard said 10 months, 2 weeks ago:

    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?

  • Profile picture of thecorkboard thecorkboard said 10 months, 1 week ago:

    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