Skip to:
Content
Pages
Categories
Search
Top
Bottom

My Friends Activity

  • Avatar of Sdq80
    sdq80
    Participant

    @sdq80

    How can we get My friends activity list in the home theme, for example add it to the index page, I tired to play with the function bp_activity_get_list but I’m getting empty list, any advice please? And thanks

Viewing 25 replies - 1 through 25 (of 25 total)
  • Avatar of Burt Adsit
    Burt Adsit
    Participant

    @burtadsit

    Exactly how are you playing with bp_activity_get_list()? It requires a valid user id (you). Do you have any friends? :) Have they done anything? One of the params is a custom message for ‘no activity by my slothful friends’ result.

    Avatar of Sdq80
    sdq80
    Participant

    @sdq80

    for example if I want to get my activity I’m using:

    <?php bp_activity_get_list( bp_current_user_id(), bp_word_or_name( __( “My Activity”, ‘buddypress’ ), __( “%s’s Activity”, ‘buddypress’ ), true, false ), __( “You haven’t done anything yet.”, ‘buddypress’ ) ) ?>

    this function works with member theme only, when I try to add the same function to the home theme (i.e: index) it wont work, it gives me the above custom message (You haven’t done …..)!! thanks for your cooperation!

    Avatar of Sdq80
    sdq80
    Participant

    @sdq80

    any update please?!

    Avatar of Sdq80
    sdq80
    Participant

    @sdq80

    Guys – can someone help with bp_activity_get_list function?!

    Haven’t look at the exact calls, but have you looked at the code in the sitewide activity widget and what global functions it is calling and how exactly the lists are produced?

    Avatar of Sdq80
    sdq80
    Participant

    @sdq80

    I’ve checked it, but the sidewide activity widget is querying different table, and the function “bp_activity_get_list” is not used! and thanks

    Avatar of Michael Berra
    Michael Berra
    Participant

    @miguael

    This is exactly what I want to. It would be great, because people want to see their friends… (like facebook).

    I came as far as sdq80, but then I am lost… Any idea?

    Ps: Yes, I have friends, and they did stuff… :-)

    Ps2: You can take a look here: http://berra.graphic-studio.ch

    Avatar of Michael Berra
    Michael Berra
    Participant

    @miguael

    Does anybody have a solution?

    Avatar of Sdq80
    sdq80
    Participant

    @sdq80

    I find a solution, actuality I’ve added more privacy to members:

    - No one can view any details about other members (Activity, Wire, Profile, Friends list) unless they are friends,

    - Also at BP front page I replaced the sidewide activity widget with Friends activities, once members login to bp it shows them their friends activities, check it out on my test environment: http://wpmu.telecomize.com/

    But the problem, all what I’ve done is playing with the code, so whenever I update my BP I have to go over the same changes. Also its not optional feature which members cant set it by themselves, its applied for all members.

    Avatar of Michael Berra
    Michael Berra
    Participant

    @miguael

    WOW, sdq80 – it sounds that I would like that. Can you tell me, what you did? Give me the code or something?

    Question: It’s hard to check it out, because I’m not a momber and don’t see anything… :-). Does it have to be like that on the BP Frontpage?

    ->Mainly I’m interested in having the friends-activity on the Frontpage-Code… :-)

    Thanks already!

    @sdq80 I would be interested in your hacks as well. There might be a way to put it in as a plugin if you share your code.

    Thanks,

    Trent

    Avatar of Michael Berra
    Michael Berra
    Participant

    @miguael

    I am still looking deperatly for a solution…

    @sdq80 – are you lost? Would be great, if you would share your code?

    Or: Anybody else having a solution to put the friends-activity per example in the home-theme???

    Thanks!

    Michael

    Avatar of Sdq80
    sdq80
    Participant

    @sdq80

    Here you go guys, its a workaround solution, it might impact the activity plugin, however what you need to do is to edit bp_activity_template in the activity templatetags, remove the code $bp != $bp || from the if statement or add your home page component, then you will be able to use the function bp_activity_get_list in the home page, let me know about the result :)

    Avatar of Sdq80
    sdq80
    Participant

    @sdq80

    Avatar of Michael Berra
    Michael Berra
    Participant

    @miguael

    You are my HERO!!! :-) It works just great for me!!! Thanks alot!

    Avatar of Sdq80
    sdq80
    Participant

    @sdq80

    You are very welcome!

    @Trent regarding members’ privacy, you can use the following function to get the friendship status and then you can play with it accordingly to hide the profile info from non-friends members:

    $friend_status = BP_Friends_Friendship::check_is_friend( $bp, $bp )

    BR

    SDQ

    Avatar of Michael Berra
    Michael Berra
    Participant

    @miguael

    Sorry, I found, that it doesn’t work, how it should. I am not really a programmer, so you might help. I just deleted the piece of code you mentioned. The problem is, that now in every activity-stream in my friends profile not their activity is shown, but the activity of all my friends (everywhere the same…). Did I do something wrong or is there a fix for that?

    Thanks again!

    Michael

    Avatar of Sdq80
    sdq80
    Participant

    @sdq80

    Try to add the home page component to the if statement.

    BR

    SDQ

    Avatar of Michael Berra
    Michael Berra
    Participant

    @miguael

    Hmmmm – sounds good. Can you give me a piece of example code (as I said, I am not a programmer and don’t know, what it means… – sorry). How would that look like and is it instead of the original code (which I just deleted by now…)?

    Thanks alot for your efforts,

    Michael

    Avatar of Michael Berra
    Michael Berra
    Participant

    @miguael

    Please :-) !

    Greez, Michael

    Avatar of Westpointer
    westpointer
    Participant

    @westpointer

    This is very interesting. I’d love to see a nice write up on it too.

    Avatar of Sdq80
    sdq80
    Participant

    @sdq80

    @Michael, it depends on the page that you are using! for me I’ve added the profile component, but I’m not sure if this is going to work with you.

    BR

    SDQ

    Avatar of Michael Berra
    Michael Berra
    Participant

    @miguael

    I’m not sure, maybe for me it’s a language-problem (which “Page”?, profile component???). Can you give me the example, what code you put there instead of the original. Then I will just hope, that I can adapt it… (otherwise I will ask no more :-))

    Thanks alot!

    Avatar of Matt082606
    matt082606
    Participant

    @matt082606

    why couldn’t you just do this: (of course add style <div>’s etc… just hacking this out quickly)

    <?php if ( bp_has_friendships() ) : ?>

      <?php while ( bp_user_friendships() ) : bp_the_friendship(); ?>

    • <?php bp_friend_avatar_thumb() ?>

      <h4><?php bp_friend_link() ?></h4>

      <?php bp_friend_last_content_update() ?>

    • <?php endwhile; ?>

    <?php else: ?>

    <div id=”message” class=”info”>

    <p><?php bp_word_or_name( __( “You have no friends”, ‘buddypress’ ), __( “%s’s friends list is currently empty”, ‘buddypress’ ) ) ?></p>

    </div>

    <?php if ( bp_is_home() ) : ?>

    <h3><?php _e( ‘Why not make friends with some of these members?’, ‘buddypress’) ?></h3>

    <?php bp_friends_random_members() ?>

    <?php endif; ?>

    <?php endif;?>

    Avatar of Matt082606
    matt082606
    Participant

    @matt082606

    perhaps I posted wrong the line:

    <?php bp_friend_last_content_update() ?>

    doesn’t do much, you’ll need to decide what material you want to display there.. I assume this is going to be the “home” theme of the wordpress mu right?

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

You must be logged in to reply to this topic.