BuddyDev

Search

Member Gallery Names

  • Participant
    Level: Enlightened
    Posts: 23
    wingflap on #51153

    I noticed that I can create galleries in my Profile area. In the sitewide Gallery, that gallery appears as an image in the gallery and the name. If I upload a picture to the Activity Feed, a new gallery is created for me called Wall Photo Gallery. If another user uploads a picture via the Activity Feed, they also get a gallery created for them called Wall Photo Gallery.

    While this makes sense for viewing the galleries from within a member’s profile, It’s confusing to see 2 galleries called “Wall Photos Gallery” in the sitewide gallery.

    Maybe in the sitewide gallery, along with the cover image and the gallery name, you could include the member name of the person who created the gallery.

    I haven’t played around with BuddyPress groups and galleries within them, but I assume there would be a similar issue?

    I’ve really enjoyed playing around with this plugin. Thanks for all of your effort!

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #51159

    Hello,

    Thank you for posting. I will check if we can modify the gallery name by user name on the galleries directory. I will update you soon.

    Regards
    Ravi

  • Participant
    Level: Enlightened
    Posts: 23
    wingflap on #51161

    Thanks

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #51163

    Hello,

    Please try the following code:

    
    add_action( 'mpp_before_gallery_entry', 'buddydev_modify_gallery_title' );
    remove_action( 'mpp_after_gallery_entry', 'buddydev_modify_gallery_title', 10 );
    
    function buddydev_modify_gallery_title() {
    	add_filter( 'mpp_get_gallery_title', function ( $title, $gallery_id ) {
    
    		if ( mpp_is_gallery_directory() && mpp_is_wall_gallery( $gallery_id ) ) {
    			$gallery = mpp_get_gallery( $gallery_id );
    
    			if ( 'groups' === $gallery->component ) {
    				$title = sprintf( '%s wall gallery', bp_get_group_name( $gallery->component_id ) );
    			} else {
    				$title = sprintf( '%s wall gallery', bp_core_get_user_displayname( $gallery->user_id ) );
    			}
    		}
    
    		return $title;
    	}, 10, 2 );
    }
    
    

    Please give it a try and let me know if it helps or not.

    You can put this code in ‘bp-custom.php’ file. For more info check the following URL:

    https://buddydev.com/docs/buddypress-guides/what-is-bp-custom-php/

    Regards
    Ravi

  • Participant
    Level: Enlightened
    Posts: 23
    wingflap on #51166

    I created the file’bp-custom.php’ in /wp-content/plugins.

    It now reads:

    <?php
    // your php custom code goes below this line.
    
    add_action( 'mpp_before_gallery_entry', 'buddydev_modify_gallery_title' );
    remove_action( 'mpp_after_gallery_entry', 'buddydev_modify_gallery_title', 10 );
    
    function buddydev_modify_gallery_title() {
    	add_filter( 'mpp_get_gallery_title', function ( $title, $gallery_id ) {
    
    		if ( mpp_is_gallery_directory() && mpp_is_wall_gallery( $gallery_id ) ) {
    			$gallery = mpp_get_gallery( $gallery_id );
    
    			if ( 'groups' === $gallery->component ) {
    				$title = sprintf( '%s wall gallery', bp_get_group_name( $gallery->component_id ) );
    			} else {
    				$title = sprintf( '%s wall gallery', bp_core_get_user_displayname( $gallery->user_id ) );
    			}
    		}
    
    		return $title;
    	}, 10, 2 );
    }
    

    Both the Sitewide Gallery and the gallery in the member profile still just shows “Wall photo Gallery”.

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #51171

    Hello,

    Thank you for the acknowledgement. The above shared code only works on the galleries directory page. If you want to modify the gallery title at all other places. Please remove the ‘mpp_is_gallery_directory() &&’ from the code and give it a try.

    Regards
    Ravi

  • Participant
    Level: Enlightened
    Posts: 23
    wingflap on #51175

    Making the change made it so that in the Profile Gallery tab, the gallery names for Wall Gallery are being changed to include the member’s name.

    My Gallery page for the sitewide gallery is a page with the shortcode [mpp-list-gallery]

    Should I be using something else for my Gallery directory page?

  • Participant
    Level: Enlightened
    Posts: 23
    wingflap on #51176

    I’ve also noticed that I can’t edit a gallery. Either from the sitewide gallery page or from the Profile/Gallery page. When I click on the Edit tab in the Profile Gallery, I see the tabbed profile menu. under that I see options: My Gallery | Create a Gallery Photo | Edit | Add Media. When I click Edit, I’m bought to a page with no content and a breadcrumb that reads: Your Galleries/Pete/Bp_member_profile_edit. There’s no way to edit anything at the gallery level.

    I would have created a new topic for this, but wasn’t sure if it’s related.

  • Participant
    Level: Enlightened
    Posts: 23
    wingflap on #51177

    Can’t figure out how to edit a post, so this is an extension of the one before. I’m finding that trying to edit a gallery or an individual picture redirects to a URL ending with /BP_member_profile_edit.

    From Profile gallery, If I click the image, I’m brought to the lightbox with the first image from the gallery showing (with arrows to scroll through the remainder of the gallery photos. Each photo has a link in the lightbox to EDIT. When clicked, the display in the lightbox expands to reveal a dropdown for Public/Private, a text box to edit the title and another to edit the description.

    From the Profile gallery, If I click the button that says “View”, I’m brought to the single photo page and can see the photo. If I click Edit, I’m brought to a page that ends /BP_member_profile_edit.

    I can’t figure out how to edit the picture’s Title, Description, and privacy settings from the regular page (as opposed to from the lightbox).

    I also can’t find a way to edit the Gallery’s name and description.

    Sorry if I’m being annoying.

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

    Hi,
    The editing issue seems like a but bug with BP 12.0 compatibility.

    We will push an update next week for the BP 12.0 compatibility. For the time being, Please use it with BP 11.4 or try BP classic addon to see if it works.

    Regards
    Brajesh

You must be logged in to reply to this topic.

This topic is: not resolved