BuddyDev

Search

Replies

  • Participant
    Level: Enlightened
    Posts: 97
    NikB on #38219

    Hi Brajesh

    I’m so very sorry to hear you were unwell. I very much hope you’re feeling better very soon and no real rush on this one although it will be great to hear from you if/when you are able.

    Regards
    Nik

  • Participant
    Level: Enlightened
    Posts: 97
    NikB on #38138

    Hi Brajesh

    Just wondering if you’d had a chance to look at this yet? It would certainly be very useful if/when you get the chance.

    With many thanks in advance.
    Nik

  • Participant
    Level: Enlightened
    Posts: 97
    NikB on #37796

    Hi Brajesh

    Thank you SO much!

    I feel as if I must be almost there, and have been looking through your code to work out how things are done for other media types, but it would probably be a LOT quicker if you could possibly help me to “join the dots” 😉

    With a million thanks in advance and will look forward to hearing from you.
    Nik

  • Participant
    Level: Enlightened
    Posts: 97
    NikB on #37783

    Hi Ravi

    Many thanks again although I’m sorry, I think I’m even more confused now. Do I need to use all of that code (which makes reference to additional plugin files, scripts etc)?

    All(?) I want to do is to be able to display presentations (gallery and single media) in a similar way as currently happens for documents.

    Regards
    Nik

    PS. I tried adding –

    function mpp_custom_register_default_gallery_view() {
        
        $view = MPP_Gallery_View_Default::get_instance();
        mpp_register_gallery_view( 'presentation', $view );
            
    }
     
    add_action( 'mpp_setup', 'mpp_custom_register_default_gallery_view', 11 );

    … which seemed to be a step in the right direction but then adding –

    function mpp_custom_register_presentation_default_view() {
    mpp_register_media_view( 'presentation', 'default', new MPP_Media_View_Presentation() );      
    }
     
    add_action( 'mpp_setup', 'mpp_custom_register_presentation_default_view', 11 );

    … caused an error so I’m clearly not quite there yet.

  • Participant
    Level: Enlightened
    Posts: 97
    NikB on #37780

    Hi Brajesh
    Thank you for getting back to me.

    I (possibly rather lazily) simply copied the text from the link above ie.

    function mpp_custom_register_presentation_type() {
            
        //video
        mpp_register_type( array(
                'key'           => 'presentation',
                'label'         => __( 'Presentation', 'mediapress' ),
                'labels'        => array(
                                    'singular_name'    => __( 'Presentation', 'mediapress' ),
                                    'plural_name'    => __( 'Presentations', 'mediapress' )
                ),
                'description'   => __( 'Presentation media type taxonomy', 'mediapress' ),
                'extensions'    => array( 'ppt', 'pps', 'pptx', 'odp' )
        ) );
            
    }
     
    add_action( 'mpp_setup', 'mpp_custom_register_presentation_type', 11 );

    Followed by –

    function mpp_custom_register_presentation_type_support() {
     
        
        mpp_component_add_type_support( 'sitewide', 'presentation');
        mpp_component_add_type_support( 'members', 'presentation');
            
    }
     
    add_action( 'mpp_setup', 'mpp_custom_register_presentation_type', 12 );

    From what you say, it sounds as if I also need to use mpp_register_gallery_view and mpp_register_media view (which seems quite obvious now I think about it)?

    Assuming that’s the case, I guess I may be able to figure things out myself but again, any suggestions much appreciated.

    With many thanks as always
    Nik

  • Participant
    Level: Enlightened
    Posts: 97
    NikB on #37734

    PS. I was doing some more investigation into this and notice that there is an error message appearing in the code “Unable to display content. Needs a registered view.”

    I also noticed that in settings under “Members Gallery Default Views”, for the newly added “Presentations” there is no option to select Grid or List view but simply the words “It will be used as the default view. It can be overridden per gallery”…

    I’m just wondering if either of these may give a hint to the issue. Possibly Mediapress has been updated since the code I copied (see link given in original post) was created and it needs tweaking slightly?

    With many thanks again for any thoughts.
    Nik

  • Participant
    Level: Enlightened
    Posts: 97
    NikB on #37718

    Hi Ravi

    Many thanks for your reply and I’m not aware of using any custom media loop.

    If it makes any difference, “documents” work fine. It’s only the newly added “presentations” that don’t.

    Warm Regards
    Nik

  • Participant
    Level: Enlightened
    Posts: 97
    NikB on #37709

    Hi Ravi

    Thank you so much for getting back to me.

    Viewing the file in the format you have described works perfectly but not when viewing the gallery. I don’t think I can upload a screenshot here but the gallery appears as follows –

    Edit
    Add Media
    Your Gallery/My Test Presentation Gallery

    Then a line of scribbled text… which isn’t “clickable”.

    I’ve tried disabling all plugins except BuddyBoss and MediaPress and reverting to Twenty Twenty theme.

    I’m really hoping it’s not a BuddyBoss issue (unfortunately my clients’ choice, not mine) and something simpler such as a setting I may have missed?

    With many thanks in advance.

    Nik

  • Participant
    Level: Enlightened
    Posts: 97
    NikB on #37572

    Hi Brajesh

    Thank you for your reply although I don’t really think it’s a BuddyBoss issue (and perhaps I have explained badly).

    Essentially I have a function called bp_change_group_button which runs on – add_filter( ‘bp_get_group_join_button’, ‘bp_change_group_button’ ).

    The bit of code within the function which I want to change is –

    if ( !bp_group_has_requested_membership( $group ) ) {
    						$button = array(
    							'id'                => 'request_membership',
    							'component'         => 'groups',
    							'must_be_logged_in' => false,
    							'block_self'        => false,
    							'wrapper_class'     => 'group-button ' . $group->status,
    							'wrapper_id'        => 'groupbutton-' . $group->id,
    							'link_href'         => wp_nonce_url( bp_get_group_permalink( $group ) . 'request-membership', 'groups_request_membership' ),
    							'link_text'         => __( 'Request Membership', 'buddypress' ),
    							'link_title'        => __( 'Request Membership', 'buddypress' ),
    							'link_class'        => 'group-button request-membership',
    						);

    ie. instead of prompting a membership request, I simply want to somehow add a link to that particular button so that it will divert to a particular page. It feels as if that really shouldn’t be a particularly complicated requirement so maybe I’m being an idiot or missing something obvious which is why I thought I might ask you guys who are so familiar with BuddyPress, but I do also fully appreciate that you may feel it’s outside of your scope 😉

    Thank you so much for your time anyway and I shall do a bit more investigation myself.
    Nik

  • Participant
    Level: Enlightened
    Posts: 97
    NikB on #37537

    Hi Ravi

    Thank you so much for getting back to me.

    It’s actually quite a complex set up but I suspect the main things you need to know are that I’m using BuddyBoss & BuddyBoss theme with the Nouveau template pack.

    It may/may not be relevant but as a bit of background, what I’m trying to create (and as far as I am aware, no single plugin currently handles this fully, at least not in the way I need) is a situation where members have to pay to join a group. Using a couple of other plugins and some custom coding, I now have a “Join Now” button which appears underneath the group_header_meta and links to the relevant Woocommerce product. This all works perfectly and as intended but in order to tidy things up, what I’d really like is for the “Request Membership” button to have this same link so that it will appear in the same place as the other “group action” buttons and I can get rid of the additional button under the meta.

    So… essentially my query is as above ie. I’d like to be able to make the “Request Membership” button link to a url for which I can probably generate the string myself (but will be something like $url = get_permalink( $product_id )) although for the purposes of any example you might be able to offer, simply a link to say, the home page, would be fine and I can then tweak the code a little further from there myself.

    Hope that makes sense and hasn’t over-complicated things too much. The bottom line is that all I want the “Request Membership” button to do is to link to another page 😉

    With fingers crossed and very many thanks in advance.
    Nik