• Resolved lf2s

    (@lf2s)


    Hello,

    First of all, congratulation for your cool WP plugins! That one and your CCK plugin.

    I just installed your PMS plugin. I have a website with buddypress plugin. I can block some page with your plugin, but not some of general pages like Group or Activity steram from buddypress.

    Could you give me some tips to do so ? Maybe with an add-on or, even a custom function. Could you tell me what is the function to get user’s subscription status (pending or approuved) ? For exemple I could place a redirection on these pages based on what that function return. Or customize BP directly also based on that function. If you have a better solution, I am taking it ??

    Thanks in advance!

    • This topic was modified 7 years, 9 months ago by lf2s.
    • This topic was modified 7 years, 9 months ago by lf2s.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Georgian Cocora

    (@raster02)

    Hello,

    We do not have an integration between PMS and BuddyPress at the moment, so it would require a custom implementation.

    There also isn’t such a function available in PMS, but I have created one for you. You can add it to your theme functions.php file:

    function pmsc_check_user_sub_plan($user_id) {
    	global $wpdb;
    
    	$sql = $wpdb->prepare('SELECT user_id, subscription_plan_id, status FROM wp_pms_member_subscriptions WHERE user_id = %d', $user_id);
    	$row = $wpdb->get_row($sql, ARRAY_A);
    
    	//$row['subscription_plan_id'] is also available if you need to check for a specific subscription plan if it's active.
    	if ($row['status'] == 'active')
    		return 'active';
    	else
    		return 'expired';
    }

    All it needs is an user_id to be passed and it will work. It can be modified to check if a certain subscription plan is active or not and it also does not take in account the canceled and pending status, it treats them as expired.

    Let me know if you need more help with this !

    Best Regards.

    Thread Starter lf2s

    (@lf2s)

    Thank you so much for your time! You have a great support!
    I try that and let you know.

    Regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Specifics pages restiction’ is closed to new replies.