Tagged: activity, buddyboss, buddypress, comments
All thanks to BuddyDev, my first issue was addressed and I hope I can get a response with this as well.
I want to restrict each user who is not an admin user to only see his/her like and comments and all replies to the comment on another user’s post/update/photo(s)/video(s) etc. in buddyboss.
If the user has not like the update the user won’t see that others have liked it, if he/she liked it, he/she should only see “You liked this”.
On the issue of the comment, only the user comment(s) and all replies to each of his/her comment should be visible to him/her. The user can have more than one comment.
The post owner and admin users comments should not be visible to any other user except the post owner and admin users. The post owner will have to reply to a comment for the comment owner to see it.
Some help with this please
Should somebody gracefully help me answer this question, please note that I only want all the restrictions mentioned above to be effective on personal activities, and not group or forum activities.
I tried looking into the hiding the likes and was able to achieve a result the nonconventional way which ofcourse is not advisable, that is by going directly into the buddyboss code “buddyboss-platform/bp-activity/bp-activity-functions.php/” right after line 1130 below
$return_str = '';
and added the following code/* CFW Site Admin, Staff, and Activity Owner should see all the likes, otherwise display only the particular user like */ $jlw_cur_user = bp_loggedin_user_id(); $jlw_activity_user = bp_get_activity_user_id(); // CFW Check whether it is Admin, Staff or Activity Owner if ( current_user_can( 'manage_options' ) || $jlw_cur_user == $jlw_activity_user ) {
and then I went down, somewhere around line 1204 or 1210, since few lines were added above.
Above the line that saysreturn $return_str;
and added the following code} else { // CFW Closes the if statement and begin an else if ( 1 <= $like_count ) { if ( $current_user_fav ) { $return_str = __( 'You like this', 'buddyboss' ); } } } // CFW Closes the else statement
This works for the like, The post owners and admin users see all the likes, while other users see only “You like this” is he/she did like it, or doesn’t see anything if he/she didnot like it; however, the restriction is being applied everywhere, including group posts etc.
I couldn’t make any progress on the comments, it seems just difficult.
Any help, and I will really appreciate.Once again,
Thanks in advance- This reply was modified 2 years, 2 months ago by Catherine F. Weah.
I hope this tread of mine is not off the limit; if not then someone kindly try and respond to it. Brajesh, any other person, please respond to this tread, please.
Once again, thanks in advance.
Hi Catherine,
I am sorry, I could not look at it earlier.After a close look, It is way too much specific to BuddyBoss and I will suggest asking BuddyBoss support for the same.
Regards
BrajeshHi Brajesh,
Thanks for the effort.Please permit me to ask you this.
Is there any way to pass the user_id as argument inbp_nouveau_activity_recurse_comments
and alsobp_nouveau_activity_comments
if not, then perhaps pass the user_id parameter first.
Or just a way to get the comments of a particular user.
Hi Catherine,
Those 2 functions are predefined in the nouveau template pack and you can not pass extra arguements without altering them.Regards
Brajesh
You must be logged in to reply to this topic.