Replies
Hey Ravi
Just to follow up on this… I re-installed a fresh copy of Mediapress and it now works like a dream! (I can only assume I may have accidentally edited one of the core files when trying to get this to work – yes I know that’s a big “no no” and will teach me to be more careful in future 😉 )
Thank you again for working with me on this. The site has been running for over a year now and the users have been nagging for this feature but initially I just couldn’t see how it could be achieved.
I do have to say, I personally feel this should be the default behaviour (ie. bulk uploads get posted as a single activity, as would happen with Facebook etc.) but I can only assume there are good reasons why Mediapress doesn’t work this way, and I think together we’ve at least found a perfectly acceptable work-around.
Warm regards
NikHmm… that’s really odd. I DO get notices on the Edit Gallery page, but not on the Upload page.
So far I’ve tried… switching to Twenty Twenty theme, switching from Firefox to Chrome, and also removing ALL code from my bp-custom.php file (except that required to generate the Publish link) in order to exclude any other customisations I might have made.
It seems unlikely that it could be a plug-in conflict since the notices work fine on the Edit Gallery page so I can’t think why another plug-in would be affecting just the one page but since from your screenshot, the issue clearly seems to be on my side of things, I’ll see what else I can think of!
Thank you again for your help… I can see that everything you’ve suggested *should* be working. Now I juat have to figure out why it’s not for me 😉
Regards
NikHi 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
NikWow… 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
NikMany 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.
NikHi 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
NikRavi 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
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- NikB on July 1, 2020 at 3:36 pm in reply to: [Resolved] Buddypress activity filter – Gallery Updates conflict #31346
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 - NikB on June 30, 2020 at 9:49 pm in reply to: [Resolved] Buddypress activity filter – Gallery Updates conflict #31331
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