BuddyDev

Search

Replies

  • Participant
    Level: Master
    Posts: 279
    NikB on in reply to: [Resolved] Mediapress Bulk Uploads again… #32937

    Hi Ravi

    I am in your debt once again! That seems to work very well except… for some reason I’m not getting the feedback message…

    I hardly dare ask but any suggestions as to why that might be? (I tried changing to Twenty Twenty theme and have the same issue so it’s not the theme.)

    Regards
    Nik

  • Participant
    Level: Master
    Posts: 279
    NikB on in reply to: [Resolved] Mediapress Bulk Uploads again… #32931

    Wow… that works! Thank you so much Ravi.

    Not quite sure where I came up with ‘mpp_media_publish’ as an activity type, but I think I must have misunderstood as I now see that’s used as an activity meta entry for _mpp_activity_type. (The confusing thing was that changing the activity type as I described, DID actually seem to work but I’m not going to lose any sleep over figuring that one out, since your way is obviously the oorrect way and saves having to fiddle with the code any further)!

    Now… if I can just find a way of keeping the user on the same (upload) page when they click “Publish” (as described in my point 1 above), things would be just perfect but I’m rather guessing the fact that they get sent to the “Edit Gallery” page is down to the js and therefore may be trickier to amend?

    Thank you again and regards
    Nik

  • Participant
    Level: Master
    Posts: 279
    NikB on in reply to: [Resolved] Mediapress Bulk Uploads again… #32928

    Many thanks Ravi.

    To be honest, point 2 is more of an issue than point 1, and I can’t even work out how/why it’s happening but would definitely be great if I could find a way to solve both issues.

    I’ll look forward to hearing from you.
    Nik

  • Participant
    Level: Master
    Posts: 279
    NikB on in reply to: [Resolved] Mediapress Bulk Uploads again… #32925

    Hi again Ravi

    Sorry to trouble you again but I now have the concept working quite well by editing your code as follows –

    `add_action( ‘mpp_enqueue_scripts’, function () {

    $gallery_id = mpp_get_current_gallery_id();

    $link = mpp_gallery_get_publish_activity_url( $gallery_id );

    $format_link = ‘<a href=”‘. $link .'” rel=”noopener”>PUBLISH</a>’;

    $publish_link = sprintf(
    “Click %s HERE.”,
    $format_link
    );

    wp_add_inline_script(
    ‘mpp_uploader’,
    “jQuery(document).on( ‘mpp:uploader:upload:complete’, function( self, up, files ) {
    jQuery(‘div#mpp-uploaded-media-list-gallery’).append(‘” . $publish_link . “‘);
    } );”
    );
    }, 11 ); `

    However… a couple of things which would make it even better, and if I can possibly trouble you just a little more, I wonder if you have any thoughts on the following –

    1. Clicking “Publish” takes the user to the Gallery Edit page (with the message “Published to activity successfully”). Whilst not a major issue, this is not ideal as a little confusing for users when they end up on a different page. Do you have any suggestions for ending up on the Upload page (but still with the success message)?

    2. This is an odd one but seems to be happening even when users click “Publish to activity” from the Edit Gallery page, so I’m actually wondering if it’s a bug ie. the activity entry created has the type “mpp_media_upload” and the entry in the activity feed simply shows the users name and a grid of the images they have uploaded. If I “manually” change the activity type in the database to “mpp_media_pubish” then the activity shows the text “X shared 2 photos to Y” (which is obviously preferable). Any idea why this is happening and/or what can be done to solve the issue?

    ie. Am I right in thinking that in this scenario (ie. single activity entry for multiple images) type SHOULD be being set as “mpp_media_publish” and if so, why isn’t this happening?

    I’ve been wanting to solve the multiple upload issue for months now, and with your assistance, I think I’m finally almost there, but would really appreciate any thoughts on these last two outstanding “tweaks”.

    Warm regards
    Nik

  • Participant
    Level: Master
    Posts: 279
    NikB on in reply to: [Resolved] Mediapress Bulk Uploads again… #32922

    Ravi you’re a star!

    I can see how that works and can (hopefully) tweak it further in order to produce the link I need.

    Thank you so much for your asssitance.

    Nik

  • Participant
    Level: Master
    Posts: 279
    NikB on in reply to: [Resolved] Mediapress Bulk Uploads again… #32920

    Hi Ravi

    Thank you for the hint. That definitely looks promising although unfortunately I’m not so familiar with js so if you have any suggestions as to how I would take advantage of that in PHP, I would be very grateful.

    No worries if not… it looks like the right direction so I’ll do a bit more research of my own.

    Regards
    Nik

  • Participant
    Level: Master
    Posts: 279

    Thank you so much Brajesh and you are of course perfectly right, this is really not a Mediapress issue.

    Please do feel free to close this thread.

    Warm regards
    Nik

  • Participant
    Level: Master
    Posts: 279

    Hi Brajesh

    I’m not quite sure I follow what you’re saying as WP ULike also registers a new activity type ‘wp_like_group’ but possibly it’s not getting used correctly somehow.

    Thank you for your thoughts though. I will investigate further.

    Regards
    Nik

  • Participant
    Level: Master
    Posts: 279
    NikB on in reply to: Nested Buddypress profile fields #30763

    Thank you again Brajesh.

    Putting it in the functions.php looks as if it will work although I am now getting the error “Declaration of BD_XProfile_Field_Type_Country::display_filter($field_value) should be compatible with BP_XProfile_Field_Type::display_filter($field_value, $field_id = ”) in… ” I’m guessing something must have changed since the code was written so will have a look at your custom field types to see if I can spot the difference 😉

    Regards
    Nik

  • Participant
    Level: Master
    Posts: 279
    NikB on in reply to: Nested Buddypress profile fields #30752

    Hi Brajesh

    Thank you again. I’m not familiar with creating a new field type but would this then automatically generate (and populate) the two select boxes?

    I did come across this – https://gist.github.com/sbrajesh/5b3f4fd44c9c91b3ed3e – which looks like your work from some years ago (perhaps what you were referring to) but this caused an error when added to my bp-custom.php (ie. Class ‘BP_XProfile_Field_Type_Selectbox’ not found in C:\xampp\htdocs\mach2\wp-content\plugins\bp-custom.php). I’m guessing maybe I should look at how you have achieved similar with your BuddyPress Xprofile Custom Field Types plugin and follow a similar process?

    Regards
    Nik