On the shortcode I have it set up so the user can only upload to one gallery which I have specified, but it has a drop down asking the user to ‘Please select a gallery’ – is it possible to get rid of this drop down and have the user automatically upload to my specified sitewide gallery?
Please see: http://coparenting.org.uk/members/gemspeht/
Thanks
Gemma
Hi Gemma,
Please use the argument “gallery_id” and pass numeric gallery id to it in the uploader shortcode. That should work.Hope that helps.
BrajeshHi Brajesh,
Thanks for your help, I am a little confused though, if I put in a gallery ID to the shortcode all the images for every different member will be loaded into that users gallery?
So for example, this gallery id=8850 is from my gallery which sits here:
http://coparenting.org.uk/members/jemma-tates/mediapress/profile-photos-2
But I don’t want every user to load their images into my gallery I want them on their own links.. do you know what I mean? Thanks
Hi Jemma,
Since you are calling the shortcode in php code( If I remember correctly from the previous posts), It will be easy to find the gallery id for each user.you can use
$gallery_id = mpp_get_wall_gallery_id( array( 'component' => 'members',//can be 'groups', 'sitewide' 'component_id' => get_current_user_id(), //user_id, group id etc based on the component 'media_type' => 'photo'//can be 'video', 'audio', 'photo' etc ) );
That will give you the gallery id. Hope you can use it. Please do let me know if you need any further help.
Thank you
BrajeshHi Brajesh,
Thanks for your help, I tried putting that code in the bp-custom.php file and the shortcode gallery id but there seems to be some errors with the code, can I please send you a screenshot of my code and the error?
Thanks Gemma
Hi Brajesh,
I think I’ve realised do you mean to add that code in the profile loop with the php shortcode?
Where in the code do I put it? Sorry for my lack of knowledge!
<?php
$displayed_user_id = bp_displayed_user_id();
//run the shortcode
echo do_shortcode( “[mpp-media type=’photo’ max=’10’ lightbox=1 gallery_id=” component=’members’ component_id={$displayed_user_id}]” );?>
Please use this code where you want the uploader to appear
$user_id = get_current_user_id(); //or bp_displayed_user_id(); $gallery_id = mpp_get_wall_gallery_id( array( 'component' => 'members',//can be 'groups', 'sitewide' 'component_id' => $user_id, //user_id, group id etc based on the component 'media_type' => 'photo'//can be 'video', 'audio', 'photo' etc ) ); //run the shortcode echo do_shortcode( "[mpp-uploader gallery_id={$gallery_id} ]" );
Hope that helps.
- This reply was modified 8 years, 8 months ago by Brajesh Singh.
It is just showing me an error on two lines.. can i send a screenshot?
You must be logged in to reply to this topic.