Replies
Hi,
I am sorry but I haven’t reworked on it. Spent last few days preparing MediaPress for WordPress.org submission and the documentation. Have finally submitted it.I won’t be able to work on it today but will start working on it tomorrow and keep you updated. 2-3 days should be more than enough to have this plugin now.
- Brajesh Singh on January 19, 2016 at 7:35 pm in reply to: On activity stream image click does not open the lightbox #2366
Hi Leo,
Are you using some custom code for MediaPress media status or preventing access. Everything seems fine to me but whenever I try to access the lightbox, the server is sending empty list( most probably permission issue with media visibility).Also, I am not able to visit my own media in my personal galleris.
There can be only 2 reasons.
1. Either there is some custom code preventing the media from being listable/accessible or
2. the _mpp_is_mpp_media meta is not being stored.I doubt it is the first issue.
Have you made any changes/upgrades or custom code?
- Brajesh Singh on January 19, 2016 at 12:18 pm in reply to: On activity stream image click does not open the lightbox #2362
Hi Leo,
Most prbably the response from server is not valid json. Is it happening on the same server where we were testing or somewhere else? Hi Bill,
Welcome to BuddyDev forums.If you have installed the BuddyBlog and BP Simple Front end post plugin, you sould get an out of the box form that allows users to post.
Can you please visit your BuddyPress profile and see if it appearing or not?
Now, “Registering a Form Instance”, You don’t need to do that with BuddyBlog. BuddyBlog does it for you. If you want to modify the form, please do let me know.
Thank you
BrajeshHi Paul,
Thank you for asking.Yes, all of the above except the last one( I will get indo details of that is easily doable).
Here is the code you can put in your bp-custom.php//allow to create only one gallery function mpp_custom_check_gallery_create_permission( $can_do, $component, $user_id ) { if ( is_super_admin() ) { return true; } $total_gallery_count = mpp_get_total_gallery_for_user( $user_id ); if ( bp_is_my_profile() && $total_gallery_count < 1) { return true; } return false; } add_filter( 'mpp_user_can_create_gallery', 'mpp_custom_check_gallery_create_permission', 10, 3 ); //should we automatically create gallery? //allow deleting gallery? no //Restrict gallery deletion function mpp_custom_check_gallery_delete_permission( $can, $user_id ){ if ( is_super_admin() ) { return true; } return false;//do not allow i } add_filter( 'mpp_user_can_delete_gallery', 'mpp_custom_check_gallery_delete_permission', 10, 2 ); function mpp_custom_create_gallery() { if ( ! function_exists( 'mpp_is_user_gallery_component' ) ) { return; } if ( ! bp_is_my_profile() ) { return ; } $user_id = get_current_user_id(); $total_gallery_count = mpp_get_total_gallery_for_user( $user_id ); if ( $total_gallery_count ) { return ; } $gallery_id = mpp_create_gallery( array( 'creator_id' => $user_id, 'title' => sprintf( _x( "%s's Photos", 'wall gallery name', 'mediapress' ), bp_core_get_user_displayname( $user_id ) ), 'description' => '', 'status' => mpp_get_option( 'default_status' ), 'component' => 'members', 'component_id' => $user_id, 'type' => 'photo' ) ); if ( $gallery_id ) { mpp_update_wall_gallery_id( array( 'component' => 'members', 'component_id' => $user_id, 'media_type' => 'photo', 'gallery_id' => $gallery_id ) ); } } add_action( 'mpp_init', 'mpp_custom_create_gallery', 100 );
The above code restricts gallery creation to 1 gallery per user. It will automatically create a photo gallery for a user when the user visits his/her profile. It will not allow users to delete their gallery.
Now, coming to the last one, It is doable as we are storing the media count for each gallery in a meta. I haven’t added a filter to the query, so unable to put the code here. Please give me till tomorrow and I will update MediaPress, then we can restrict the empty gallery from showing.
Hi Brandon,
Thank you for the reply.
1. Where have you applied the css? It is not loaded it seems. If there is a cache please clear and see if that makes it apply(Currently I don’t see the css being applied there)2. yes, you are right about that.
- Brajesh Singh on January 17, 2016 at 6:22 pm in reply to: Mediapress Gallery profile page redirect question #2350
Hi Roberto,
Thank you.It is possible to do so but I have a few questions.
How the user will be able to list all galleries? If you can help me understand that I can put some sample code here.
Thank you
Brajesh Hi Brandon,
My apologies for the delayed reply.Ther are multiple way to make it better. At the moment, It is using your default page template and injecting the theme compatibility content.
If you want to take full control of the whole layout, you can copy “blogin” folder from bp-branded-login to your theme and make it compatible with your theme(Make sure to keep the form code and use any template structure you like)
Other way, if you need simple modification like moving the form to center, you can do it via css like this
#loginform { width: 500px; margin: 0 auto; }
Please let me know which way you will like to go and I will assist further.
PS: I did not get the idea what you mean by using whole page, do you mean making the text boxes expand to whole page? If yes, Please let me know and I can assist.Thank you
Brajesh- Brajesh Singh on January 17, 2016 at 6:07 pm in reply to: BP redirect to profile after login problem #2348
That is very strange. What did you do to solve it?
Hi Christopher,
good to know that you have figured it out 🙂
Here is some code that will do the sameadd_action( 'template_redirect', 'buddydev_rediretc_to_profile' ); function buddydev_rediretc_to_profile() { if ( is_user_logged_in() && is_front_page() ) { wp_safe_redirect( bp_loggedin_user_domain() ); exit( 0 ); } }
Hope that helps.