Replies
Also I would like to add two more things:
4. the display image for each gallery is whatever the last image was, when the first batch of images was uploaded to that gallery. If I then add a new image later eg the next day and put it in the last position, the cover image does not change.It would be nice if the the Gallery cover image could be chosen.
5. When logged in, in the “My Gallery” view, there are 4 buttons to click on, one is the name of the gallery, one says “view”, one says “upload” and one says “delete”. The first two, when clicked, goes to the exact same place, it goes to gallery page, sort of redundant. The slightly bigger issue I have is, the “upload” button takes you to a page where you can upload more images to that gallery. I would like the “upload” button to say “edit gallery” and lead to the edit option, not to the upload option, since users would intuitively look for an edit option first rather than an upload option.
Thank you
Hello Ravi
Thank you for the quick reply.
Regarding the following issues:
1. I can confirm that for me, after installing and activating “BP Classic”, the breadcrumbs and URL issue is fixed.
2. I can confirm that doing this now shows the description of the galleries.
But, unrelated to this, I wanted to mention that the descriptions for the individual images only show if the “Do not show comments in lightbox” is set to “no” – it seems that descriptions show up as Comments. I have disabled commenting because I am using the site to show portfolios of work rather than for a social media site where people can comment on each other’s posts. Would be nice if the individual photo description is a description independent of the comments but I guess this is a perfectly fine workaround for anyone who couldn’t figure out why the descriptions for individual images aren’t showing in Mediapress.
3. In the screenshots I already uploaded, on the left side of the screen, you can see where it says “gallery” in yellow, directly above and below it there are these light grey things on the left of the word, that look like square brackets.
- Stephanie on June 1, 2024 at 2:10 pm in reply to: [Resolved] How to hide users by user role from the Buddypress Directory #52633
Hello,
Just bumping this thread up so it is not overlooked and forgotten.
- Stephanie on May 27, 2024 at 3:58 am in reply to: [Resolved] How to hide users by user role from the Buddypress Directory #52603
Hello Brajesh,
Your last message landed in my junk folder so I did not see it till now.I am making a job board and want to hide the administrator (ie me) and the job posters so only job seekers are visible in the directory. I have 5 roles in total that I want to hide from the diirectory, including “administrator”, “job_poster”, “student” and two others.
I do not know what their field IDs are and if that is needed but I got the role name from the Members plugin which lists all the user roles on my site.
Also I do not have friends capability added on my site but I left that section of the code in because I am not sure if I can remove it.
To answer your question, here is the exact code I used from the gist page:
Attempt 1, trying to hide multiple roles, specifically “administrator” and “job_poster”:/** * Excludes users from BuddyPress Members list. * * @param string $qs Query string. * @param string $object object loop identikfier. * * @return string */ function bpdev_exclude_users( $qs = false, $object = false ) { if ( $object != 'members' ) { // hide for members only. return $qs; } // comma separated ids of users whom you want to exclude. $excluded_users = join( 'administrator', bpdev_get_excluded_user_ids() ); $args = wp_parse_args( $qs ); // check if we are searching for friends list etc., do not exclude in this case. if ( ! empty( $args['user_id'] ) ) { return $qs; } if ( ! empty( $args['exclude'] ) ) { $args['exclude'] = $args['exclude'] . 'administrator' . $excluded_users; } else { $args['exclude'] = $excluded_users; } $qs = build_query( $args ); return $qs; } add_action( 'bp_ajax_querystring', 'bpdev_exclude_users', 20, 2 ); /** * Retrieves an array of user ids to exclude. * * NOTE:- It is not an efficient idea if you want to exclude thousands of users. There are better ways. * * @return array */ function bpdev_get_excluded_user_ids() { /* // Example:- Multiple roles Exclusion $query = array( 'role__in' => array( 'administrator, job_poster' ), // List of roles to exclude. 'fields' => 'ID' ); */ return get_users( $query ); }
Attempt 2, Limiting display in directory to certain roles only by specifying the single role I want shown (a role called “talent”:
<?php /** * Excludes users from BuddyPress Members list. * * @param string $qs Query string. * @param string $object object loop identikfier. * * @return string */ function bpdev_exclude_users( $qs = false, $object = false ) { if ( $object != 'members' ) { // hide for members only. return $qs; } // comma separated ids of users whom you want to exclude. $excluded_users = join( ',', bpdev_get_excluded_user_ids() ); $args = wp_parse_args( $qs ); // check if we are searching for friends list etc., do not exclude in this case. if ( ! empty( $args['user_id'] ) ) { return $qs; } if ( ! empty( $args['exclude'] ) ) { $args['exclude'] = $args['exclude'] . ',' . $excluded_users; } else { $args['exclude'] = $excluded_users; } $qs = build_query( $args ); return $qs; } add_action( 'bp_ajax_querystring', 'bpdev_exclude_users', 20, 2 ); /** * Retrieves an array of user ids to exclude. * * NOTE:- It is not an efficient idea if you want to exclude thousands of users. There are better ways. * * @return array */ function bpdev_get_excluded_user_ids() { /* // Example: Limiting to certain roles only. $query = array( 'role__not_in' => array( 'talent' ), // List of roles to include. 'fields' => 'ID' ); */ return get_users( $query ); }
I am not a developer. There is a line that says
$excluded_users = join( ',', bpdev_get_excluded_user_ids() );
. Was I supposed to put the roles I want excluded from the directory between the ” injoin(','
? - Stephanie on May 25, 2024 at 7:28 am in reply to: How to deactivate “Media” at the member profile section #52598
Hey Benny,
Do you have a media plugin installed? If you do, deactivate it. I don’t have a media plugin installed so users can’t upload things and there is no “media” button.
- Stephanie on May 22, 2024 at 12:12 pm in reply to: [Resolved] How to hide users by user role from the Buddypress Directory #52576
Hi Brajesh,
Thank you so much for such a speedy reply.
I appreciate that you have updated the code. I only have 5 roles I want to exclude and 1 role I want to include, so I think this piece of code will work for me, but I tried it and it didn’t work for me, it had this problem:
When I tried the “Limiting to certain roles only.”, I added the one role I wanted to include in my directory and when I opened the directory, the page stays stuck on the “Loading the members of your community. Please wait.” message, and shows there are 6 members (when there should be 2 members, both with the same role I wanted to include). The same problem occured when I manually entered the 5 roles I want to exclude. I got the user roles from my wordpress dashboard.
Also, I noted that you mentioned the other BuddyDev article with the code for excluding certain users, I used the code from the github page. Not sure if I was supposed to use the BuddyDev one?
Thank you
Stephanie- This reply was modified 6 months, 2 weeks ago by Stephanie. Reason: Add detail