Replies
Hi Kenny,
Thank you. Please drop me a mail at brajesh@buddydev.com and I will help. If you just need a trigger, I can do that in minutes and you won’t have to pay anything( you will have to call your own stripe processing code in that case).Thank you
BrajeshHi Jay,
Can you please check if there is an empty line at the bottom of the list? I am sorry about that but after the last entry, there should not be any empty line/space. That matches everything and allows registration from all.Thank you for clarifying Jay. Please let me check it and I will get back to you in next 5-10 minutes.
- Brajesh Singh on February 3, 2016 at 5:19 am in reply to: [Resolved] Mediapress – Predefined User Galleries #2485
Hi,
Thank you for confirming.If I understand correctly, you want different tabs for each type of gallery. I don’t remember correctly if we have already implemented it in MediaPress( You can always use custom query to do it, I am checking it we have it inbuilt). I will get back to you in an hour.
Thank you
Brajesh Hi Jay,
I am looking at the Media Vault and will have some solution by the day end.
@enboig
I have replied to your ticket on MediaPress gihub repo, we may not add that type of privacy in core.Hi Jay,
Is it not allowing you to add more than 1193, There is no limit(It is being stored in options table which is a mysql longtext field(which is around 4GB and should allow more than 100K emails(not great for performance though as we load it as array)).Can you please explain the current behavior( anyone can register with any email?)
- Brajesh Singh on February 1, 2016 at 7:22 pm in reply to: [Resolved] Mediapress – Predefined User Galleries #2477
You are most welcome. It a pleasure to support MediaPress 🙂
Have you removed the old code and action from last step? If yes, then it should only create 3 galleries per user.
if there was an older gallery, then that will exists. Can you please try it by creating a new user and then logging as the user and visiting his/her profile.
- Brajesh Singh on February 1, 2016 at 6:30 pm in reply to: [Resolved] Mediapress – Predefined User Galleries #2474
Hi,
Thank you. The code below is modified code from last step.Here, we have broken the auto creation into 2 functions to make it even simpler.
/** * Creates a gallery * * @param array $args * @type int $creator_id owner of the gallery * @type string $title gallery title * @type string $description gallery description * @type string $status possible values( public, private, loggedin etc) * @type string $component possible values( 'members', 'groups' etc) * @type int $component_id owner id( user_id or group id depending on specified $component) * @type string $type media type( possible values photo, audio, video, doc) * * @return int|boolean|WP_Error */ function mpp_custom_create_gallery( $args ) { $user_id = get_current_user_id(); $default = array( 'creator_id' => $user_id, 'title' => '', 'description' => '', //add description if any 'status' => mpp_get_default_status(),//can use any of the status e.g. 'public' , 'private', 'loggedin', 'friends' etc 'component' => 'members',//for user 'component_id' => $user_id,//no need to change 'type' => 'photo', //can change to "audio", "video", "doc" ); $args = wp_parse_args( $args, $default ); $gallery_id = mpp_create_gallery( $args ); return $gallery_id; } function mpp_custom_auto_create_gallery() { if ( ! bp_is_my_profile() ) { return ; } //make sure that user gallery functions are available if ( ! function_exists( 'mpp_create_gallery' ) ) { return; } $user_id = get_current_user_id(); //does this user has predefined gallery? //we use this check to avoid same type of gallery again and again for the user if ( ! get_user_meta( $user_id, '_mpp_predefined_gallery_photo_1', true ) ) { $gallery_id = mpp_custom_create_gallery( array( 'title' => 'Smple Gallery 1', 'type' => 'photo', //can be 'audio', 'video', 'doc' 'status'=> mpp_get_default_status() ) ); //let us keep the id in usermeta to avoid creating it again, right? if ( $gallery_id && ! is_wp_error( $gallery_id ) ) { update_user_meta( $user_id, '_mpp_predefined_gallery_photo_1', $gallery_id ); //you can change the key to anything } }//end of repeatable block //2nd gallery if ( ! get_user_meta( $user_id, '_mpp_predefined_gallery_photo_2', true ) ) { $gallery_id = mpp_custom_create_gallery( array( 'title' => 'Smple Gallery 2', 'type' => 'photo', //can be 'audio', 'video', 'doc' 'status'=> mpp_get_default_status() ) ); //let us keep the id in usermeta to avoid creating it again, right? if ( $gallery_id && ! is_wp_error( $gallery_id ) ) { update_user_meta( $user_id, '_mpp_predefined_gallery_photo_2', $gallery_id ); //you can change the key to anything } } //3rd gallery if ( ! get_user_meta( $user_id, '_mpp_predefined_gallery_photo_3', true ) ) { $gallery_id = mpp_custom_create_gallery( array( 'title' => 'Smple Gallery 3', 'type' => 'photo', //can be 'audio', 'video', 'doc' 'status'=> mpp_get_default_status() ) ); //let us keep the id in usermeta to avoid creating it again, right? if ( $gallery_id && ! is_wp_error( $gallery_id ) ) { update_user_meta( $user_id, '_mpp_predefined_gallery_photo_3', $gallery_id ); //you can change the key to anything } } //and so on } add_action( 'mpp_actions', 'mpp_custom_auto_create_gallery' );
So, please use this code for the last part instead of the previous. I hope, It gives you better idea.
- Brajesh Singh on February 1, 2016 at 5:17 pm in reply to: [Resolved] Mediapress – Predefined User Galleries #2472
Hi,
No problem. I can do that in a minute. Can you please give me the Name for galleries and type for these galleries.Thank you
Brajesh - Brajesh Singh on February 1, 2016 at 5:10 pm in reply to: [Resolved] Mediapress – Predefined User Galleries #2470
Thank you. I am happy it is working. Please do let me know how it went.