Tagged: bp-anonymous-activity
Hi Brajesh,
I am using your BP Anonymous Plugin and I ran into a problem with it. Posting anonymously works perfectly but on my website I have the option to view the profile of users who post updates. When I post an update as anonymous it shows my name in the profile section.
Here are some screenshots.
When I post a non-anonymous update: http://s4.postimg.org/l9omvni4d/profile.png
When I post a anonymous update: http://s28.postimg.org/9g6qcyvwt/profile2.png
Code I use to display the view profile: http://s9.postimg.org/ns5e97p6n/codeused.png
Is there anyway to get around this problem?
Hi Bryden,
Thank you for asking. Since we are only filtering based on activity, it is not filtering your bare user links.the simple solution is to use a condition like this
$activity_id = bp_get_activity_id(); if( !bp_is_anonymous_activity( $activity_id ) ) { echo "View <span> {$xprofile_user} Profile"; }
Since I have seen incomplete code, that view and span may not be necessary inside the condition. Please update it as it suits.
Hope that helps.
`
Thank-you for the fast response.
Here is the entire line of code:
Obfuscated code block removed by- @sbrajesh
Where exactly would I add your code in there? I am fairly new with php so any guided help would be appreciated, thanks.
- This reply was modified 9 years ago by Brajesh Singh.
Since the code didn’t format well in the comment I have made a screenshot.
Hi Bryden,
Sorry about the trouble.
Can you please tell me what is this $xprofile_user?PS: to post the code please use backticks(`)
Thank you
BrajeshHi Brayden,
Apologies for the delayed reply.
Please use this code instead$activity_id = bp_get_activity_id(); if( ! bp_is_anonymous_activity( $activity_id ) ) :?> <a href="<?php bp_activity_user_link();?>" <span class="text-primary"><i class="fa fa-paper-plane"></i> View </span><?php echo $xprofile_user;?> Profile</a> <?php endif;?>
Here we are only showing the link if the user is not anonymous, otherwise nothing will be shown.
Hi Brayden,
you can update that code with this$activity_id = bp_get_activity_id(); if( ! bp_is_anonymous_activity( $activity_id ) ) :?> <a href="<?php bp_activity_user_link();?>" <span class="text-primary"><i class="fa fa-paper-plane"></i> View </span><?php echo $xprofile_user;?> Profile</a> <?php else :?> <a href="#"><span class="text-primary"><i class="fa fa-paper-plane"></i> </span> Anonymous </a> <?php endif;?>
Also, you can modify it as you need.
Hope that heps.
The topic ‘ [Resolved] Buddypress Anonymous Plugin Quick Question’ is closed to new replies.