My Friends Activity
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.
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!
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?
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
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
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.
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…
@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.
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???
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
You are my HERO!!! It works just great for me!!! Thanks alot!
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 )
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?
Try to add the home page component to the if statement.
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,
This is very interesting. I’d love to see a nice write up on it too.
@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.
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 )
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>
<?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 bp_friend_avatar_thumb() ?>
- The topic ‘My Friends Activity’ is closed to new replies.