Replies
- Brajesh Singh on April 14, 2017 at 4:20 am in reply to: [Resolved] Remove add friend button for member type on members page/members loop #8595
Hi Tosin,
about your last question.It is difficult to disable based on the member types as the member type is registered too late.
Ravi & I looked at it and we found that we can disable the component conditionally but not using member type as context./ if using the user roles as context will work for you please let us know and we will post the code.
Thank you
Brajesh - Brajesh Singh on April 14, 2017 at 3:46 am in reply to: [Resolved] Remove add friend button for member type on members page/members loop #8594
Posted a solution there.
- Brajesh Singh on April 14, 2017 at 3:45 am in reply to: [Resolved] Remove "add friend" button from admins' profile #8593
Hi,
Please use the following code in bp-custom.php/** * Disable add friends button fro admin users * * it is an example and not recommended. It can cause n extra queries due to capability checking on the members loop. * * @param $button * * @return mixed */ function buddydev_hide_admin_friends_button( $button ) { if( ! isset( $button['id'] ) || $button['id'] != 'not_friends' ) { return $button; } $user_id = absint( str_replace( 'friend-','', $button['link_id'] ) ); if ( ! $user_id ) { return $button ; } //we can check using is_super_admin( $user_id ) || user_can( $user_id, 'cap' ) if ( user_can( $user_id, 'manage_options' ) ) { $button['id'] = false; } return $button; } add_filter( 'bp_get_add_friend_button', 'buddydev_hide_admin_friends_button' );Please do note that it will cause n extra queries on the members loop.
Regards
Brajesh - Brajesh Singh on April 14, 2017 at 3:28 am in reply to: [Resolved] Change color of Activity Time Hyperlinks #8592
Hi dandy,
Thank you for posting.Please put teh following code in your css file
#activity-stream li .activity-content a.activity-time-since { color: red !important; /** change with your own color*/ }change the color with your preferred color and it will work.
Regards
Brajesh - Brajesh Singh on April 13, 2017 at 1:55 pm in reply to: [Resolved] Alllow one more role than admin to see "private" gallaries #8589
Sorry, my bad.
I will need a little time on this one as it needs some UI change. Please give me a day.
Thank you
Brajesh - Brajesh Singh on April 13, 2017 at 11:28 am in reply to: [Resolved] Remove add friend button for member type on members page/members loop #8585
Hi Sadiqur,
Please open a new topic and we will post a solution.Thank you
Brajesh Thank you.
It is very strange(havew seen it for the first time).I am looking at it and will get back to you later today.
Thank you
Brajesh- Brajesh Singh on April 13, 2017 at 4:58 am in reply to: [Resolved] BuddyPress Limit Friendship Issue #8581
Hi Richard,
Sorry for the delayed example.here is an example code to limit based on role
/** * Limit BuddyPress friendship based on WordPress roles * * @param int $count how many * @param int $user_id for the given user. * * @return int allowed no. of friends */ function buddydev_limit_friendship_count_based_on_role( $count, $user_id ) { if ( user_can( $user_id, 'manage_options' ) ) { //site admin $count = 100; // 100 friends allowed } elseif ( user_can( $user_id, 'moderate_comments' ) ) { //editor } elseif ( user_can( $user_id, 'edit_published_posts' ) ) { //authors } elseif ( user_can( $user_id, 'read' ) ) { //subscriber $count = 3; // only 3 allowed for subscribers } return $count; } add_filter( 'bp_limit_friendship_count', 'buddydev_limit_friendship_count_based_on_role', 10, 2 );Hope it helps.
Regards
Brajesh - Brajesh Singh on April 13, 2017 at 4:19 am in reply to: Why not one Gallery (Folder) for files as expected by sitewide #8580
Hi Jaroslaw,
Thank you for posting.In case of MediaPress, by default each user have their own gallery for each type of media(wall gallery).
Are you using the shortcode to create sitewide gallery? Uploads from activity stream goes to personal gallery and not to sitewide gallery.
if it is happening for a user( say a user uploads 2 photos and there are 3 gallerires created, then it is an issue).
Now, If I look at your question, It seems you want a single shared gallery for all users to upload? It is possible using our Global Shared gallery addon and filtering on wall gallery to avoid create one for each. Please let me know if this is what you want?
Thank you
Brajesh Hi Thomas,
I am sorry that file is not opening for me.