BuddyDev

Search

[Resolved] BP anonymous activity NOT working.

  • Participant
    Level: Initiated
    Posts: 7
    Arik Twena on #11024

    Hi Brajesh Singh, you have closed my topic so I can’t answer you….???

    The original massage:
    I have just bought and installed the plugin, but all users can see the original name of the sender. Only the profil picture changes. So itโ€™s not so anonymous.

    Can you please send me a fix for this?

    Your answer:
    Hi Arik,
    Thank you for purchasing the plugin.

    Is there any chance that you are using a plugin/code to filter user display names in activity or anything like this?

    Also, what happens when you click on the user image in the activity stream, does it take to user page or somewhere else?
    PS:- Please make sure you are not logged in as site admin.

    Thank you
    Brajesh

    Answer:
    The new “profile picture” does not link to anything, so that is great.

    I’m using the plugin buddyboss wall, and when I deactivate it, The name on the post changes to anonymous, but on the right side of the profil picture, you still see the name and link to the user.

    But never the less we still need the buddyboss wall plugin and out theme. If not there is no sense in having a clean buddy press installation that just looks boring for our costumers…. The plugin should work no mater what. So we still need a fix for it?

    Next time don’t close the topic. It’s real bad service!!

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #11025

    Hi Arik,
    I am very sorry, I haven’t closed the topic. It seems after my reply you were not able to reply or is there a chance that you were logged off.

    1. I value you purchasing our plugin and I am here to help. There is no question of closing any topic. I or my team will never do it. If it happened, my sincere apologies. We haven’t done it and I am still seeing the topic open, It is most probably some kind of confusion. Also, It is a public forums so I won’t achieve anything by closing an unanswered post.

    Can you please check it one more time and see if it is closed for you or is it some caching
    https://buddydev.com/support/forums/topic/bp-anonymous-activity-not-working/

    My email is brajesh@buddydev.com in case the topic gets closed or anything.

    I haven’t heard anyone about the topic getting closed, so If it is some kind of bug on our forum, My apologies in advance.

    Please check and let me know.

    About the issue- Most probably BuddyBoss wall is filtering on the displayed name and overwriding our name. I will check and update the plugin today.

    Thank you
    Brajesh

    PS: Please do check about the topic closing and let me knwo if it is still happening for you?

  • Participant
    Level: Initiated
    Posts: 7
    Arik Twena on #11026

    Hi

    Thanks. The other topic is still closed for any replay. I don’t know why..

    BUT ๐Ÿ™‚ I think i have found the problem. Its in our theme. I have found a way to change the “name”-link, but our theme has the username next to the avatar in the activity stream.

    Is there a “if” statement i can use here is a user has chosen anonymous?

    The theme has this code:
    <?php
    $member_id = bp_get_activity_user_id();
    echo ‘<div class=”name”>’ . bp_core_get_user_displayname( $member_id ) . ‘</div>’;
    echo ‘<div class=”nice-name”>@’ . bp_core_get_username( $member_id ) . ‘</div>’;
    ?>

    Thanks

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #11027

    Hi Arik,
    Thank you. It’s strange that the other topic is not open for you.
    I am going to close that and link to here as that topic is not working for us.

    Thank you for finding the issue,
    You can use the following

    
    
    if( bp_is_anonymous_activity(  $activity_id ) ) {
    
    // 
    }
    
    

    for example, you can change your above code section to something like this

    
    <?php if( bp_is_anonymous_activity( bp_get_activity_id() ) ) :?>
    // what do you want to show here.,
    <?php else :?>
    
    Your original code here.
    <?php endif;?>
    
    

    Hope that helps.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 7
    Arik Twena on #11028

    Im not so good to PHP, so do you mean like this?

    <?php if( bp_is_anonymous_activity( bp_get_activity_id() ) ) :?>
    // what do you want to show here.,
    <?php else :?>
    $member_id = bp_get_activity_user_id();
    echo ‘<div class=”name”>’ . bp_core_get_user_displayname( $member_id ) . ‘</div>’;
    echo ‘<div class=”nice-name”>@’ . bp_core_get_username( $member_id ) . ‘</div>’;
    <?php endif;?>

    Because this example didn’t work for the last part where it has to show the usernames.

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #11029

    Hi,
    Sorry for my presumption.

    Please use the following code.

    
    <?php if ( ! bp_is_anonymous_activity( bp_get_activity_id() ) ) : ?>
    	<?php $member_id = bp_get_activity_user_id();
    	echo '<div class="name">' . bp_core_get_user_displayname( $member_id ) . '</div>';
    	echo '<div class="nice-name">@' . bp_core_get_username( $member_id ) . '</div>';
    	?>
    <?php endif ;?>
    

    I will only display the @ name for the non anonymous activity.

    Hope that helps.
    PS:- Please do not copy the code from the mail. Copy it from here on forum. The text sent on email is encoded and will cause problem.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 7
    Arik Twena on #11030

    Perfect it works!!!

    One last question. When I login as admin I can’t see the users name. Is there a way to add to the code, so it’s visible for admins only?

    Thanks for the help with the code! ๐Ÿ™‚

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #11031

    Thank you.
    We can easily do that using the following code

    
    <?php if ( ! bp_is_anonymous_activity( bp_get_activity_id() ) || is_super_admin() ) : ?>
    	<?php $member_id = bp_get_activity_user_id();
    	echo '<div class="name">' . bp_core_get_user_displayname( $member_id ) . '</div>';
    	echo '<div class="nice-name">@' . bp_core_get_username( $member_id ) . '</div>';
    	?>
    <?php endif ;?>
    
    

    Hope it works for you.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 7
    Arik Twena on #11032

    Super!!! Thanks. It work 100% now :)))

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #11033

    You are welcome. Thank you for marking it as resolved.

The topic ‘ [Resolved] BP anonymous activity NOT working.’ is closed to new replies.

This topic is: resolved